gameServer/HandlerUtils.hs
changeset 10194 7025bd3c3131
parent 9433 f0a8ac191839
child 10212 5fb3bb2de9d2
equal deleted inserted replaced
10193:d7cd5b43588f 10194:7025bd3c3131
    64 clientByNick n = do
    64 clientByNick n = do
    65     (_, rnc) <- ask
    65     (_, rnc) <- ask
    66     let allClientIDs = allClients rnc
    66     let allClientIDs = allClients rnc
    67     return $ find (\clId -> let cl = client rnc clId in n == nick cl && not (isChecker cl)) allClientIDs
    67     return $ find (\clId -> let cl = client rnc clId in n == nick cl && not (isChecker cl)) allClientIDs
    68 
    68 
       
    69 
       
    70 roomAdminOnly :: Reader (ClientIndex, IRnC) [Action] -> Reader (ClientIndex, IRnC) [Action]
       
    71 roomAdminOnly h = thisClient >>= \cl -> if isMaster cl then h else return []
       
    72 
       
    73 
       
    74 serverAdminOnly :: Reader (ClientIndex, IRnC) [Action] -> Reader (ClientIndex, IRnC) [Action]
       
    75 serverAdminOnly h = thisClient >>= \cl -> if isAdministrator cl then h else return []