--- a/gameServer/Actions.hs Sun May 15 18:10:01 2011 +0400
+++ b/gameServer/Actions.hs Sun May 15 18:16:13 2011 +0400
@@ -475,11 +475,12 @@
processAction RestartServer = do
sock <- gets (fromJust . serverSocket . serverInfo)
+ args <- gets (runArgs . serverInfo)
io $ do
noticeM "Core" "Closing listening socket"
sClose sock
noticeM "Core" "Spawning new server"
- _ <- createProcess (proc "./hedgewars-server" [])
+ _ <- createProcess (proc "./hedgewars-server" args)
return ()
processAction $ ModifyServerInfo (\s -> s{shutdownPending=True})
--- a/gameServer/CoreTypes.hs Sun May 15 18:10:01 2011 +0400
+++ b/gameServer/CoreTypes.hs Sun May 15 18:16:13 2011 +0400
@@ -129,6 +129,7 @@
dbPassword :: B.ByteString,
bans :: [BanInfo],
shutdownPending :: Bool,
+ runArgs :: [String],
coreChan :: Chan CoreMessage,
dbQueries :: Chan DBQuery,
serverSocket :: Maybe Socket,
@@ -152,6 +153,7 @@
""
[]
False
+ []
data AccountInfo =
HasAccount B.ByteString Bool
--- a/gameServer/Opts.hs Sun May 15 18:10:01 2011 +0400
+++ b/gameServer/Opts.hs Sun May 15 18:16:13 2011 +0400
@@ -34,6 +34,6 @@
getOpts opts = do
args <- getArgs
case getOpt Permute options args of
- (o, [], []) -> return $ foldr ($) opts o
+ (o, [], []) -> return $ foldr ($) opts{runArgs = args} o
(_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options))
where header = "Usage: hedgewars-server [OPTION...]"