diff -r 0b1f44751509 -r 2da1fe033f23 netserver/Miscutils.hs --- a/netserver/Miscutils.hs Mon Nov 10 15:50:46 2008 +0000 +++ b/netserver/Miscutils.hs Mon Nov 10 15:57:59 2008 +0000 @@ -8,6 +8,7 @@ import Maybe (fromJust) import qualified Data.Map as Map import Data.Time +import Network data ClientInfo = ClientInfo @@ -58,18 +59,39 @@ isRestrictedTeams :: Bool, params :: Map.Map String [String] } -createRoom = (RoomInfo "" "" 0 [] "+rnd+" False 1 0 False False Map.empty) +createRoom = ( + RoomInfo + "" + "" + 0 + [] + "+rnd+" + False + 1 + 0 + False + False + Map.empty + ) data ServerInfo = ServerInfo { - message :: String + isDedicated :: Bool, + serverMessage :: String, + listenPort :: PortNumber } +newServerInfo = ( + ServerInfo + True + "
" + 46631 + ) type ClientsTransform = [ClientInfo] -> [ClientInfo] type RoomsTransform = [RoomInfo] -> [RoomInfo] type HandlesSelector = ClientInfo -> [ClientInfo] -> [RoomInfo] -> [Handle] -type Answer = (HandlesSelector, [String]) +type Answer = ServerInfo -> (HandlesSelector, [String]) type CmdHandler = ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> (ClientsTransform, RoomsTransform, [Answer])