equal
deleted
inserted
replaced
193 else |
193 else |
194 return [] |
194 return [] |
195 where |
195 where |
196 (isLegal, isKeepAlive) = checkNetCmd msg |
196 (isLegal, isKeepAlive) = checkNetCmd msg |
197 |
197 |
198 {- |
198 |
199 handleCmd_inRoom clID clients rooms ["ROUNDFINISHED"] = |
199 handleCmd_inRoom ["ROUNDFINISHED"] = do |
200 if isMaster client then |
200 cl <- thisClient |
201 [ModifyRoom |
201 r <- thisRoom |
|
202 chans <- roomClientsChans |
|
203 |
|
204 if isMaster cl && (gameinprogress r) then |
|
205 return $ (ModifyRoom |
202 (\r -> r{ |
206 (\r -> r{ |
203 gameinprogress = False, |
207 gameinprogress = False, |
204 readyPlayers = 0, |
208 readyPlayers = 0, |
205 roundMsgs = empty, |
209 roundMsgs = empty, |
206 leftTeams = [], |
210 leftTeams = [], |
207 teamsAtStart = []} |
211 teamsAtStart = []} |
208 ), |
212 )) |
209 UnreadyRoomClients |
213 : UnreadyRoomClients |
210 ] ++ answerRemovedTeams |
214 : answerRemovedTeams chans r |
211 else |
215 else |
212 [] |
216 return [] |
213 where |
217 where |
214 client = clients IntMap.! clID |
218 answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams |
215 room = rooms IntMap.! (roomID client) |
|
216 answerRemovedTeams = map (\t -> AnswerThisRoom ["REMOVE_TEAM", t]) $ leftTeams room |
|
217 -} |
|
218 |
219 |
219 handleCmd_inRoom ["TOGGLE_RESTRICT_JOINS"] = do |
220 handleCmd_inRoom ["TOGGLE_RESTRICT_JOINS"] = do |
220 cl <- thisClient |
221 cl <- thisClient |
221 return $ |
222 return $ |
222 if not $ isMaster cl then |
223 if not $ isMaster cl then |