mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-18 18:04:52 +01:00
Fix MsgSysCastedBinary
Fixes a two-month-old typo in the Build method. Implements the parse method.
This commit is contained in:
@@ -20,14 +20,19 @@ func (m *MsgSysCastedBinary) Opcode() network.PacketID {
|
|||||||
|
|
||||||
// Parse parses the packet from binary
|
// Parse parses the packet from binary
|
||||||
func (m *MsgSysCastedBinary) Parse(bf *byteframe.ByteFrame) error {
|
func (m *MsgSysCastedBinary) Parse(bf *byteframe.ByteFrame) error {
|
||||||
panic("Not implemented")
|
m.CharID = bf.ReadUint32()
|
||||||
|
m.Type0 = bf.ReadUint8()
|
||||||
|
m.Type1 = bf.ReadUint8()
|
||||||
|
dataSize := bf.ReadUint16()
|
||||||
|
m.RawDataPayload = bf.ReadBytes(uint(dataSize))
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build builds a binary packet from the current data.
|
// Build builds a binary packet from the current data.
|
||||||
func (m *MsgSysCastedBinary) Build(bf *byteframe.ByteFrame) error {
|
func (m *MsgSysCastedBinary) Build(bf *byteframe.ByteFrame) error {
|
||||||
bf.WriteUint32(m.CharID)
|
bf.WriteUint32(m.CharID)
|
||||||
bf.WriteUint8(m.Type0)
|
bf.WriteUint8(m.Type0)
|
||||||
bf.WriteUint8(m.Type0)
|
bf.WriteUint8(m.Type1)
|
||||||
bf.WriteUint16(uint16(len(m.RawDataPayload)))
|
bf.WriteUint16(uint16(len(m.RawDataPayload)))
|
||||||
bf.WriteBytes(m.RawDataPayload)
|
bf.WriteBytes(m.RawDataPayload)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user