aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/serverauthentication.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-02 03:06:04 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-02 03:06:04 +0000
commit5514ff036dbdbf7f4000934223a0d21bf0b9085d (patch)
treef0320ef7f2ccd029bc04339d6f4b63e4ffdab7e8 /NorthstarDedicatedTest/serverauthentication.cpp
parent4ad3342f6ce8ac4e9976f5eab5410c58b420a6a4 (diff)
downloadNorthstarLauncher-5514ff036dbdbf7f4000934223a0d21bf0b9085d.tar.gz
NorthstarLauncher-5514ff036dbdbf7f4000934223a0d21bf0b9085d.zip
initial work for ban system
Diffstat (limited to 'NorthstarDedicatedTest/serverauthentication.cpp')
-rw-r--r--NorthstarDedicatedTest/serverauthentication.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/serverauthentication.cpp b/NorthstarDedicatedTest/serverauthentication.cpp
index c4208130..0fdb8664 100644
--- a/NorthstarDedicatedTest/serverauthentication.cpp
+++ b/NorthstarDedicatedTest/serverauthentication.cpp
@@ -5,6 +5,7 @@
#include "masterserver.h"
#include "httplib.h"
#include "gameutils.h"
+#include "bansystem.h"
#include <fstream>
#include <filesystem>
#include <thread>
@@ -116,8 +117,10 @@ void ServerAuthenticationManager::StopPlayerAuthServer()
bool ServerAuthenticationManager::AuthenticatePlayer(void* player, int64_t uid, char* authToken)
{
- std::string strUid = std::to_string(uid);
+ if (!g_ServerBanSystem->IsUIDAllowed(uid))
+ return false;
+ std::string strUid = std::to_string(uid);
std::lock_guard<std::mutex> guard(m_authDataMutex);
bool authFail = true;
@@ -221,7 +224,7 @@ void ServerAuthenticationManager::WritePersistentData(void* player)
// store these in vars so we can use them in CBaseClient::Connect
// this is fine because ptrs won't decay by the time we use this, just don't use it outside of cbaseclient::connect
char* nextPlayerToken;
-int64_t nextPlayerUid;
+uint64_t nextPlayerUid;
void* CBaseServer__ConnectClientHook(void* server, void* a2, void* a3, uint32_t a4, uint32_t a5, int32_t a6, void* a7, void* a8, char* serverFilter, void* a10, char a11, void* a12, char a13, char a14, int64_t uid, uint32_t a16, uint32_t a17)
{