equal
deleted
inserted
replaced
144 handleCmd_inRoom client _ rooms ("ADD_TEAM" : name : color : grave : fort : difStr : hhsInfo) |
144 handleCmd_inRoom client _ rooms ("ADD_TEAM" : name : color : grave : fort : difStr : hhsInfo) |
145 | length hhsInfo == 16 = |
145 | length hhsInfo == 16 = |
146 if length (teams clRoom) == 6 || canAddNumber <= 0 || isJust findTeam then |
146 if length (teams clRoom) == 6 || canAddNumber <= 0 || isJust findTeam then |
147 (noChangeClients, noChangeRooms, answerCantAdd) |
147 (noChangeClients, noChangeRooms, answerCantAdd) |
148 else |
148 else |
149 (noChangeClients, modifyRoom clRoom{teams = newTeam : teams clRoom}, answerTeamAccepted newTeam ++ answerAddTeam newTeam) |
149 (noChangeClients, modifyRoom clRoom{teams = teams clRoom ++ [newTeam]}, answerTeamAccepted newTeam ++ answerAddTeam newTeam) |
150 where |
150 where |
151 clRoom = roomByName (room client) rooms |
151 clRoom = roomByName (room client) rooms |
152 newTeam = (TeamInfo (nick client) name color grave fort difficulty newTeamHHNum (hhsList hhsInfo)) |
152 newTeam = (TeamInfo (nick client) name color grave fort difficulty newTeamHHNum (hhsList hhsInfo)) |
153 findTeam = find (\t -> name == teamname t) $ teams clRoom |
153 findTeam = find (\t -> name == teamname t) $ teams clRoom |
154 difficulty = fromMaybe 0 (maybeRead difStr :: Maybe Int) |
154 difficulty = fromMaybe 0 (maybeRead difStr :: Maybe Int) |