- Fix a bug screwing rooms list
authorunc0rr
Wed, 22 Oct 2008 21:41:00 +0000
changeset 1402 c164f215f7d2
parent 1401 2087672a2114
child 1403 b8c921ed0f13
- Fix a bug screwing rooms list - Also show teams number in rooms list
netserver/HWProto.hs
netserver/Miscutils.hs
--- a/netserver/HWProto.hs	Wed Oct 22 21:34:03 2008 +0000
+++ b/netserver/HWProto.hs	Wed Oct 22 21:41:00 2008 +0000
@@ -109,7 +109,11 @@
 handleCmd_noRoom client _ rooms ["LIST"] =
 		(noChangeClients, noChangeRooms, answerServerMessage ++ (answerRoomsList $ concatMap roomInfo $ sameProtoRooms))
 		where
-			roomInfo room = [name room, show $ playersIn room, show $ gameinprogress room]
+			roomInfo room = [
+					name room,
+					(show $ playersIn room) ++ "(" ++ (show $ length $ teams room) ++ ")",
+					show $ gameinprogress room
+					]
 			sameProtoRooms = filter (\r -> roomProto r == protocol client) rooms
 
 handleCmd_noRoom client _ rooms ["CREATE", newRoom, roomPassword] =
--- a/netserver/Miscutils.hs	Wed Oct 22 21:34:03 2008 +0000
+++ b/netserver/Miscutils.hs	Wed Oct 22 21:41:00 2008 +0000
@@ -115,7 +115,7 @@
 	if name room == name rm then
 		room : rms
 	else
-		room : modifyRoom room rms
+		rm : modifyRoom room rms
 
 modifyTeam :: RoomInfo -> TeamInfo -> RoomInfo
 modifyTeam room team = room{teams = replaceTeam team $ teams room}