Implement MsgSysSetStageBinary parser

This commit is contained in:
Andrew Gutekanst
2020-01-23 16:49:00 -05:00
parent cb275a7a18
commit 10c80322af

View File

@@ -6,7 +6,14 @@ import (
)
// MsgSysSetStageBinary represents the MSG_SYS_SET_STAGE_BINARY
type MsgSysSetStageBinary struct{}
type MsgSysSetStageBinary struct {
Unk0 uint8
BinaryType uint8 // Index
StageIDLength uint8 // <= 0x20
DataSize uint16 // <= 0x400
StageID string
RawDataPayload []byte
}
// Opcode returns the ID associated with this packet type.
func (m *MsgSysSetStageBinary) Opcode() network.PacketID {
@@ -15,10 +22,16 @@ func (m *MsgSysSetStageBinary) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgSysSetStageBinary) Parse(bf *byteframe.ByteFrame) error {
panic("Not implemented")
m.Unk0 = bf.ReadUint8()
m.BinaryType = bf.ReadUint8()
m.StageIDLength = bf.ReadUint8()
m.DataSize = bf.ReadUint16()
m.StageID = string(bf.ReadBytes(uint(m.StageIDLength)))
m.RawDataPayload = bf.ReadBytes(uint(m.DataSize))
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgSysSetStageBinary) Build(bf *byteframe.ByteFrame) error {
panic("Not implemented")
}
}