Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always allow the local player through the banlist #540

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NorthstarDLL/server/auth/bansystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
}
Expand Down