parse tactics packets

This commit is contained in:
wish
2022-11-13 13:30:29 +11:00
parent cad5f3506b
commit 1c350c1050
3 changed files with 13 additions and 16 deletions

View File

@@ -1,16 +1,17 @@
package mhfpacket package mhfpacket
import ( import (
"errors"
"erupe-ce/common/byteframe"
"erupe-ce/network" "erupe-ce/network"
"erupe-ce/network/clientctx" "erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
) )
// MsgMhfAddUdTacticsPoint represents the MSG_MHF_ADD_UD_TACTICS_POINT // MsgMhfAddUdTacticsPoint represents the MSG_MHF_ADD_UD_TACTICS_POINT
type MsgMhfAddUdTacticsPoint struct { type MsgMhfAddUdTacticsPoint struct {
AckHandle uint32 AckHandle uint32
Unk0 uint16 QuestFileID uint16
Unk1 uint32 Points uint32
} }
// Opcode returns the ID associated with this packet type. // 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 // Parse parses the packet from binary
func (m *MsgMhfAddUdTacticsPoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { func (m *MsgMhfAddUdTacticsPoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32() m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16() m.QuestFileID = bf.ReadUint16()
m.Unk1 = bf.ReadUint32() m.Points = bf.ReadUint32()
return nil return nil
} }
// Build builds a binary packet from the current data. // Build builds a binary packet from the current data.
func (m *MsgMhfAddUdTacticsPoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { func (m *MsgMhfAddUdTacticsPoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
bf.WriteUint32(m.AckHandle) return errors.New("NOT IMPLEMENTED")
bf.WriteUint16(m.Unk0)
bf.WriteUint32(m.Unk1)
return nil
} }

View File

@@ -1,11 +1,10 @@
package mhfpacket package mhfpacket
import ( import (
"errors" "errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe" "erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
) )
// MsgMhfGetUdTacticsRewardList represents the MSG_MHF_GET_UD_TACTICS_REWARD_LIST // MsgMhfGetUdTacticsRewardList represents the MSG_MHF_GET_UD_TACTICS_REWARD_LIST

View File

@@ -18,7 +18,7 @@ func handleMsgMhfGetUdTacticsPoint(s *Session, p mhfpacket.MHFPacket) {
func handleMsgMhfAddUdTacticsPoint(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfAddUdTacticsPoint(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfAddUdTacticsPoint) pkt := p.(*mhfpacket.MsgMhfAddUdTacticsPoint)
stubEnumerateNoResults(s, pkt.AckHandle) doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
} }
func handleMsgMhfGetUdTacticsRewardList(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfGetUdTacticsRewardList(s *Session, p mhfpacket.MHFPacket) {