Skip to content

Core: re-apply bans to networks in reloadBans - #1276

Open
berkleblebiciii wants to merge 1 commit into
openmultiplayer:masterfrom
berkleblebiciii:fix/1274-reloadbans-apply-to-networks
Open

berkleblebiciii wants to merge 1 commit into
openmultiplayer:masterfrom
berkleblebiciii:fix/1274-reloadbans-apply-to-networks

Conversation

@berkleblebiciii

Copy link
Copy Markdown

Description

Players whose IP addresses are present in the server's ban list could still connect after the ban list was reloaded (reloadbans console command or SIGUSR2). A script-side check with GetPlayerIp + 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 what Ban() does.

Fixes #1274

`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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some players with banned IP addresses are able to connect to the server

1 participant