handle TransitMessage

This commit is contained in:
wish
2022-08-05 01:57:56 +10:00
parent e9cc5cc3e2
commit 08a7b91e11
4 changed files with 94 additions and 21 deletions

View File

@@ -1,20 +1,20 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfTransitMessage represents the MSG_MHF_TRANSIT_MESSAGE
type MsgMhfTransitMessage struct {
AckHandle uint32
Unk0 uint8
Unk1 uint8
Unk2 uint16
MessageData []byte
AckHandle uint32
Unk0 uint8
Unk1 uint8
SearchType uint16
MessageData []byte
}
// Opcode returns the ID associated with this packet type.
@@ -24,12 +24,12 @@ func (m *MsgMhfTransitMessage) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfTransitMessage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.Unk2 = bf.ReadUint16()
m.MessageData = bf.ReadBytes(uint(bf.ReadUint16()))
return nil
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.SearchType = bf.ReadUint16()
m.MessageData = bf.ReadBytes(uint(bf.ReadUint16()))
return nil
}
// Build builds a binary packet from the current data.