update pause/unpause msg
This commit is contained in:
parent
3194cb33db
commit
7db13a764c
2
bot.go
2
bot.go
@ -84,7 +84,6 @@ func botPause(m *tb.Message) {
|
|||||||
}
|
}
|
||||||
if !srv.Status.Paused {
|
if !srv.Status.Paused {
|
||||||
srv.Pause()
|
srv.Pause()
|
||||||
bot.SendChat(bot.Config.ChatID, "Game paused.")
|
|
||||||
} else {
|
} else {
|
||||||
bot.SendChat(bot.Config.ChatID, "Game already paused.")
|
bot.SendChat(bot.Config.ChatID, "Game already paused.")
|
||||||
}
|
}
|
||||||
@ -104,7 +103,6 @@ func botUnpause(m *tb.Message) {
|
|||||||
}
|
}
|
||||||
if !srv.NeedPause() {
|
if !srv.NeedPause() {
|
||||||
srv.Unpause()
|
srv.Unpause()
|
||||||
bot.SendChat(bot.Config.ChatID, "Game unpaused.")
|
|
||||||
} else {
|
} else {
|
||||||
bot.SendChat(bot.Config.ChatID, fmt.Sprintf("Cannot unpause : %s", srv.NeedPauseReason()))
|
bot.SendChat(bot.Config.ChatID, fmt.Sprintf("Cannot unpause : %s", srv.NeedPauseReason()))
|
||||||
}
|
}
|
||||||
|
2
ttd.go
2
ttd.go
@ -589,6 +589,7 @@ func (s *ServerTTD) Pause() {
|
|||||||
err := s.Send(px.Bytes())
|
err := s.Send(px.Bytes())
|
||||||
|
|
||||||
s.ComputeClientTime()
|
s.ComputeClientTime()
|
||||||
|
bot.SendChat(cfg.Telegram.ChatID, "Game is paused.")
|
||||||
|
|
||||||
s.Status.Paused = true
|
s.Status.Paused = true
|
||||||
logErrorDebug(err, "Server.Pause : Send()")
|
logErrorDebug(err, "Server.Pause : Send()")
|
||||||
@ -610,6 +611,7 @@ func (s *ServerTTD) Unpause() {
|
|||||||
err := s.Send(px.Bytes())
|
err := s.Send(px.Bytes())
|
||||||
|
|
||||||
s.ComputeClientTime()
|
s.ComputeClientTime()
|
||||||
|
bot.SendChat(cfg.Telegram.ChatID, "Game is unpaused.")
|
||||||
|
|
||||||
s.Status.Paused = false
|
s.Status.Paused = false
|
||||||
logErrorDebug(err, "Server.Unpause : Send()")
|
logErrorDebug(err, "Server.Unpause : Send()")
|
||||||
|
@ -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 = "f56d25e"
|
var githash = "3194cb3"
|
||||||
var buildstamp = "2021-11-07_12:29:05"
|
var buildstamp = "2021-11-08_06:19:35"
|
||||||
var commits = "167"
|
var commits = "168"
|
||||||
var version = "f56d25e-b167 - 2021-11-07_12:29:05"
|
var version = "3194cb3-b168 - 2021-11-08_06:19:35"
|
||||||
|
Loading…
Reference in New Issue
Block a user