gameServer/CoreTypes.hs
changeset 4989 4771fed9272e
parent 4988 bd540ba66599
child 4996 76ef3d8bd78e
equal deleted inserted replaced
4988:bd540ba66599 4989:4771fed9272e
    10 import Data.Function
    10 import Data.Function
    11 import Data.ByteString.Char8 as B
    11 import Data.ByteString.Char8 as B
    12 import Data.Unique
    12 import Data.Unique
    13 import Control.Exception
    13 import Control.Exception
    14 import Data.Typeable
    14 import Data.Typeable
       
    15 import Data.TConfig
    15 -----------------------
    16 -----------------------
    16 import RoomsAndClients
    17 import RoomsAndClients
    17 
    18 
    18 type ClientChan = Chan [B.ByteString]
    19 type ClientChan = Chan [B.ByteString]
    19 
    20 
   121     {
   122     {
   122         playersNumber :: Int,
   123         playersNumber :: Int,
   123         roomsNumber :: Int
   124         roomsNumber :: Int
   124     }
   125     }
   125 
   126 
   126 data ServerInfo c =
   127 data ServerInfo =
   127     ServerInfo
   128     ServerInfo
   128     {
   129     {
   129         isDedicated :: Bool,
   130         isDedicated :: Bool,
   130         serverMessage :: B.ByteString,
   131         serverMessage :: B.ByteString,
   131         serverMessageForOldVersions :: B.ByteString,
   132         serverMessageForOldVersions :: B.ByteString,
   139         dbPassword :: B.ByteString,
   140         dbPassword :: B.ByteString,
   140         lastLogins :: [(B.ByteString, (UTCTime, B.ByteString))],
   141         lastLogins :: [(B.ByteString, (UTCTime, B.ByteString))],
   141         restartPending :: Bool,
   142         restartPending :: Bool,
   142         coreChan :: Chan CoreMessage,
   143         coreChan :: Chan CoreMessage,
   143         dbQueries :: Chan DBQuery,
   144         dbQueries :: Chan DBQuery,
   144         serverConfig :: Maybe c
   145         serverConfig :: Maybe Conf
   145     }
   146     }
   146 
   147 
   147 instance Show (ServerInfo c) where
   148 instance Show ServerInfo where
   148     show _ = "Server Info"
   149     show _ = "Server Info"
   149 
   150 
   150 newServerInfo :: Chan CoreMessage -> Chan DBQuery -> Maybe c -> ServerInfo c
   151 newServerInfo :: Chan CoreMessage -> Chan DBQuery -> Maybe Conf -> ServerInfo
   151 newServerInfo =
   152 newServerInfo =
   152     ServerInfo
   153     ServerInfo
   153         True
   154         True
   154         "<h2><p align=center><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p></h2>"
   155         "<h2><p align=center><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p></h2>"
   155         "<font color=yellow><h3 align=center>Hedgewars 0.9.16 is out! Please update.</h3><p align=center><a href=http://hedgewars.org/download.html>Download page here</a></font>"
   156         "<font color=yellow><h3 align=center>Hedgewars 0.9.16 is out! Please update.</h3><p align=center><a href=http://hedgewars.org/download.html>Download page here</a></font>"