Implement MsgSysEnumerateStage w/ stage map

This commit is contained in:
Andrew Gutekanst
2020-01-22 17:53:27 -05:00
parent b898614ddc
commit fa245e53fb
4 changed files with 62 additions and 10 deletions

View File

@@ -6,7 +6,12 @@ import (
)
// MsgSysEnumerateStage represents the MSG_SYS_ENUMERATE_STAGE
type MsgSysEnumerateStage struct{}
type MsgSysEnumerateStage struct {
AckHandle uint32
Unk0 uint8 // Hardcoded 1 in the binary
StageIDLength uint8
StageID string
}
// Opcode returns the ID associated with this packet type.
func (m *MsgSysEnumerateStage) Opcode() network.PacketID {
@@ -15,10 +20,14 @@ func (m *MsgSysEnumerateStage) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgSysEnumerateStage) Parse(bf *byteframe.ByteFrame) error {
panic("Not implemented")
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.StageIDLength = bf.ReadUint8()
m.StageID = string(bf.ReadBytes(uint(m.StageIDLength)))
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgSysEnumerateStage) Build(bf *byteframe.ByteFrame) error {
panic("Not implemented")
}
}