update
This commit is contained in:
parent
231c1c5605
commit
5382f8dfa7
33
def.go
33
def.go
@ -1,16 +1,8 @@
|
||||
package main
|
||||
|
||||
type Packet struct {
|
||||
PLength uint16
|
||||
PType uint8
|
||||
}
|
||||
|
||||
type PacketAdminJoin struct {
|
||||
Packet
|
||||
Password string
|
||||
AppName string
|
||||
AppVersion string
|
||||
}
|
||||
import (
|
||||
"bytes"
|
||||
)
|
||||
|
||||
const (
|
||||
AdminPacketAdminJoin uint8 = 0
|
||||
@ -50,3 +42,22 @@ const (
|
||||
AdminPacketServerPong
|
||||
InvalidAdminPacket = 0xFF
|
||||
)
|
||||
|
||||
type Packet struct {
|
||||
PLength uint16
|
||||
PType uint8
|
||||
}
|
||||
|
||||
type PacketAdminJoin struct {
|
||||
Packet
|
||||
Password string
|
||||
AppName string
|
||||
AppVersion string
|
||||
}
|
||||
|
||||
func (p *PacketAdminJoin) Bytes() []byte {
|
||||
buf := new(bytes.Buffer)
|
||||
p.PLength = binary.Size(p)
|
||||
_ = binary.Write(buf, binary.LittleEndian, p)
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user