This commit is contained in:
shoopea 2020-06-21 15:20:36 +02:00
parent 123ef0bdf5
commit 4362855786

15
main.go
View File

@ -11,6 +11,7 @@ func main() {
var (
clients int = 0
paused bool = true
forcePaused bool = true
)
conn, err := net.Dial("tcp", "poop.siteop.biz:3977")
@ -155,8 +156,8 @@ func main() {
sp.Read(b[:p.PLength])
ok, err := regexp.MatchString("\\[udp\\] queried from (.*)", sp.Text)
logErrorDebug(err, "match string")
if sp.Origin != "net\x00" || ok == false {
logInfoDebug("AdminPacketServerConsole :\n- Origin: %q\n- Text: %s\n- Regexp: %v\n- Text: %v", sp.Origin, sp.Text, ok, (sp.Origin != "net"))
if sp.Origin != "net" || ok == false {
logInfoDebug("AdminPacketServerConsole :\n- Origin: %q\n- Text: %s\n- Regexp: %v\n- Text: %v", sp.Origin, sp.Text)
}
case AdminPacketServerRConEnd:
sp := PacketServerRConEnd{
@ -173,7 +174,15 @@ func main() {
b = c
read -= int(p.PLength)
if paused && clients > 0 {
if !paused && forcePaused {
paused = false
px := PacketAdminRCon{
Packet: Packet{PType: AdminPacketAdminRCon},
Command: "pause",
}
_, err = conn.Write(px.Bytes())
}
if paused && !forcePaused && clients > 0 {
paused = false
px := PacketAdminRCon{
Packet: Packet{PType: AdminPacketAdminRCon},