From 1c350c105096f8b11b15c9e4b157fc807ddd0ee7 Mon Sep 17 00:00:00 2001 From: wish Date: Sun, 13 Nov 2022 13:30:29 +1100 Subject: [PATCH] parse tactics packets --- .../mhfpacket/msg_mhf_add_ud_tactics_point.go | 18 ++++++++---------- .../msg_mhf_get_ud_tactics_reward_list.go | 9 ++++----- server/channelserver/handlers_tactics.go | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/network/mhfpacket/msg_mhf_add_ud_tactics_point.go b/network/mhfpacket/msg_mhf_add_ud_tactics_point.go index d9f818366..5e1f4261a 100644 --- a/network/mhfpacket/msg_mhf_add_ud_tactics_point.go +++ b/network/mhfpacket/msg_mhf_add_ud_tactics_point.go @@ -1,16 +1,17 @@ package mhfpacket import ( + "errors" + "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" - "erupe-ce/common/byteframe" ) // MsgMhfAddUdTacticsPoint represents the MSG_MHF_ADD_UD_TACTICS_POINT type MsgMhfAddUdTacticsPoint struct { - AckHandle uint32 - Unk0 uint16 - Unk1 uint32 + AckHandle uint32 + QuestFileID uint16 + Points uint32 } // Opcode returns the ID associated with this packet type. @@ -21,15 +22,12 @@ func (m *MsgMhfAddUdTacticsPoint) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfAddUdTacticsPoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint16() - m.Unk1 = bf.ReadUint32() + m.QuestFileID = bf.ReadUint16() + m.Points = bf.ReadUint32() return nil } // Build builds a binary packet from the current data. func (m *MsgMhfAddUdTacticsPoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - bf.WriteUint32(m.AckHandle) - bf.WriteUint16(m.Unk0) - bf.WriteUint32(m.Unk1) - return nil + return errors.New("NOT IMPLEMENTED") } diff --git a/network/mhfpacket/msg_mhf_get_ud_tactics_reward_list.go b/network/mhfpacket/msg_mhf_get_ud_tactics_reward_list.go index d1a314ef3..d6edbfbc0 100644 --- a/network/mhfpacket/msg_mhf_get_ud_tactics_reward_list.go +++ b/network/mhfpacket/msg_mhf_get_ud_tactics_reward_list.go @@ -1,11 +1,10 @@ package mhfpacket -import ( - "errors" - - "erupe-ce/network/clientctx" - "erupe-ce/network" +import ( + "errors" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetUdTacticsRewardList represents the MSG_MHF_GET_UD_TACTICS_REWARD_LIST diff --git a/server/channelserver/handlers_tactics.go b/server/channelserver/handlers_tactics.go index e0a84207d..179a73eb7 100644 --- a/server/channelserver/handlers_tactics.go +++ b/server/channelserver/handlers_tactics.go @@ -18,7 +18,7 @@ func handleMsgMhfGetUdTacticsPoint(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfAddUdTacticsPoint(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfAddUdTacticsPoint) - stubEnumerateNoResults(s, pkt.AckHandle) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } func handleMsgMhfGetUdTacticsRewardList(s *Session, p mhfpacket.MHFPacket) {