Make changed parsers size-accurate

This commit is contained in:
Andrew Gutekanst
2020-03-03 02:32:00 -05:00
parent e90cc176ec
commit d300098838
19 changed files with 141 additions and 28 deletions

View File

@@ -7,16 +7,18 @@ import (
// MsgMhfStampcardStamp represents the MSG_MHF_STAMPCARD_STAMP
type MsgMhfStampcardStamp struct {
// probably not actual format, just lined up neatly to an example packet
// Field-size accurate.
AckHandle uint32
Unk0 uint32
Unk1 uint32
Unk2 uint32
Unk3 uint32
Unk0 uint16
Unk1 uint16
Unk2 uint16
Unk3 uint16 // Hardcoded 0 in binary
Unk4 uint32
Unk5 uint32
Unk6 uint32
Unk7 uint32
Unk8 uint32
Unk9 uint32
}
// Opcode returns the ID associated with this packet type.
@@ -27,14 +29,16 @@ func (m *MsgMhfStampcardStamp) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfStampcardStamp) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32()
m.Unk1 = bf.ReadUint32()
m.Unk2 = bf.ReadUint32()
m.Unk3 = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
m.Unk2 = bf.ReadUint16()
m.Unk3 = bf.ReadUint16()
m.Unk4 = bf.ReadUint32()
m.Unk5 = bf.ReadUint32()
m.Unk6 = bf.ReadUint32()
m.Unk7 = bf.ReadUint32()
m.Unk8 = bf.ReadUint32()
m.Unk9 = bf.ReadUint32()
return nil
}