gameServer/hedgewars-server.hs
changeset 4968 8e1673f0dc05
parent 4962 705c6186ad9d
child 4973 53411a26df7e
equal deleted inserted replaced
4967:5d6443a7ec03 4968:8e1673f0dc05
     6 import Network.BSD
     6 import Network.BSD
     7 import Control.Concurrent.Chan
     7 import Control.Concurrent.Chan
     8 import qualified Control.Exception as E
     8 import qualified Control.Exception as E
     9 import System.Log.Logger
     9 import System.Log.Logger
    10 import System.Process
    10 import System.Process
       
    11 import Control.Monad
    11 -----------------------------------
    12 -----------------------------------
    12 import Opts
    13 import Opts
    13 import CoreTypes
    14 import CoreTypes
    14 import ServerCore
    15 import ServerCore
    15 #if defined(OFFICIAL_SERVER)
       
    16 import Utils
       
    17 #endif
       
    18 
       
    19 
    16 
    20 #if !defined(mingw32_HOST_OS)
    17 #if !defined(mingw32_HOST_OS)
    21 import System.Posix
    18 import System.Posix
    22 #endif
    19 #endif
    23 
    20 
    59     dbQueriesChan <- newChan
    56     dbQueriesChan <- newChan
    60     coreChan' <- newChan
    57     coreChan' <- newChan
    61     serverInfo' <- getOpts $ newServerInfo coreChan' dbQueriesChan
    58     serverInfo' <- getOpts $ newServerInfo coreChan' dbQueriesChan
    62 
    59 
    63 #if defined(OFFICIAL_SERVER)
    60 #if defined(OFFICIAL_SERVER)
    64     dbHost' <- askFromConsole "DB host: "
    61     [dbHost', dbLogin', dbPassword'] <- liftM read $ readFile "hedgewars-server.ini"
    65     dbLogin' <- askFromConsole "login: "
       
    66     dbPassword' <- askFromConsole "password: "
       
    67     let si = serverInfo'{dbHost = dbHost', dbLogin = dbLogin', dbPassword = dbPassword'}
    62     let si = serverInfo'{dbHost = dbHost', dbLogin = dbLogin', dbPassword = dbPassword'}
    68 #else
    63 #else
    69     let si = serverInfo'
    64     let si = serverInfo'
    70 #endif
    65 #endif
    71 
    66