92 h "MAXTEAMS" n | not $ B.null n = handleCmd ["MAXTEAMS", n] |
92 h "MAXTEAMS" n | not $ B.null n = handleCmd ["MAXTEAMS", n] |
93 h "INFO" n | not $ B.null n = handleCmd ["INFO", n] |
93 h "INFO" n | not $ B.null n = handleCmd ["INFO", n] |
94 h "RESTART_SERVER" "YES" = handleCmd ["RESTART_SERVER"] |
94 h "RESTART_SERVER" "YES" = handleCmd ["RESTART_SERVER"] |
95 h "REGISTERED_ONLY" _ = do |
95 h "REGISTERED_ONLY" _ = do |
96 cl <- thisClient |
96 cl <- thisClient |
97 return [ModifyServerInfo(\s -> s{isRegisteredUsersOnly = not $ isRegisteredUsersOnly s}) |
97 return $ if isAdministrator cl then |
|
98 [ModifyServerInfo(\s -> s{isRegisteredUsersOnly = not $ isRegisteredUsersOnly s}) |
98 , AnswerClients [sendChan cl] ["CHAT", "[server]", "'Registered only' state toggled"] |
99 , AnswerClients [sendChan cl] ["CHAT", "[server]", "'Registered only' state toggled"] |
99 ] |
100 ] |
|
101 else |
|
102 [] |
100 h c p = return [Warning $ B.concat ["Unknown cmd: /", c, " ", p]] |
103 h c p = return [Warning $ B.concat ["Unknown cmd: /", c, " ", p]] |
101 |
104 |
102 extractParameters p = let (a, b) = B.break (== ' ') p in (upperCase a, B.dropWhile (== ' ') b) |
105 extractParameters p = let (a, b) = B.break (== ' ') p in (upperCase a, B.dropWhile (== ' ') b) |
103 |
106 |
104 handleCmd_loggedin ["INFO", asknick] = do |
107 handleCmd_loggedin ["INFO", asknick] = do |