Add reminder to call /restart_server with "yes"
authorWuzzy <Wuzzy2@mail.ru>
Sat, 08 Dec 2018 14:22:24 +0100
changeset 14402 32e8c81ca35c
parent 14401 8ad85859dd3f
child 14403 f9d4b8222903
Add reminder to call /restart_server with "yes"
gameServer/HWProtoCore.hs
gameServer/HWProtoLobbyState.hs
--- a/gameServer/HWProtoCore.hs	Sat Dec 08 14:19:11 2018 +0100
+++ b/gameServer/HWProtoCore.hs	Sat Dec 08 14:22:24 2018 +0100
@@ -107,7 +107,7 @@
 
         -- lobby-only commands
         h "STATS" _ = handleCmd_lobbyOnly ["STATS"]
-        h "RESTART_SERVER" "YES" = handleCmd_lobbyOnly ["RESTART_SERVER"]
+        h "RESTART_SERVER" p = handleCmd_lobbyOnly ["RESTART_SERVER", upperCase p]
 
         -- room and lobby commands
         h "QUIT" _ = handleCmd ["QUIT"]
--- a/gameServer/HWProtoLobbyState.hs	Sat Dec 08 14:19:11 2018 +0100
+++ b/gameServer/HWProtoLobbyState.hs	Sat Dec 08 14:22:24 2018 +0100
@@ -220,12 +220,18 @@
 handleCmd_lobby ["CLEAR_ACCOUNTS_CACHE"] = serverAdminOnly $
     return [ClearAccountsCache]
 
+handleCmd_lobby ["RESTART_SERVER", "YES"] = serverAdminOnly $
+    return [RestartServer]
+
 handleCmd_lobby ["RESTART_SERVER"] = serverAdminOnly $
-    return [RestartServer]
+    return [Warning $ loc "Please confirm server restart with '/restart_server yes'."]
+
+handleCmd_lobby ["RESTART_SERVER", _] = handleCmd_lobby ["RESTART_SERVER"]
+
 
 handleCmd_lobby ["STATS"] = serverAdminOnly $
     return [Stats]
 
 handleCmd_lobby (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: in lobby)"]
 
-handleCmd_lobby [] = return [ProtocolError "Empty command (state: in lobby)"]
\ No newline at end of file
+handleCmd_lobby [] = return [ProtocolError "Empty command (state: in lobby)"]