equal
deleted
inserted
replaced
241 (noChangeClients, noChangeRooms, answerRestricted) |
241 (noChangeClients, noChangeRooms, answerRestricted) |
242 else |
242 else |
243 (modifyClient client{room = roomName}, modifyRoom clRoom{playersIn = 1 + playersIn clRoom}, (answerJoined $ nick client) ++ answerNicks ++ answerReady ++ (answerNotReady $ nick client) ++ answerFullConfig clRoom ++ answerAllTeams (protocol client) clRoom ++ watchRound) |
243 (modifyClient client{room = roomName}, modifyRoom clRoom{playersIn = 1 + playersIn clRoom}, (answerJoined $ nick client) ++ answerNicks ++ answerReady ++ (answerNotReady $ nick client) ++ answerFullConfig clRoom ++ answerAllTeams (protocol client) clRoom ++ watchRound) |
244 where |
244 where |
245 noSuchRoom = isNothing $ find (\room -> roomName == name room && roomProto room == protocol client) rooms |
245 noSuchRoom = isNothing $ find (\room -> roomName == name room && roomProto room == protocol client) rooms |
246 answerNicks = answerClientOnly $ ["JOINED"] ++ (map nick $ sameRoomClients) |
246 answerNicks = if not $ null sameRoomClients then |
|
247 answerClientOnly $ ["JOINED"] ++ (map nick $ sameRoomClients) |
|
248 else |
|
249 [] |
247 answerReady = concatMap (\c -> answerClientOnly [if isReady c then "READY" else "NOT_READY", nick c]) sameRoomClients |
250 answerReady = concatMap (\c -> answerClientOnly [if isReady c then "READY" else "NOT_READY", nick c]) sameRoomClients |
248 sameRoomClients = filter (\ci -> room ci == roomName) clients |
251 sameRoomClients = filter (\ci -> room ci == roomName) clients |
249 clRoom = roomByName roomName rooms |
252 clRoom = roomByName roomName rooms |
250 watchRound = if (roomProto clRoom < 20) || (not $ gameinprogress clRoom) then |
253 watchRound = if (roomProto clRoom < 20) || (not $ gameinprogress clRoom) then |
251 [] |
254 [] |