remove bad fix
This commit is contained in:
parent
3ddb733a15
commit
d3126446f7
24
ttd.go
24
ttd.go
@ -140,7 +140,6 @@ func (s *ServerTTD) HeartBeat(stop chan struct{}) {
|
||||
s.UpdateCompanies()
|
||||
s.PruneClients()
|
||||
s.PruneCompanies()
|
||||
s.UpdateConfigClients()
|
||||
s.ComputeClientTime()
|
||||
if !s.Status.Paused && s.NeedPause() {
|
||||
s.Pause()
|
||||
@ -574,7 +573,6 @@ func (s *ServerTTD) PruneClients() {
|
||||
cc := cfg.GetCompanyClient(clt.CompanyID)
|
||||
if cc.Online {
|
||||
cc.Online = false
|
||||
bot.SendChat(cfg.Telegram.ChatID, fmt.Sprintf("@%s timed out.", cc.Username))
|
||||
}
|
||||
}
|
||||
delete(s.Status.Clients, cltID)
|
||||
@ -591,28 +589,6 @@ func (s *ServerTTD) PruneCompanies() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ServerTTD) UpdateConfigClients() {
|
||||
for _, cc := range cfg.Clients {
|
||||
if cc.Online {
|
||||
if cc.CompanyID != 255 {
|
||||
for coID, co := range s.Status.Companies {
|
||||
if coID == cc.CompanyID {
|
||||
hasClient := false
|
||||
for clID, _ := range s.Status.Clients {
|
||||
if clID == co.ClientID {
|
||||
hasClient = true
|
||||
}
|
||||
}
|
||||
if !hasClient {
|
||||
cc.Online = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ServerTTD) ComputeClientTime() {
|
||||
t := time.Now()
|
||||
daysNow := int(t.Sub(cfg.Game.StartDate).Hours() / 24)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||
package main
|
||||
var githash = "62974dc"
|
||||
var buildstamp = "2021-11-22_09:07:53"
|
||||
var commits = "203"
|
||||
var version = "62974dc-b203 - 2021-11-22_09:07:53"
|
||||
var githash = "3ddb733"
|
||||
var buildstamp = "2021-11-22_10:20:29"
|
||||
var commits = "204"
|
||||
var version = "3ddb733-b204 - 2021-11-22_10:20:29"
|
||||
|
Loading…
Reference in New Issue
Block a user