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 |
136 dbLogin :: B.ByteString, |
137 dbLogin :: B.ByteString, |
137 dbPassword :: B.ByteString, |
138 dbPassword :: B.ByteString, |
138 lastLogins :: [(B.ByteString, (UTCTime, B.ByteString))], |
139 lastLogins :: [(B.ByteString, (UTCTime, B.ByteString))], |
139 restartPending :: Bool, |
140 restartPending :: Bool, |
140 coreChan :: Chan CoreMessage, |
141 coreChan :: Chan CoreMessage, |
141 dbQueries :: Chan DBQuery |
142 dbQueries :: Chan DBQuery, |
142 } |
143 serverConfig :: Maybe c |
143 |
144 } |
144 instance Show ServerInfo where |
145 |
|
146 instance Show (ServerInfo c) where |
145 show _ = "Server Info" |
147 show _ = "Server Info" |
146 |
148 |
147 newServerInfo :: Chan CoreMessage -> Chan DBQuery -> ServerInfo |
149 newServerInfo :: Chan CoreMessage -> Chan DBQuery -> Maybe c -> ServerInfo c |
148 newServerInfo = |
150 newServerInfo = |
149 ServerInfo |
151 ServerInfo |
150 True |
152 True |
151 "<h2><p align=center><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p></h2>" |
153 "<h2><p align=center><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p></h2>" |
152 "<font color=yellow><h3 align=center>Hedgewars 0.9.14.1 is out! Please update.</h3><p align=center><a href=http://hedgewars.org/download.html>Download page here</a></font>" |
154 "<font color=yellow><h3 align=center>Hedgewars 0.9.14.1 is out! Please update.</h3><p align=center><a href=http://hedgewars.org/download.html>Download page here</a></font>" |