final start/reset touches

This commit is contained in:
shoopea
2021-12-04 13:39:15 +08:00
parent 84579af511
commit acf58c99ef
4 changed files with 17 additions and 19 deletions

10
ttd.go
View File

@@ -54,7 +54,6 @@ type ServerDataTTD struct {
LastClientCompute time.Time
Conn net.Conn
Stop chan struct{}
Started bool
}
var updateHeartBeat = 5 * time.Second
@@ -594,15 +593,6 @@ func (s *ServerTTD) ComputeClientTime() {
t := time.Now()
if !cfg.Game.Started {
s.Data.LastClientCompute = t
s.Data.Started = false
return
}
if !s.Data.Started {
for _, cc := range cfg.Clients {
cc.TimeLeft = cfg.Game.StartingAllotment
}
bot.SendChat(cfg.Telegram.ChatID, "Starting allotment credited.")
s.Data.Started = true
return
}