update parsing of many packets

This commit is contained in:
wish
2023-11-19 02:34:02 +11:00
parent fc57d63689
commit 85fc76edd5
44 changed files with 272 additions and 278 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"
)
// MsgMhfOprMember represents the MSG_MHF_OPR_MEMBER
type MsgMhfOprMember struct {
AckHandle uint32
Blacklist bool
Operation bool
Unk uint16
CharID uint32
AckHandle uint32
Blacklist bool
Operation bool
Unk uint16
CharIDs []uint32
}
// Opcode returns the ID associated with this packet type.
@@ -24,12 +24,15 @@ func (m *MsgMhfOprMember) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfOprMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Blacklist = bf.ReadBool()
m.Operation = bf.ReadBool()
m.Unk = bf.ReadUint16()
m.CharID = bf.ReadUint32()
return nil
m.AckHandle = bf.ReadUint32()
m.Blacklist = bf.ReadBool()
m.Operation = bf.ReadBool()
bf.ReadUint8()
chars := int(bf.ReadUint8())
for i := 0; i < chars; i++ {
m.CharIDs = append(m.CharIDs, bf.ReadUint32())
}
return nil
}
// Build builds a binary packet from the current data.