update pause/unpause
This commit is contained in:
parent
7db13a764c
commit
9a1ba7e7f2
20
bot.go
20
bot.go
@ -78,16 +78,18 @@ func botPause(m *tb.Message) {
|
||||
if co, ok := srv.Status.Companies[cc.CompanyID]; ok {
|
||||
if clt, ok2 := srv.Status.Clients[co.ClientID]; ok2 {
|
||||
clt.Paused = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if !srv.Status.Paused {
|
||||
srv.Pause()
|
||||
} else {
|
||||
bot.SendChat(bot.Config.ChatID, "Game already paused.")
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bot.SendChat(bot.Config.ChatID, "You are not playing and cannot pause the game.")
|
||||
return
|
||||
}
|
||||
|
||||
func botUnpause(m *tb.Message) {
|
||||
@ -97,16 +99,18 @@ func botUnpause(m *tb.Message) {
|
||||
if co, ok := srv.Status.Companies[cc.CompanyID]; ok {
|
||||
if clt, ok2 := srv.Status.Clients[co.ClientID]; ok2 {
|
||||
clt.Paused = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if !srv.NeedPause() {
|
||||
srv.Unpause()
|
||||
} else {
|
||||
bot.SendChat(bot.Config.ChatID, fmt.Sprintf("Cannot unpause : %s", srv.NeedPauseReason()))
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bot.SendChat(bot.Config.ChatID, "You are not playing and cannot unpause the game.")
|
||||
return
|
||||
}
|
||||
|
||||
func botDelete(m *tb.Message) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||
package main
|
||||
var githash = "3194cb3"
|
||||
var buildstamp = "2021-11-08_06:19:35"
|
||||
var commits = "168"
|
||||
var version = "3194cb3-b168 - 2021-11-08_06:19:35"
|
||||
var githash = "7db13a7"
|
||||
var buildstamp = "2021-11-08_06:27:36"
|
||||
var commits = "169"
|
||||
var version = "7db13a7-b169 - 2021-11-08_06:27:36"
|
||||
|
Loading…
Reference in New Issue
Block a user