handle guild mission packets

This commit is contained in:
wishu
2022-07-18 14:08:23 +10:00
parent 939f691d6d
commit 7f486f7632
3 changed files with 34 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
@@ -9,7 +9,11 @@ import (
)
// MsgMhfAddGuildMissionCount represents the MSG_MHF_ADD_GUILD_MISSION_COUNT
type MsgMhfAddGuildMissionCount struct{}
type MsgMhfAddGuildMissionCount struct {
AckHandle uint32
MissionID uint32
Count uint32
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfAddGuildMissionCount) Opcode() network.PacketID {
@@ -18,7 +22,10 @@ func (m *MsgMhfAddGuildMissionCount) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfAddGuildMissionCount) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
return errors.New("NOT IMPLEMENTED")
m.AckHandle = bf.ReadUint32()
m.MissionID = bf.ReadUint32()
m.Count = bf.ReadUint32()
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -1,7 +1,7 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
@@ -9,7 +9,10 @@ import (
)
// MsgMhfCancelGuildMissionTarget represents the MSG_MHF_CANCEL_GUILD_MISSION_TARGET
type MsgMhfCancelGuildMissionTarget struct{}
type MsgMhfCancelGuildMissionTarget struct {
AckHandle uint32
MissionID uint32
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfCancelGuildMissionTarget) Opcode() network.PacketID {
@@ -18,7 +21,9 @@ func (m *MsgMhfCancelGuildMissionTarget) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfCancelGuildMissionTarget) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
return errors.New("NOT IMPLEMENTED")
m.AckHandle = bf.ReadUint32()
m.MissionID = bf.ReadUint32()
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -1596,6 +1596,20 @@ func handleMsgMhfGetGuildMissionRecord(s *Session, p mhfpacket.MHFPacket) {
// No guild mission records = 0x190 empty bytes
doAckBufSucceed(s, pkt.AckHandle, make([]byte, 0x190))
func handleMsgMhfAddGuildMissionCount(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfAddGuildMissionCount)
doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
}
func handleMsgMhfSetGuildMissionTarget(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfSetGuildMissionTarget)
doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
}
func handleMsgMhfCancelGuildMissionTarget(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfCancelGuildMissionTarget)
doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
}
type GuildMeal struct {
@@ -1844,15 +1858,6 @@ func handleMsgMhfAddGuildWeeklyBonusExceptionalUser(s *Session, p mhfpacket.MHFP
doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00})
}
func handleMsgMhfAddGuildMissionCount(s *Session, p mhfpacket.MHFPacket) {}
func handleMsgMhfSetGuildMissionTarget(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfSetGuildMissionTarget)
doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
}
func handleMsgMhfCancelGuildMissionTarget(s *Session, p mhfpacket.MHFPacket) {}
func handleMsgMhfGenerateUdGuildMap(s *Session, p mhfpacket.MHFPacket) {}
func handleMsgMhfUpdateGuild(s *Session, p mhfpacket.MHFPacket) {}