netserver/HWProto.hs
changeset 1675 d5e131005516
parent 1673 06bff12f8a74
child 1676 6f6f14a3e0ea
equal deleted inserted replaced
1674:b6d609815378 1675:d5e131005516
   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 					[]