gameServer/HWProtoCore.hs
changeset 14380 8ad85859dd3f
parent 14118 589a752c01ca
child 14381 32e8c81ca35c
equal deleted inserted replaced
14379:b33127bc2424 14380:8ad85859dd3f
   118             return [AnswerClients chans ["CHAT", nickGlobal, p]]
   118             return [AnswerClients chans ["CHAT", nickGlobal, p]]
   119         h "WATCH" f = return [QueryReplay f]
   119         h "WATCH" f = return [QueryReplay f]
   120         h "INFO" n | not $ B.null n = handleCmd ["INFO", n]
   120         h "INFO" n | not $ B.null n = handleCmd ["INFO", n]
   121         h "HELP" _ = handleCmd ["HELP"]
   121         h "HELP" _ = handleCmd ["HELP"]
   122         h "REGISTERED_ONLY" _ = serverAdminOnly $ do
   122         h "REGISTERED_ONLY" _ = serverAdminOnly $ do
   123             cl <- thisClient
   123             rnc <- liftM snd ask
       
   124             let chans = map (sendChan . client rnc) $ allClients rnc
   124             return
   125             return
   125                 [ModifyServerInfo(\s -> s{isRegisteredUsersOnly = not $ isRegisteredUsersOnly s})
   126                 [ModifyServerInfo(\s -> s{isRegisteredUsersOnly = not $ isRegisteredUsersOnly s})
   126                 -- TODO: Say whether 'registered only' state is on or off
   127                 , ShowRegisteredOnlyState chans
   127                 , AnswerClients [sendChan cl] ["CHAT", nickServer, loc "'Registered only' state toggled."]
       
   128                 ]
   128                 ]
   129         h "SUPER_POWER" _ = serverAdminOnly $ do
   129         h "SUPER_POWER" _ = serverAdminOnly $ do
   130             cl <- thisClient
   130             cl <- thisClient
   131             return
   131             return
   132                 [ModifyClient (\c -> c{hasSuperPower = True})
   132                 [ModifyClient (\c -> c{hasSuperPower = True})