remove some debug/spam

This commit is contained in:
shoopea 2021-12-11 10:44:10 +08:00
parent 0bfa4461ba
commit eec4d75635
2 changed files with 10 additions and 10 deletions

12
ttd.go
View File

@ -526,6 +526,7 @@ func (s *ServerTTD) Poll(stop chan struct{}) {
}
sp.Read(buffer[:p.PLength])
r := regexp.MustCompile("#:(?P<CompanyID>[0-9]+)\\((?P<Color>[a-zA-Z]+)\\) Company Name: '(?P<CompanyName>.+)'.*Money: (?P<Money>[0-9]+).*Loan: (?P<Loan>[0-9]*).*Value: (?P<Value>[0-9]+).* \\(T:(?P<Train>[0-9]+), R:(?P<Road>[0-9]+), P:(?P<Plane>[0-9]+), S:(?P<Ship>[0-9]+)\\).*$")
r2 := regexp.MustCompile("Client #(?P<ClientID>[0-9]+).*name: '(?P<ClientName>.+)'.*company: (?P<CompanyID>[0-9]+)( )+IP: .*$")
if r.MatchString(sp.Output) {
coID := uint8(0)
for _, co := range srv.Status.Companies {
@ -564,17 +565,16 @@ func (s *ServerTTD) Poll(stop chan struct{}) {
stats.Plane, _ = strconv.Atoi(r.ReplaceAllString(sp.Output, "${Plane}"))
stats.Ship, _ = strconv.Atoi(r.ReplaceAllString(sp.Output, "${Ship}"))
}
}
r = regexp.MustCompile("Client #(?P<ClientID>[0-9]+).*name: '(?P<ClientName>.+)'.*company: (?P<CompanyID>[0-9]+)( )+IP: .*$")
if r.MatchString(sp.Output) {
} else if r2.MatchString(sp.Output) {
for _, c := range srv.Status.Clients {
if c.Name == r.ReplaceAllString(sp.Output, "${ClientName}") {
c.ClientExtlID, _ = strconv.ParseInt(r.ReplaceAllString(sp.Output, "${ClientID}"), 10, 64)
if c.Name == r2.ReplaceAllString(sp.Output, "${ClientName}") {
c.ClientExtlID, _ = strconv.ParseInt(r2.ReplaceAllString(sp.Output, "${ClientID}"), 10, 64)
break
}
}
}
} else {
logInfoDebug("Server.Poll() : AdminPacketServerRCon :\n- ColorID: %d\n- Output: %s", sp.ColorID, sp.Output)
}
case AdminPacketServerRConEnd:
sp := PacketServerRConEnd{

View File

@ -1,6 +1,6 @@
// Code generated by version.sh (@generated) DO NOT EDIT.
package main
var githash = "1520326"
var buildstamp = "2021-12-11_02:35:54"
var commits = "253"
var version = "1520326-b253 - 2021-12-11_02:35:54"
var githash = "0bfa446"
var buildstamp = "2021-12-11_02:44:00"
var commits = "254"
var version = "0bfa446-b254 - 2021-12-11_02:44:00"