# HG changeset patch # User Wuzzy # Date 1544275151 -3600 # Node ID 8ad85859dd3fd47f6438ddc6cc163f9db180eb82 # Parent b33127bc24249be9dd9da034f6886aada8373062 /registered_only now tells in chat whether the state is on or off diff -r b33127bc2424 -r 8ad85859dd3f gameServer/Actions.hs --- a/gameServer/Actions.hs Sat Dec 08 14:13:18 2018 +0100 +++ b/gameServer/Actions.hs Sat Dec 08 14:19:11 2018 +0100 @@ -885,3 +885,13 @@ processAction CheckVotes = checkVotes >>= mapM_ processAction + +processAction (ShowRegisteredOnlyState chans) = do + si <- gets serverInfo + processAction $ AnswerClients chans + ["CHAT", nickServer, + if isRegisteredUsersOnly si then + loc "This server no longer allows unregistered players to join." + else + loc "This server now allows unregistered players to join." + ] diff -r b33127bc2424 -r 8ad85859dd3f gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Sat Dec 08 14:13:18 2018 +0100 +++ b/gameServer/CoreTypes.hs Sat Dec 08 14:19:11 2018 +0100 @@ -103,6 +103,7 @@ | ReactCmd [B.ByteString] | CheckVotes | SetRandomSeed + | ShowRegisteredOnlyState [ClientChan] data Event = LobbyChatMessage diff -r b33127bc2424 -r 8ad85859dd3f gameServer/HWProtoCore.hs --- a/gameServer/HWProtoCore.hs Sat Dec 08 14:13:18 2018 +0100 +++ b/gameServer/HWProtoCore.hs Sat Dec 08 14:19:11 2018 +0100 @@ -120,11 +120,11 @@ h "INFO" n | not $ B.null n = handleCmd ["INFO", n] h "HELP" _ = handleCmd ["HELP"] h "REGISTERED_ONLY" _ = serverAdminOnly $ do - cl <- thisClient + rnc <- liftM snd ask + let chans = map (sendChan . client rnc) $ allClients rnc return [ModifyServerInfo(\s -> s{isRegisteredUsersOnly = not $ isRegisteredUsersOnly s}) - -- TODO: Say whether 'registered only' state is on or off - , AnswerClients [sendChan cl] ["CHAT", nickServer, loc "'Registered only' state toggled."] + , ShowRegisteredOnlyState chans ] h "SUPER_POWER" _ = serverAdminOnly $ do cl <- thisClient