107 -- 'noRoom' clients state command handlers |
107 -- 'noRoom' clients state command handlers |
108 handleCmd_noRoom :: CmdHandler |
108 handleCmd_noRoom :: CmdHandler |
109 handleCmd_noRoom client _ rooms ["LIST"] = |
109 handleCmd_noRoom client _ rooms ["LIST"] = |
110 (noChangeClients, noChangeRooms, answerServerMessage ++ (answerRoomsList $ concatMap roomInfo $ sameProtoRooms)) |
110 (noChangeClients, noChangeRooms, answerServerMessage ++ (answerRoomsList $ concatMap roomInfo $ sameProtoRooms)) |
111 where |
111 where |
112 roomInfo room = [name room, show $ playersIn room, show $ gameinprogress room] |
112 roomInfo room = [ |
|
113 name room, |
|
114 (show $ playersIn room) ++ "(" ++ (show $ length $ teams room) ++ ")", |
|
115 show $ gameinprogress room |
|
116 ] |
113 sameProtoRooms = filter (\r -> roomProto r == protocol client) rooms |
117 sameProtoRooms = filter (\r -> roomProto r == protocol client) rooms |
114 |
118 |
115 handleCmd_noRoom client _ rooms ["CREATE", newRoom, roomPassword] = |
119 handleCmd_noRoom client _ rooms ["CREATE", newRoom, roomPassword] = |
116 if (not $ isDedicated globalOptions) && (not $ null rooms) then |
120 if (not $ isDedicated globalOptions) && (not $ null rooms) then |
117 (noChangeClients, noChangeRooms, answerCannotCreateRoom) |
121 (noChangeClients, noChangeRooms, answerCannotCreateRoom) |