gameServer/hedgewars-server.hs
changeset 3435 4e4f88a7bdf2
parent 3425 ead2ed20dfd4
child 3500 af8390d807d6
equal deleted inserted replaced
3434:6af73e7f2438 3435:4e4f88a7bdf2
    20 #if !defined(mingw32_HOST_OS)
    20 #if !defined(mingw32_HOST_OS)
    21 import System.Posix
    21 import System.Posix
    22 #endif
    22 #endif
    23 
    23 
    24 
    24 
       
    25 setupLoggers :: IO ()
    25 setupLoggers =
    26 setupLoggers =
    26     updateGlobalLogger "Clients"
    27     updateGlobalLogger "Clients"
    27         (setLevel DEBUG)
    28         (setLevel DEBUG)
    28 
    29 
       
    30 main :: IO ()
    29 main = withSocketsDo $ do
    31 main = withSocketsDo $ do
    30 #if !defined(mingw32_HOST_OS)
    32 #if !defined(mingw32_HOST_OS)
    31     installHandler sigPIPE Ignore Nothing;
    33     installHandler sigPIPE Ignore Nothing;
    32     installHandler sigCHLD Ignore Nothing;
    34     installHandler sigCHLD Ignore Nothing;
    33 #endif
    35 #endif
    36 
    38 
    37     stats' <- atomically $ newTMVar (StatisticsInfo 0 0)
    39     stats' <- atomically $ newTMVar (StatisticsInfo 0 0)
    38     dbQueriesChan <- newChan
    40     dbQueriesChan <- newChan
    39     coreChan' <- newChan
    41     coreChan' <- newChan
    40     serverInfo' <- getOpts $ newServerInfo stats' coreChan' dbQueriesChan
    42     serverInfo' <- getOpts $ newServerInfo stats' coreChan' dbQueriesChan
    41     
    43 
    42 #if defined(OFFICIAL_SERVER)
    44 #if defined(OFFICIAL_SERVER)
    43     dbHost' <- askFromConsole "DB host: "
    45     dbHost' <- askFromConsole "DB host: "
    44     dbLogin' <- askFromConsole "login: "
    46     dbLogin' <- askFromConsole "login: "
    45     dbPassword' <- askFromConsole "password: "
    47     dbPassword' <- askFromConsole "password: "
    46     let serverInfo = serverInfo'{dbHost = dbHost', dbLogin = dbLogin', dbPassword = dbPassword'}
    48     let serverInfo = serverInfo'{dbHost = dbHost', dbLogin = dbLogin', dbPassword = dbPassword'}