--- a/gameServer/Actions.hs Sun Feb 27 11:32:48 2011 -0500
+++ b/gameServer/Actions.hs Sun Feb 27 11:46:41 2011 -0500
@@ -14,6 +14,7 @@
import Control.DeepSeq
import Data.Unique
import Control.Arrow
+import Control.Exception
-----------------------------
import CoreTypes
import Utils
@@ -53,6 +54,7 @@
| StatsAction
| RestartServer Bool
+
type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
instance NFData Action where
@@ -412,5 +414,8 @@
where
st irnc = (length $ allRooms irnc, length $ allClients irnc)
-processAction (RestartServer _) =
- return ()
\ No newline at end of file
+processAction (RestartServer force) = do
+ if force then do
+ throw ShutdownException
+ else
+ processAction $ ModifyServerInfo (\s -> s{restartPending=True})