--- a/gameServer/Actions.hs Thu Feb 03 07:00:38 2011 +0100
+++ b/gameServer/Actions.hs Thu Feb 03 22:29:10 2011 +0300
@@ -53,6 +53,7 @@
| DeleteClient ClientIndex
| PingAll
| StatsAction
+ | RestartServer Bool
type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
@@ -417,7 +418,7 @@
processAction (ByeClient "Ping timeout")
-processAction (StatsAction) = do
+processAction StatsAction = do
rnc <- gets roomsClients
si <- gets serverInfo
(roomsNum, clientsNum) <- io $ withRoomsAndClients rnc stats
@@ -425,3 +426,5 @@
where
stats irnc = (length $ allRooms irnc, length $ allClients irnc)
+processAction (RestartServer useForce) = do
+ return ()
\ No newline at end of file
--- a/gameServer/HWProtoLobbyState.hs Thu Feb 03 07:00:38 2011 +0100
+++ b/gameServer/HWProtoLobbyState.hs Thu Feb 03 22:29:10 2011 +0300
@@ -171,5 +171,9 @@
cl <- thisClient
return [ClearAccountsCache | isAdministrator cl]
+handleCmd_lobby ["RESTART_SERVER", restartType] = do
+ cl <- thisClient
+ return [RestartServer f | let f = restartType == "FORCE", isAdministrator cl]
+
handleCmd_lobby _ = return [ProtocolError "Incorrect command (state: in lobby)"]