mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-17 01:15:42 +01:00
Initial chat prototype
This commit is contained in:
@@ -5,8 +5,41 @@ import (
|
||||
"github.com/Andoryuuta/byteframe"
|
||||
)
|
||||
|
||||
/*
|
||||
00 58 // Opcode
|
||||
|
||||
00 00 00 00
|
||||
00 00 00 4e
|
||||
|
||||
00 04 // Count
|
||||
00 00 // Skipped(padding?)
|
||||
|
||||
00 01 00 00 00 00 00 00
|
||||
00 02 00 00 5d fa 14 c0
|
||||
00 03 00 00 5d fa 14 c0
|
||||
00 06 00 00 5d e7 05 10
|
||||
|
||||
00 00 // Count of some buf up to 0x800 bytes following it.
|
||||
|
||||
00 10 // Trailer
|
||||
*/
|
||||
|
||||
// ClientRight represents a right that the client has.
|
||||
type ClientRight struct {
|
||||
ID uint16
|
||||
Unk0 uint16
|
||||
Timestamp uint32
|
||||
}
|
||||
|
||||
// MsgSysUpdateRight represents the MSG_SYS_UPDATE_RIGHT
|
||||
type MsgSysUpdateRight struct{}
|
||||
type MsgSysUpdateRight struct {
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
//RightCount uint16
|
||||
//Unk3 uint16 // Likely struct padding
|
||||
Rights []ClientRight
|
||||
UnkSize uint16 // Count of some buf up to 0x800 bytes following it.
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgSysUpdateRight) Opcode() network.PacketID {
|
||||
@@ -20,5 +53,15 @@ func (m *MsgSysUpdateRight) Parse(bf *byteframe.ByteFrame) error {
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgSysUpdateRight) Build(bf *byteframe.ByteFrame) error {
|
||||
panic("Not implemented")
|
||||
}
|
||||
bf.WriteUint32(m.Unk0)
|
||||
bf.WriteUint32(m.Unk1)
|
||||
bf.WriteUint16(uint16(len(m.Rights)))
|
||||
bf.WriteUint16(0) // m.Unk3, struct padding.
|
||||
for _, v := range m.Rights {
|
||||
bf.WriteUint16(v.ID)
|
||||
bf.WriteUint16(v.Unk0)
|
||||
bf.WriteUint32(v.Timestamp)
|
||||
}
|
||||
bf.WriteUint16(m.UnkSize)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user