Core: re-apply bans to networks in reloadBans - #1276
Open
berkleblebiciii wants to merge 1 commit into
Open
berkleblebiciii wants to merge 1 commit into
berkleblebiciii wants to merge 1 commit into
Conversation
`reloadBans()` (the `reloadbans` console command and SIGUSR2) removed all current bans from every network, cleared the config copy and reloaded it from the ban file - but never passed the freshly loaded bans back to the networks. After a reload the networks (and thus RakNet's ban list) had no entries left, so players with addresses still present in the ban file could connect again, even though a script-side `IsBanned()` check still detected them. Push the reloaded bans to the networks, which also kicks any connected players matching a reloaded ban. Fixes openmultiplayer#1274
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Players whose IP addresses are present in the server's ban list could still connect after the ban list was reloaded (
reloadbansconsole command orSIGUSR2). A script-side check withGetPlayerIp+ a manual lookup still detected them as banned, which shows the config copy of the ban list was correct while the actual connection-level rejection was no longer happening.Root cause
reloadBans()removed all current bans from every network, cleared the config copy and reloaded it from the ban file - but never passed the freshly loaded bans back to the networks. After a reload, RakNet's ban list was empty, so banned players were no longer rejected at connection time.Ban()(the native/console command) never hit this because it adds to both the config and the networks; only the reload path lost the network copies.Fix
After loading the bans from the file, push every ban to all networks again via
INetwork::ban(). As a side effect this also kicks any currently connected players matching a reloaded ban, consistent with whatBan()does.Fixes #1274