gameServer/HWProtoCore.hs
changeset 10882 ed7717f659ae
parent 10881 941b5ab9e5a6
child 11033 2a5520837036
equal deleted inserted replaced
10881:941b5ab9e5a6 10882:ed7717f659ae
    69             let chans = map (sendChan . client rnc) $ allClients rnc
    69             let chans = map (sendChan . client rnc) $ allClients rnc
    70             return [AnswerClients chans ["CHAT", "[global notice]", p] | isAdministrator cl]
    70             return [AnswerClients chans ["CHAT", "[global notice]", p] | isAdministrator cl]
    71         h "WATCH" f = return [QueryReplay f]
    71         h "WATCH" f = return [QueryReplay f]
    72         h "FIX" _ = handleCmd ["FIX"]
    72         h "FIX" _ = handleCmd ["FIX"]
    73         h "UNFIX" _ = handleCmd ["UNFIX"]
    73         h "UNFIX" _ = handleCmd ["UNFIX"]
    74         h "GREETING" msg = handleCmd ["GREETING", msg]
    74         h "GREETING" msg | not $ B.null msg = handleCmd ["GREETING", msg]
    75         h "CALLVOTE" msg | B.null msg = handleCmd ["CALLVOTE"]
    75         h "CALLVOTE" msg | B.null msg = handleCmd ["CALLVOTE"]
    76                          | otherwise = let (c, p) = extractParameters msg in
    76                          | otherwise = let (c, p) = extractParameters msg in
    77                                            if B.null p then handleCmd ["CALLVOTE", c] else handleCmd ["CALLVOTE", c, p]
    77                                            if B.null p then handleCmd ["CALLVOTE", c] else handleCmd ["CALLVOTE", c, p]
    78         h "VOTE" msg = handleCmd ["VOTE", upperCase msg]
    78         h "VOTE" msg | not $ B.null msg = handleCmd ["VOTE", upperCase msg]
    79         h "FORCE" msg = handleCmd ["VOTE", upperCase msg, "FORCE"]
    79         h "FORCE" msg | not $ B.null msg = handleCmd ["VOTE", upperCase msg, "FORCE"]
       
    80         h "MAXTEAMS" n | not $ B.null n = handleCmd ["MAXTEAMS", n]
       
    81         h "INFO" n | not $ B.null n = handleCmd ["INFO", n]
    80         h c p = return [Warning $ B.concat ["Unknown cmd: /", c, " ", p]]
    82         h c p = return [Warning $ B.concat ["Unknown cmd: /", c, " ", p]]
    81 
    83 
    82         extractParameters p = let (a, b) = B.break (== ' ') p in (upperCase a, B.dropWhile (== ' ') b)
    84         extractParameters p = let (a, b) = B.break (== ' ') p in (upperCase a, B.dropWhile (== ' ') b)
    83 
    85 
    84 
    86