This commit is contained in:
shoopea
2020-06-15 15:07:52 +02:00
parent f21b52aa01
commit 0e88fff5a3
2 changed files with 17 additions and 0 deletions

View File

@@ -161,6 +161,11 @@ type PacketServerRCon struct {
Output string
}
type PacketServerRConEnd struct {
Packet
Command string
}
func (p *PacketAdminJoin) Bytes() []byte {
buf := new(bytes.Buffer)
p.PLength = uint16(len(p.Password) + len(p.AppName) + len(p.AppVersion) + 6)
@@ -324,3 +329,9 @@ func (p *PacketServerRCon) Read(b []byte) {
p.ColorID = binary.LittleEndian.Uint16(bs[0:])
p.Output, _ = r.ReadString(0)
}
func (p *PacketServerRConEnd) Read(b []byte) {
r := bufio.NewReader(bytes.NewReader(b))
r.Discard(3)
p.Command, _ = r.ReadString(0)
}