From b7f9751787f7bb858d0a24c52dfc41050036e631 Mon Sep 17 00:00:00 2001 From: wish Date: Sun, 2 Jul 2023 22:56:52 +1000 Subject: [PATCH] handle BoostTime packets --- .../mhfpacket/msg_mhf_post_boost_time_limit.go | 17 +++++++++++------ server/channelserver/handlers_cafe.go | 10 ++++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/network/mhfpacket/msg_mhf_post_boost_time_limit.go b/network/mhfpacket/msg_mhf_post_boost_time_limit.go index 3f0bc53b8..259712ac8 100644 --- a/network/mhfpacket/msg_mhf_post_boost_time_limit.go +++ b/network/mhfpacket/msg_mhf_post_boost_time_limit.go @@ -1,15 +1,18 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfPostBoostTimeLimit represents the MSG_MHF_POST_BOOST_TIME_LIMIT -type MsgMhfPostBoostTimeLimit struct{} +type MsgMhfPostBoostTimeLimit struct { + AckHandle uint32 + Expiration uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfPostBoostTimeLimit) Opcode() network.PacketID { @@ -18,7 +21,9 @@ func (m *MsgMhfPostBoostTimeLimit) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfPostBoostTimeLimit) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Expiration = bf.ReadUint32() + return nil } // Build builds a binary packet from the current data. diff --git a/server/channelserver/handlers_cafe.go b/server/channelserver/handlers_cafe.go index 46a6425a0..67b7c3807 100644 --- a/server/channelserver/handlers_cafe.go +++ b/server/channelserver/handlers_cafe.go @@ -270,6 +270,12 @@ func handleMsgMhfPostBoostTimeQuestReturn(s *Session, p mhfpacket.MHFPacket) { doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) } -func handleMsgMhfPostBoostTime(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfPostBoostTime(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfPostBoostTime) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +} -func handleMsgMhfPostBoostTimeLimit(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfPostBoostTimeLimit(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfPostBoostTimeLimit) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +}