236 clRoom = roomByName (room client) rooms |
236 clRoom = roomByName (room client) rooms |
237 |
237 |
238 handleCmd_inRoom client _ _ ["GAMEMSG", msg] = |
238 handleCmd_inRoom client _ _ ["GAMEMSG", msg] = |
239 (noChangeClients, noChangeRooms, [(othersInRoom, ["GAMEMSG", msg])]) |
239 (noChangeClients, noChangeRooms, [(othersInRoom, ["GAMEMSG", msg])]) |
240 |
240 |
|
241 handleCmd_inRoom client clients rooms ["KICK", kickNick] = |
|
242 if isMaster client then |
|
243 if noSuchClient || (kickClient == client) then |
|
244 (noChangeClients, noChangeRooms, []) |
|
245 else |
|
246 (modifyClient kickClient{forceQuit = True}, noChangeRooms, []) |
|
247 else |
|
248 (noChangeClients, noChangeRooms, []) |
|
249 where |
|
250 clRoom = roomByName (room client) rooms |
|
251 noSuchClient = isNothing findClient |
|
252 kickClient = fromJust findClient |
|
253 findClient = find (\t -> ((room t) == (room client)) && ((nick t) == kickNick)) $ clients |
|
254 |
241 handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, answerBadCmd) |
255 handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, answerBadCmd) |