gameServer/HWProtoInRoomState.hs
changeset 8638 0a6837edb278
parent 8627 ea2d32a03ac9
child 8757 266df6d5ed73
equal deleted inserted replaced
8637:bf63104605fe 8638:0a6837edb278
   303     master <- liftM isMaster thisClient
   303     master <- liftM isMaster thisClient
   304     rm <- thisRoom
   304     rm <- thisRoom
   305     let kickId = fromJust maybeClientId
   305     let kickId = fromJust maybeClientId
   306     let kickCl = rnc `client` kickId
   306     let kickCl = rnc `client` kickId
   307     let sameRoom = clientRoom rnc thisClientId == clientRoom rnc kickId
   307     let sameRoom = clientRoom rnc thisClientId == clientRoom rnc kickId
   308     let notOnly2Clans = (length . group . sort . map teamcolor . teams $ rm) > 2
   308     let notOnly2Players = (length . group . sort . map teamowner . teams $ rm) > 2
   309     return
   309     return
   310         [KickRoomClient kickId |
   310         [KickRoomClient kickId |
   311             master
   311             master
   312             && isJust maybeClientId
   312             && isJust maybeClientId
   313             && (kickId /= thisClientId)
   313             && (kickId /= thisClientId)
   314             && sameRoom
   314             && sameRoom
   315             && ((isNothing $ gameInfo rm) || notOnly2Clans || teamsInGame kickCl == 0)
   315             && ((isNothing $ gameInfo rm) || notOnly2Players || teamsInGame kickCl == 0)
   316         ]
   316         ]
   317 
   317 
   318 
   318 
   319 handleCmd_inRoom ["DELEGATE", newAdmin] = do
   319 handleCmd_inRoom ["DELEGATE", newAdmin] = do
   320     (thisClientId, rnc) <- ask
   320     (thisClientId, rnc) <- ask