gameServer/hedgewars-server.hs
changeset 4975 31da8979e5b1
parent 4974 078cd026a7b1
child 4982 3572eaf14340
--- a/gameServer/hedgewars-server.hs	Mon Feb 28 22:28:43 2011 +0300
+++ b/gameServer/hedgewars-server.hs	Thu Mar 03 22:15:13 2011 +0300
@@ -8,6 +8,8 @@
 import qualified Control.Exception as E
 import System.Log.Logger
 import System.Process
+import Data.TConfig
+import Data.Maybe
 #if defined(OFFICIAL_SERVER)
 import Control.Monad
 #endif
@@ -28,7 +30,7 @@
         (setLevel INFO)
 
 
-server :: ServerInfo -> IO ()
+server :: ServerInfo c -> IO ()
 server si = do
     proto <- getProtocolNumber "tcp"
     E.bracket
@@ -58,11 +60,10 @@
 
     dbQueriesChan <- newChan
     coreChan' <- newChan
-    serverInfo' <- getOpts $ newServerInfo coreChan' dbQueriesChan
+    serverInfo' <- getOpts $ newServerInfo coreChan' dbQueriesChan Nothing
 
 #if defined(OFFICIAL_SERVER)
-    [dbHost', dbLogin', dbPassword'] <- liftM read $ readFile "hedgewars-server.ini"
-    let si = serverInfo'{dbHost = dbHost', dbLogin = dbLogin', dbPassword = dbPassword'}
+    si <- readServerConfig serverInfo'
 #else
     let si = serverInfo'
 #endif