test
This commit is contained in:
parent
60490616cb
commit
c303368519
11
main.go
11
main.go
@ -188,6 +188,17 @@ func main() {
|
|||||||
}
|
}
|
||||||
sp.Read(b[:p.PLength])
|
sp.Read(b[:p.PLength])
|
||||||
logInfoDebug("AdminPacketServerRCon :\n- ColorID: %d\n- Output: %s", sp.ColorID, sp.Output)
|
logInfoDebug("AdminPacketServerRCon :\n- ColorID: %d\n- Output: %s", sp.ColorID, sp.Output)
|
||||||
|
|
||||||
|
ok, err := regexp.MatchString("Client #[0-9]+ name: '.*' company: [0-9]+ IP: .*", sp.Output)
|
||||||
|
if ok {
|
||||||
|
clt := Client{}
|
||||||
|
r, _ := regexp.Compile("Client #(?P<ClientID>[0-9]+) name: '(?P<Name>.*)' company: (?P<CompanyID>[0-9]+) IP: (?P<Address>.*)")
|
||||||
|
clt.ClientID, _ = strconv.ParseInt(r.ReplaceAllString(m.Text, "${ClientID}"), 10, 32)
|
||||||
|
clt.Name = r.ReplaceAllString(m.Text, "${ClientID}")
|
||||||
|
clt.CompanyID, _ = strconv.ParseInt(r.ReplaceAllString(m.Text, "${CompanyID}"), 10, 8)
|
||||||
|
clt.Address = r.ReplaceAllString(m.Text, "${Address}")
|
||||||
|
clients[clt.ClientID] = clt
|
||||||
|
}
|
||||||
case AdminPacketServerRConEnd:
|
case AdminPacketServerRConEnd:
|
||||||
sp := PacketServerRConEnd{
|
sp := PacketServerRConEnd{
|
||||||
Packet: p,
|
Packet: p,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user