equal
deleted
inserted
replaced
157 cl <- thisClient |
157 cl <- thisClient |
158 chans <- roomClientsChans |
158 chans <- roomClientsChans |
159 return [ |
159 return [ |
160 ModifyClient (\c -> c{isReady = not $ isReady cl}), |
160 ModifyClient (\c -> c{isReady = not $ isReady cl}), |
161 ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}), |
161 ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}), |
162 AnswerClients chans ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl] |
162 AnswerClients chans $ if clientProto cl < 38 then |
|
163 [if isReady cl then "NOT_READY" else "READY", nick cl] |
|
164 else |
|
165 ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl] |
163 ] |
166 ] |
164 |
167 |
165 handleCmd_inRoom ["START_GAME"] = do |
168 handleCmd_inRoom ["START_GAME"] = do |
166 cl <- thisClient |
169 cl <- thisClient |
167 rm <- thisRoom |
170 rm <- thisRoom |
219 else |
222 else |
220 return [] |
223 return [] |
221 where |
224 where |
222 answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams |
225 answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams |
223 |
226 |
|
227 -- compatibility with clients with protocol < 38 |
|
228 handleCmd_inRoom ["ROUNDFINISHED"] = |
|
229 handleCmd_inRoom ["ROUNDFINISHED", "1"] |
|
230 |
224 handleCmd_inRoom ["TOGGLE_RESTRICT_JOINS"] = do |
231 handleCmd_inRoom ["TOGGLE_RESTRICT_JOINS"] = do |
225 cl <- thisClient |
232 cl <- thisClient |
226 return $ |
233 return $ |
227 if not $ isMaster cl then |
234 if not $ isMaster cl then |
228 [ProtocolError "Not room master"] |
235 [ProtocolError "Not room master"] |