more debug

This commit is contained in:
shoopea 2021-11-07 20:10:41 +08:00
parent 40df5ba19b
commit 2215691125
2 changed files with 9 additions and 9 deletions

10
ttd.go
View File

@ -232,7 +232,7 @@ func (s *ServerTTD) Poll(stop chan struct{}) {
Packet: p, Packet: p,
} }
sp.Read(buffer[:p.PLength]) sp.Read(buffer[:p.PLength])
//logInfoDebug("Server.Poll() : AdminPacketServerClientInfo :\n- ClientID: %d\n- Address: %s\n- Name: %s\n- Lang: %d\n- Date: %d\n- CompanyID: %d", sp.ClientID, sp.Address, sp.Name, sp.Lang, sp.Date, sp.CompanyID) logInfoDebug("Server.Poll() : AdminPacketServerClientInfo :\n- ClientID: %d\n- Address: %s\n- Name: %s\n- Lang: %d\n- Date: %d\n- CompanyID: %d", sp.ClientID, sp.Address, sp.Name, sp.Lang, sp.Date, sp.CompanyID)
clt := &ClientTTD{ clt := &ClientTTD{
ClientID: sp.ClientID, ClientID: sp.ClientID,
CompanyID: 255, CompanyID: 255,
@ -316,7 +316,7 @@ func (s *ServerTTD) Poll(stop chan struct{}) {
Packet: p, Packet: p,
} }
sp.Read(buffer[:p.PLength]) sp.Read(buffer[:p.PLength])
//logInfoDebug("Server.Poll() : PacketServerCompanyNew :\n- CompanyID: %d", sp.CompanyID) logInfoDebug("Server.Poll() : PacketServerCompanyNew :\n- CompanyID: %d", sp.CompanyID)
c := &CompanyTTD{ c := &CompanyTTD{
CompanyID: sp.CompanyID, CompanyID: sp.CompanyID,
FirstSeen: time.Now(), FirstSeen: time.Now(),
@ -328,7 +328,7 @@ func (s *ServerTTD) Poll(stop chan struct{}) {
Packet: p, Packet: p,
} }
sp.Read(buffer[:p.PLength]) sp.Read(buffer[:p.PLength])
//logInfoDebug("Server.Poll() : PacketServerCompanyInfo :\n- CompanyID: %d\n- Name: %s\n- President: %s\n- Protected: %t\n- Inauguration: %d\n- AI: %t", sp.CompanyID, sp.Name, sp.President, sp.Protected, sp.Inauguration, sp.AI) logInfoDebug("Server.Poll() : PacketServerCompanyInfo :\n- CompanyID: %d\n- Name: %s\n- President: %s\n- Protected: %t\n- Inauguration: %d\n- AI: %t", sp.CompanyID, sp.Name, sp.President, sp.Protected, sp.Inauguration, sp.AI)
c := &CompanyTTD{ c := &CompanyTTD{
CompanyID: sp.CompanyID, CompanyID: sp.CompanyID,
FirstSeen: time.Now(), FirstSeen: time.Now(),
@ -347,7 +347,7 @@ func (s *ServerTTD) Poll(stop chan struct{}) {
Packet: p, Packet: p,
} }
sp.Read(buffer[:p.PLength]) sp.Read(buffer[:p.PLength])
//logInfoDebug("Server.Poll() : PacketServerCompanyUpdate :\n- CompanyID: %d\n- Name: %s\n- President: %s\n- Protected: %t", sp.CompanyID, sp.Name, sp.President, sp.Protected) logInfoDebug("Server.Poll() : PacketServerCompanyUpdate :\n- CompanyID: %d\n- Name: %s\n- President: %s\n- Protected: %t", sp.CompanyID, sp.Name, sp.President, sp.Protected)
c := s.Status.Companies[sp.CompanyID] c := s.Status.Companies[sp.CompanyID]
c.Name = sp.Name c.Name = sp.Name
c.FirstSeen = time.Now() c.FirstSeen = time.Now()
@ -358,7 +358,7 @@ func (s *ServerTTD) Poll(stop chan struct{}) {
Packet: p, Packet: p,
} }
sp.Read(buffer[:p.PLength]) sp.Read(buffer[:p.PLength])
//logInfoDebug("Server.Poll() : PacketServerCompanyRemove :\n- CompanyID: %d\n- Reason: %d", sp.CompanyID, sp.Reason) logInfoDebug("Server.Poll() : PacketServerCompanyRemove :\n- CompanyID: %d\n- Reason: %d", sp.CompanyID, sp.Reason)
bot.SendChat(cfg.Telegram.ChatID, fmt.Sprintf("Company #%d deleted (%s)", sp.CompanyID, s.Status.Companies[sp.CompanyID].Name)) bot.SendChat(cfg.Telegram.ChatID, fmt.Sprintf("Company #%d deleted (%s)", sp.CompanyID, s.Status.Companies[sp.CompanyID].Name))
delete(s.Status.Companies, sp.CompanyID) delete(s.Status.Companies, sp.CompanyID)
case AdminPacketServerChat: case AdminPacketServerChat:

View File

@ -1,6 +1,6 @@
// Code generated by version.sh (@generated) DO NOT EDIT. // Code generated by version.sh (@generated) DO NOT EDIT.
package main package main
var githash = "63b7d31" var githash = "40df5ba"
var buildstamp = "2021-11-06_16:52:50" var buildstamp = "2021-11-07_12:10:24"
var commits = "164" var commits = "165"
var version = "63b7d31-b164 - 2021-11-06_16:52:50" var version = "40df5ba-b165 - 2021-11-07_12:10:24"