From 9e060d5a64d60234a0f68a35a4ebe779bf116180 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 21 Jun 2020 16:31:09 +0200 Subject: [PATCH] test --- main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index c9991d9..0951f39 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "encoding/binary" "net" "regexp" + "strconv" ) type Client struct { @@ -193,10 +194,10 @@ func main() { if ok { clt := Client{} r, _ := regexp.Compile("Client #(?P[0-9]+) name: '(?P.*)' company: (?P[0-9]+) IP: (?P
.*)") - 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}") + clt.ClientID, _ = strconv.ParseInt(r.ReplaceAllString(sp.Output, "${ClientID}"), 10, 32) + clt.Name = r.ReplaceAllString(sp.Output, "${ClientID}") + clt.CompanyID, _ = strconv.ParseInt(r.ReplaceAllString(sp.Output, "${CompanyID}"), 10, 8) + clt.Address = r.ReplaceAllString(sp.Output, "${Address}") clients[clt.ClientID] = clt } case AdminPacketServerRConEnd: