gameServer/HWProtoCore.hs
changeset 9035 e84d42a4311c
parent 9034 279168729cc3
child 9061 38e8787483db
equal deleted inserted replaced
9034:279168729cc3 9035:e84d42a4311c
    43     where
    43     where
    44         h ["DELEGATE", n] = handleCmd ["DELEGATE", n]
    44         h ["DELEGATE", n] = handleCmd ["DELEGATE", n]
    45         h ["STATS"] = handleCmd ["STATS"]
    45         h ["STATS"] = handleCmd ["STATS"]
    46         h ("PART":m:ms) = handleCmd ["PART", B.unwords $ m:ms]
    46         h ("PART":m:ms) = handleCmd ["PART", B.unwords $ m:ms]
    47         h ("QUIT":m:ms) = handleCmd ["QUIT", B.unwords $ m:ms]
    47         h ("QUIT":m:ms) = handleCmd ["QUIT", B.unwords $ m:ms]
       
    48         h ("RND":rs) = handleCmd ("RND":rs)
    48         h ("GLOBAL":m:ms) = do
    49         h ("GLOBAL":m:ms) = do
       
    50             cl <- thisClient
    49             rnc <- liftM snd ask
    51             rnc <- liftM snd ask
    50             let chans = map (sendChan . client rnc) $ allClients rnc
    52             let chans = map (sendChan . client rnc) $ allClients rnc
    51             return [AnswerClients chans ["CHAT", "[global notice]", B.unwords $ m:ms]]
    53             return [AnswerClients chans ["CHAT", "[global notice]", B.unwords $ m:ms] | isAdministrator cl]
    52         h c = return [Warning . B.concat . L.intersperse " " $ "Unknown cmd" : c]
    54         h c = return [Warning . B.concat . L.intersperse " " $ "Unknown cmd" : c]
    53 
    55 
    54 handleCmd cmd = do
    56 handleCmd cmd = do
    55     (ci, irnc) <- ask
    57     (ci, irnc) <- ask
    56     let cl = irnc `client` ci
    58     let cl = irnc `client` ci