aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/server
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/server')
-rw-r--r--NorthstarDLL/server/auth/bansystem.cpp3
-rw-r--r--NorthstarDLL/server/auth/serverauthentication.cpp3
-rw-r--r--NorthstarDLL/server/buildainfile.cpp10
3 files changed, 5 insertions, 11 deletions
diff --git a/NorthstarDLL/server/auth/bansystem.cpp b/NorthstarDLL/server/auth/bansystem.cpp
index 56719ed9..47df495d 100644
--- a/NorthstarDLL/server/auth/bansystem.cpp
+++ b/NorthstarDLL/server/auth/bansystem.cpp
@@ -2,7 +2,6 @@
#include "pch.h"
#include "bansystem.h"
#include "serverauthentication.h"
-#include "shared/maxplayers.h"
#include "core/convar/concommand.h"
#include "server/r2server.h"
#include "engine/r2engine.h"
@@ -184,7 +183,7 @@ void ConCommand_ban(const CCommand& args)
if (args.ArgC() < 2)
return;
- for (int i = 0; i < R2::GetMaxPlayers(); i++)
+ for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++)
{
R2::CBaseClient* player = &R2::g_pClientArray[i];
diff --git a/NorthstarDLL/server/auth/serverauthentication.cpp b/NorthstarDLL/server/auth/serverauthentication.cpp
index f8180469..2f06f60f 100644
--- a/NorthstarDLL/server/auth/serverauthentication.cpp
+++ b/NorthstarDLL/server/auth/serverauthentication.cpp
@@ -6,7 +6,6 @@
#include "masterserver/masterserver.h"
#include "server/serverpresence.h"
#include "engine/hoststate.h"
-#include "shared/maxplayers.h"
#include "bansystem.h"
#include "core/convar/concommand.h"
#include "dedicated/dedicated.h"
@@ -154,7 +153,7 @@ bool ServerAuthenticationManager::IsDuplicateAccount(R2::CBaseClient* pPlayer, c
return false;
bool bHasUidPlayer = false;
- for (int i = 0; i < R2::GetMaxPlayers(); i++)
+ for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++)
if (&R2::g_pClientArray[i] != pPlayer && !strcmp(pPlayerUid, R2::g_pClientArray[i].m_UID))
return true;
diff --git a/NorthstarDLL/server/buildainfile.cpp b/NorthstarDLL/server/buildainfile.cpp
index f6dc4717..d1150a6b 100644
--- a/NorthstarDLL/server/buildainfile.cpp
+++ b/NorthstarDLL/server/buildainfile.cpp
@@ -174,14 +174,12 @@ struct CAI_Network
};
#pragma pack(pop)
-char** pUnkServerMapversionGlobal;
-
ConVar* Cvar_ns_ai_dumpAINfileFromLoad;
void DumpAINInfo(CAI_Network* aiNetwork)
{
fs::path writePath(fmt::format("{}/maps/graphs", R2::g_pModName));
- writePath /= R2::g_pHostState->m_levelName;
+ writePath /= R2::g_pGlobals->m_pMapName;
writePath += ".ain";
// dump from memory
@@ -196,9 +194,8 @@ void DumpAINInfo(CAI_Network* aiNetwork)
spdlog::info("writing ainet version: {}", AINET_VERSION_NUMBER);
writeStream.write((char*)&AINET_VERSION_NUMBER, sizeof(int));
- // could probably be cleaner but whatever
- int mapVersion = *(int*)(*pUnkServerMapversionGlobal + 104);
- spdlog::info("writing map version: {}", mapVersion); // temp
+ int mapVersion = R2::g_pGlobals->m_nMapVersion;
+ spdlog::info("writing map version: {}", mapVersion);
writeStream.write((char*)&mapVersion, sizeof(int));
spdlog::info("writing placeholder crc: {}", PLACEHOLDER_CRC);
writeStream.write((char*)&PLACEHOLDER_CRC, sizeof(int));
@@ -396,5 +393,4 @@ ON_DLL_LOAD("server.dll", BuildAINFile, (CModule module))
pppUnkNodeStruct0s = module.Offset(0x1063BE0).As<UnkNodeStruct0***>();
pUnkLinkStruct1Count = module.Offset(0x1063AA8).As<int*>();
pppUnkStruct1s = module.Offset(0x1063A90).As<UnkLinkStruct1***>();
- pUnkServerMapversionGlobal = module.Offset(0xBFBE08).As<char**>();
}