gameServer/hedgewars-server.hs
changeset 4957 3684faf5b3d1
parent 4932 f11d80bac7ed
child 4960 3b54b1c9b768
equal deleted inserted replaced
4955:84543ecae8c3 4957:3684faf5b3d1
     2 
     2 
     3 module Main where
     3 module Main where
     4 
     4 
     5 import Network.Socket
     5 import Network.Socket
     6 import Network.BSD
     6 import Network.BSD
     7 import Control.Concurrent.STM
       
     8 import Control.Concurrent.Chan
     7 import Control.Concurrent.Chan
     9 import qualified Control.Exception as Exception
     8 import qualified Control.Exception as Exception
    10 import System.Log.Logger
     9 import System.Log.Logger
    11 -----------------------------------
    10 -----------------------------------
    12 import Opts
    11 import Opts
    34     _ <- installHandler sigCHLD Ignore Nothing
    33     _ <- installHandler sigCHLD Ignore Nothing
    35 #endif
    34 #endif
    36 
    35 
    37     setupLoggers
    36     setupLoggers
    38 
    37 
    39     stats' <- atomically $ newTMVar (StatisticsInfo 0 0)
       
    40     dbQueriesChan <- newChan
    38     dbQueriesChan <- newChan
    41     coreChan' <- newChan
    39     coreChan' <- newChan
    42     serverInfo' <- getOpts $ newServerInfo stats' coreChan' dbQueriesChan
    40     serverInfo' <- getOpts $ newServerInfo coreChan' dbQueriesChan
    43 
    41 
    44 #if defined(OFFICIAL_SERVER)
    42 #if defined(OFFICIAL_SERVER)
    45     dbHost' <- askFromConsole "DB host: "
    43     dbHost' <- askFromConsole "DB host: "
    46     dbLogin' <- askFromConsole "login: "
    44     dbLogin' <- askFromConsole "login: "
    47     dbPassword' <- askFromConsole "password: "
    45     dbPassword' <- askFromConsole "password: "