Stub for server restart command
authorunc0rr
Thu, 03 Feb 2011 22:29:10 +0300
changeset 4914 5c33bb53c1e5
parent 4913 f0d48df35f86
child 4915 922cc12d50dc
Stub for server restart command
gameServer/Actions.hs
gameServer/HWProtoLobbyState.hs
--- 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)"]