equal
deleted
inserted
replaced
217 |
217 |
218 handleCmd_inRoom client _ rooms ["TEAM_COLOR", teamName, newColor] = |
218 handleCmd_inRoom client _ rooms ["TEAM_COLOR", teamName, newColor] = |
219 if not $ isMaster client then |
219 if not $ isMaster client then |
220 (noChangeClients, noChangeRooms, answerNotMaster) |
220 (noChangeClients, noChangeRooms, answerNotMaster) |
221 else |
221 else |
222 (noChangeClients, modifyRoom $ modifyTeam clRoom team{teamcolor = newColor}, answerTeamColor teamName newColor) |
222 if noSuchTeam then |
|
223 (noChangeClients, noChangeRooms, answerBadParam) |
|
224 else |
|
225 (noChangeClients, modifyRoom $ modifyTeam clRoom team{teamcolor = newColor}, answerTeamColor teamName newColor) |
223 where |
226 where |
224 noSuchTeam = isNothing findTeam |
227 noSuchTeam = isNothing findTeam |
225 team = fromJust findTeam |
228 team = fromJust findTeam |
226 findTeam = find (\t -> teamName == teamname t) $ teams clRoom |
229 findTeam = find (\t -> teamName == teamname t) $ teams clRoom |
227 clRoom = roomByName (room client) rooms |
230 clRoom = roomByName (room client) rooms |