test
This commit is contained in:
parent
123ef0bdf5
commit
4362855786
19
main.go
19
main.go
@ -9,8 +9,9 @@ import (
|
||||
|
||||
func main() {
|
||||
var (
|
||||
clients int = 0
|
||||
paused bool = true
|
||||
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},
|
||||
|
Loading…
Reference in New Issue
Block a user