netserver/Miscutils.hs
changeset 1321 d7dc4e86201e
parent 1317 13cf8c5a7428
child 1327 9d43a6e6b9ca
--- a/netserver/Miscutils.hs	Wed Oct 08 15:57:35 2008 +0000
+++ b/netserver/Miscutils.hs	Wed Oct 08 18:25:08 2008 +0000
@@ -29,6 +29,10 @@
 	TeamInfo
 	{
 		teamname :: String,
+		teamcolor :: String,
+		teamgrave :: String,
+		teamfort :: String,
+		difficulty :: Int,
 		hedgehogs :: [HedgehogInfo]
 	}
 
@@ -82,6 +86,7 @@
 noChangeClients a = a
 
 modifyClient :: ClientInfo -> ClientsTransform
+modifyClient _ [] = error "modifyClient: no such client"
 modifyClient client (cl:cls) =
 	if cl == client then
 		client : cls
@@ -97,10 +102,10 @@
 removeRoom :: String -> RoomsTransform
 removeRoom roomname rooms = filter (\rm -> roomname /= name rm) rooms
 
-changeRoomConfig :: String -> String -> [String] -> RoomsTransform
-changeRoomConfig _ _ _ [] = error "changeRoomConfig: no such room"
-changeRoomConfig roomName paramName paramStrs (room:rooms) =
-	if roomName == name room then
-		room{params = Map.insert paramName paramStrs (params room)} : rooms
+modifyRoom :: RoomInfo -> RoomsTransform
+modifyRoom _ [] = error "changeRoomConfig: no such room"
+modifyRoom room (rm:rms) =
+	if name room == name rm then
+		room : rms
 	else
-		room : changeRoomConfig roomName paramName paramStrs rooms
+		room : modifyRoom room rms