Initial chat prototype

This commit is contained in:
Andrew Gutekanst
2020-01-19 12:52:57 -05:00
parent e6d7b7b9c2
commit fa608fa555
73 changed files with 1646 additions and 714 deletions

View File

@@ -6,7 +6,12 @@ import (
)
// MsgSysCastedBinary represents the MSG_SYS_CASTED_BINARY
type MsgSysCastedBinary struct{}
type MsgSysCastedBinary struct {
CharID uint32
Type0 uint8
Type1 uint8
RawDataPayload []byte
}
// Opcode returns the ID associated with this packet type.
func (m *MsgSysCastedBinary) Opcode() network.PacketID {
@@ -20,5 +25,10 @@ func (m *MsgSysCastedBinary) Parse(bf *byteframe.ByteFrame) error {
// Build builds a binary packet from the current data.
func (m *MsgSysCastedBinary) Build(bf *byteframe.ByteFrame) error {
panic("Not implemented")
}
bf.WriteUint32(m.CharID)
bf.WriteUint8(m.Type0)
bf.WriteUint8(m.Type0)
bf.WriteUint16(uint16(len(m.RawDataPayload)))
bf.WriteBytes(m.RawDataPayload)
return nil
}