Issue 257: Server "Admins only" mode #290
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is a step on the path to solve #257
This change hooks up two new admin commands for the in-game chat =>
#relaycloseand#relayopenThey require accessLevel of admin
PerpetuumServer/src/Perpetuum/Commands.cs
Lines 1054 to 1064 in bd606e2
By default the server is starting in "relayopen" mode, meaning it is open to the public and anyone can join. (This is unchanged behaviour)
Once an admin has
#secured a channel and then ran the#relayclosecommand, normal players are no longer able to login to the server.This is thanks to the flow of our Sign In handler
PerpetuumServer/src/Perpetuum.RequestHandlers/SignInRequestHandler.cs
Lines 31 to 34 in bd606e2
RelayClose, only closes it to the public (and not entirely for everyone) by setting the RelayState as such:
PerpetuumServer/src/Perpetuum.RequestHandlers/RelayClose.cs
Line 17 in bd606e2
Caveats
Closing the relay has zero effect on normal players who already passed the login screen -> Meaning if they are sitting on Character Select or is in game, they can continue playing.
This will only block new attempts to log on to the server.
How to test
Requires 2 game accounts
One that is a regular account, and one that is of accessLevel Admin (tool or game, either works)
Apply the changes from this PR, then run the server.
#securea chat channel, and then run the#relayclosecommand.#securechat channel run the#relayopencommand.