Read server config from file
authorunc0rr
Sun, 27 Feb 2011 21:06:28 +0300
changeset 4968 8e1673f0dc05
parent 4967 5d6443a7ec03
child 4969 ffc9ac920985
Read server config from file
gameServer/hedgewars-server.hs
--- a/gameServer/hedgewars-server.hs	Sun Feb 27 20:58:59 2011 +0300
+++ b/gameServer/hedgewars-server.hs	Sun Feb 27 21:06:28 2011 +0300
@@ -8,14 +8,11 @@
 import qualified Control.Exception as E
 import System.Log.Logger
 import System.Process
+import Control.Monad
 -----------------------------------
 import Opts
 import CoreTypes
 import ServerCore
-#if defined(OFFICIAL_SERVER)
-import Utils
-#endif
-
 
 #if !defined(mingw32_HOST_OS)
 import System.Posix
@@ -61,9 +58,7 @@
     serverInfo' <- getOpts $ newServerInfo coreChan' dbQueriesChan
 
 #if defined(OFFICIAL_SERVER)
-    dbHost' <- askFromConsole "DB host: "
-    dbLogin' <- askFromConsole "login: "
-    dbPassword' <- askFromConsole "password: "
+    [dbHost', dbLogin', dbPassword'] <- liftM read $ readFile "hedgewars-server.ini"
     let si = serverInfo'{dbHost = dbHost', dbLogin = dbLogin', dbPassword = dbPassword'}
 #else
     let si = serverInfo'