# HG changeset patch # User unc0rr # Date 1296761350 -10800 # Node ID 5c33bb53c1e5eb62b6a65ef24a8fe74b60dae49f # Parent f0d48df35f8655d51d7f4aab669dc048f8924d91 Stub for server restart command diff -r f0d48df35f86 -r 5c33bb53c1e5 gameServer/Actions.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 diff -r f0d48df35f86 -r 5c33bb53c1e5 gameServer/HWProtoLobbyState.hs --- 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)"]