diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2023-10-04 00:04:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 01:04:32 +0200 |
commit | 1d30b2d5eeecb1b0bddf75c665939f9532ee235e (patch) | |
tree | 32c3caec2139a29c486503c1958835b33582b3da /NorthstarDLL/server | |
parent | 2a3be90915b547f21c1dc574a83b24c988cf6b72 (diff) | |
download | NorthstarLauncher-1d30b2d5eeecb1b0bddf75c665939f9532ee235e.tar.gz NorthstarLauncher-1d30b2d5eeecb1b0bddf75c665939f9532ee235e.zip |
Always allow the local player through the banlist (#540)v1.19.4-rc2v1.19.4-rc1v1.19.4
Adds a check to always allow local player through banlist to aid with players accidentally banning themselves.
Diffstat (limited to 'NorthstarDLL/server')
-rw-r--r-- | NorthstarDLL/server/auth/bansystem.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/NorthstarDLL/server/auth/bansystem.cpp b/NorthstarDLL/server/auth/bansystem.cpp index 845a1bff..9b9d24c4 100644 --- a/NorthstarDLL/server/auth/bansystem.cpp +++ b/NorthstarDLL/server/auth/bansystem.cpp @@ -3,6 +3,7 @@ #include "core/convar/concommand.h" #include "server/r2server.h" #include "engine/r2engine.h" +#include "client/r2client.h" #include "config/profile.h" #include <filesystem> @@ -172,6 +173,10 @@ void ServerBanSystem::UnbanUID(uint64_t uid) bool ServerBanSystem::IsUIDAllowed(uint64_t uid) { + uint64_t localPlayerUserID = strtoull(R2::g_pLocalPlayerUserID, nullptr, 10); + if (localPlayerUserID == uid) + return true; + ReloadBanlist(); // Reload to have up to date list on join return std::find(m_vBannedUids.begin(), m_vBannedUids.end(), uid) == m_vBannedUids.end(); } |