diff --git a/ttd.go b/ttd.go index 21769b3..30e41cb 100644 --- a/ttd.go +++ b/ttd.go @@ -608,10 +608,22 @@ func (s *ServerTTD) ComputeClientTime() { for _, cc := range cfg.Clients { if cc.Online { if cc.TimeLeft > 0 && cc.TimeLeft < diff { - bot.SendChat(cfg.Telegram.ChatID, fmt.Sprintf("@%s got not time left. Grace period of %s.", cc.Username, cfg.Game.Threshold)) + msg := fmt.Sprintf("@%s got not time left. Grace period of %s.", cc.Username, cfg.Game.Threshold) + bot.SendChat(cfg.Telegram.ChatID, msg) + px := PacketAdminRCon{ + Packet: Packet{PType: AdminPacketAdminRCon}, + Command: fmt.Sprintf("say %s", msg), + } + srv.Send(px.Bytes()) } if (cc.TimeLeft+cfg.Game.Threshold) > 0 && (cc.TimeLeft+cfg.Game.Threshold) < diff { - bot.SendChat(cfg.Telegram.ChatID, fmt.Sprintf("@%s got not time left. Grace period over.", cc.Username)) + msg := fmt.Sprintf("@%s got not time left. Grace period over.", cc.Username) + bot.SendChat(cfg.Telegram.ChatID, msg) + px := PacketAdminRCon{ + Packet: Packet{PType: AdminPacketAdminRCon}, + Command: fmt.Sprintf("say %s", msg), + } + srv.Send(px.Bytes()) } cc.TimeLeft = cc.TimeLeft - diff } diff --git a/version.go b/version.go index 74e9fa0..fe8c866 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,6 @@ // Code generated by version.sh (@generated) DO NOT EDIT. package main -var githash = "11ec55b" -var buildstamp = "2021-11-13_06:23:25" -var commits = "197" -var version = "11ec55b-b197 - 2021-11-13_06:23:25" +var githash = "ccd41c2" +var buildstamp = "2021-11-13_06:27:18" +var commits = "198" +var version = "ccd41c2-b198 - 2021-11-13_06:27:18"