Start new server on RestartException
authorunc0rr
Sun, 27 Feb 2011 20:15:09 +0300
changeset 4962 705c6186ad9d
parent 4961 9075d7effdf2
child 4964 b3fa88210570
Start new server on RestartException
gameServer/Actions.hs
gameServer/hedgewars-server.hs
--- a/gameServer/Actions.hs	Sun Feb 27 19:32:44 2011 +0300
+++ b/gameServer/Actions.hs	Sun Feb 27 20:15:09 2011 +0300
@@ -416,6 +416,6 @@
 
 processAction (RestartServer force) = do
     if force then do
-        throw ShutdownException
+        throw RestartException
         else
         processAction $ ModifyServerInfo (\s -> s{restartPending=True})
--- a/gameServer/hedgewars-server.hs	Sun Feb 27 19:32:44 2011 +0300
+++ b/gameServer/hedgewars-server.hs	Sun Feb 27 20:15:09 2011 +0300
@@ -7,6 +7,7 @@
 import Control.Concurrent.Chan
 import qualified Control.Exception as E
 import System.Log.Logger
+import System.Process
 -----------------------------------
 import Opts
 import CoreTypes
@@ -43,7 +44,7 @@
 handleRestart :: ShutdownException -> IO ()
 handleRestart ShutdownException = return ()
 handleRestart RestartException = do
-    
+    _ <- createProcess (proc "./hedgewars-server" [])
     return ()
 
 main :: IO ()