diff --git a/main.go b/main.go index 6c50866..79f4b48 100644 --- a/main.go +++ b/main.go @@ -153,6 +153,12 @@ func main() { } sp.Read(b[:p.PLength]) logInfoDebug("AdminPacketServerConsole :\n- Origin: %s\n- Text: %s", sp.Origin, sp.Text) + case AdminPacketServerRConEnd: + sp := PacketServerRConEnd{ + Packet: p, + } + sp.Read(b[:p.PLength]) + logInfoDebug("AdminPacketServerRConEnd :\n- Command: %s", sp.Command) default: logInfoDebug("Packet fully read : len : %d / type : %d", p.PLength, p.PType) } diff --git a/packet.go b/packet.go index 0e0e998..cb9fdab 100644 --- a/packet.go +++ b/packet.go @@ -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) +}