netserver/Miscutils.hs
changeset 1492 2da1fe033f23
parent 1491 0b1f44751509
child 1493 1e422bc5d863
--- 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
+		"<h2><p align=center><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p></h2>"
+		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])