aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/shared
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2023-12-20 13:24:07 +0000
committerGitHub <noreply@github.com>2023-12-20 14:24:07 +0100
commit0438b5c8cfa99ac01c7e142d959aa40f88f1cc70 (patch)
treebbfdded20f8686cf188dba148db4b6c1b1211872 /NorthstarDLL/shared
parent210dab2b0e5c686829bafdc857d2910f6b216b85 (diff)
downloadNorthstarLauncher-0438b5c8cfa99ac01c7e142d959aa40f88f1cc70.tar.gz
NorthstarLauncher-0438b5c8cfa99ac01c7e142d959aa40f88f1cc70.zip
Cherry pick "remove unnecessary namespaces" from primedev (#618)v1.21.2-rc2
Cherry-picks the removal of unnecessary namespaces from `primedev` https://github.com/F1F7Y/NorthstarPrime/ Co-authored-by: F1F7Y <filip.bartos07@proton.me>
Diffstat (limited to 'NorthstarDLL/shared')
-rw-r--r--NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp24
-rw-r--r--NorthstarDLL/shared/exploit_fixes/ns_limits.cpp56
-rw-r--r--NorthstarDLL/shared/exploit_fixes/ns_limits.h12
-rw-r--r--NorthstarDLL/shared/maxplayers.cpp16
-rw-r--r--NorthstarDLL/shared/maxplayers.h6
-rw-r--r--NorthstarDLL/shared/misccommands.cpp30
-rw-r--r--NorthstarDLL/shared/playlist.cpp2
7 files changed, 69 insertions, 77 deletions
diff --git a/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp b/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp
index 8821a40d..8064d5ac 100644
--- a/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp
+++ b/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp
@@ -84,7 +84,7 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10
};
auto msg = (NET_SetConVar*)pMsg;
- bool bIsServerFrame = Tier0::ThreadInServerFrameThread();
+ bool bIsServerFrame = ThreadInServerFrameThread();
std::string BLOCK_PREFIX =
std::string {"NET_SetConVar ("} + (bIsServerFrame ? "server" : "client") + "): Blocked dangerous/invalid msg: ";
@@ -118,7 +118,7 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10
if (!nameValid || !valValid)
return BLOCKED_INFO("Missing null terminators");
- ConVar* pVar = R2::g_pCVar->FindVar(entry->name);
+ ConVar* pVar = g_pCVar->FindVar(entry->name);
if (pVar)
{
@@ -263,19 +263,19 @@ bool, __fastcall, (const char* pModName)) // 48 83 EC 28 48 8B 0D ? ? ? ? 48 8D
{
// somewhat temp, store the modname here, since we don't have a proper ptr in engine to it rn
int iSize = strlen(pModName);
- R2::g_pModName = new char[iSize + 1];
- strcpy(R2::g_pModName, pModName);
+ g_pModName = new char[iSize + 1];
+ strcpy(g_pModName, pModName);
if (g_pVanillaCompatibility->GetVanillaCompatibility())
return false;
- return (!strcmp("r2", pModName) || !strcmp("r1", pModName)) && !Tier0::CommandLine()->CheckParm("-norestrictservercommands");
+ return (!strcmp("r2", pModName) || !strcmp("r1", pModName)) && !CommandLine()->CheckParm("-norestrictservercommands");
}
// ratelimit stringcmds, and prevent remote clients from calling commands that they shouldn't
// clang-format off
AUTOHOOK(CGameClient__ExecuteStringCommand, engine.dll + 0x1022E0,
-bool, __fastcall, (R2::CBaseClient* self, uint32_t unknown, const char* pCommandString))
+bool, __fastcall, (CBaseClient* self, uint32_t unknown, const char* pCommandString))
// clang-format on
{
if (Cvar_ns_should_log_all_clientcommands->GetBool())
@@ -283,7 +283,7 @@ bool, __fastcall, (R2::CBaseClient* self, uint32_t unknown, const char* pCommand
if (!g_pServerLimits->CheckStringCommandLimits(self))
{
- R2::CBaseClient__Disconnect(self, 1, "Sent too many stringcmd commands");
+ CBaseClient__Disconnect(self, 1, "Sent too many stringcmd commands");
return false;
}
@@ -292,10 +292,10 @@ bool, __fastcall, (R2::CBaseClient* self, uint32_t unknown, const char* pCommand
memset(commandBuf, 0, sizeof(commandBuf));
CCommand tempCommand = *(CCommand*)&commandBuf;
- if (!R2::CCommand__Tokenize(tempCommand, pCommandString, R2::cmd_source_t::kCommandSrcCode) || !tempCommand.ArgC())
+ if (!CCommand__Tokenize(tempCommand, pCommandString, cmd_source_t::kCommandSrcCode) || !tempCommand.ArgC())
return false;
- ConCommand* command = R2::g_pCVar->FindCommand(tempCommand.Arg(0));
+ ConCommand* command = g_pCVar->FindCommand(tempCommand.Arg(0));
// if the command doesn't exist pass it on to ExecuteStringCommand for script clientcommands and stuff
if (command && !command->IsFlagSet(FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS))
@@ -304,7 +304,7 @@ bool, __fastcall, (R2::CBaseClient* self, uint32_t unknown, const char* pCommand
if (IsDedicatedServer())
return false;
- if (strcmp(self->m_UID, R2::g_pLocalPlayerUserID))
+ if (strcmp(self->m_UID, g_pLocalPlayerUserID))
return false;
}
@@ -355,7 +355,7 @@ void, __fastcall, (void* self))
bWasWritingStringTableSuccessful = true;
CBaseClient__SendServerInfo(self);
if (!bWasWritingStringTableSuccessful)
- R2::CBaseClient__Disconnect(
+ CBaseClient__Disconnect(
self, 1, "Overflowed CNetworkStringTableContainer::WriteBaselines, try restarting your client and reconnecting");
}
@@ -457,5 +457,5 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerExploitFixes, ConVar, (CModule module))
Cvar_ns_should_log_all_clientcommands =
new ConVar("ns_should_log_all_clientcommands", "0", FCVAR_NONE, "Whether to log all clientcommands");
- Cvar_sv_cheats = R2::g_pCVar->FindVar("sv_cheats");
+ Cvar_sv_cheats = g_pCVar->FindVar("sv_cheats");
}
diff --git a/NorthstarDLL/shared/exploit_fixes/ns_limits.cpp b/NorthstarDLL/shared/exploit_fixes/ns_limits.cpp
index c9085cb0..bd855ee4 100644
--- a/NorthstarDLL/shared/exploit_fixes/ns_limits.cpp
+++ b/NorthstarDLL/shared/exploit_fixes/ns_limits.cpp
@@ -19,47 +19,47 @@ void ServerLimitsManager::RunFrame(double flCurrentTime, float flFrameTime)
if (Cvar_sv_antispeedhack_enable->GetBool())
{
// for each player, set their usercmd processing budget for the frame to the last frametime for the server
- for (int i = 0; i < R2::g_pGlobals->m_nMaxClients; i++)
+ for (int i = 0; i < g_pGlobals->m_nMaxClients; i++)
{
- R2::CBaseClient* player = &R2::g_pClientArray[i];
+ CBaseClient* player = &g_pClientArray[i];
if (m_PlayerLimitData.find(player) != m_PlayerLimitData.end())
{
PlayerLimitData* pLimitData = &g_pServerLimits->m_PlayerLimitData[player];
- if (pLimitData->flFrameUserCmdBudget < R2::g_pGlobals->m_flTickInterval * Cvar_sv_antispeedhack_maxtickbudget->GetFloat())
+ if (pLimitData->flFrameUserCmdBudget < g_pGlobals->m_flTickInterval * Cvar_sv_antispeedhack_maxtickbudget->GetFloat())
{
pLimitData->flFrameUserCmdBudget += g_pServerLimits->Cvar_sv_antispeedhack_budgetincreasemultiplier->GetFloat() *
- fmax(flFrameTime, R2::g_pGlobals->m_flFrameTime * CEngineServer__GetTimescale());
+ fmax(flFrameTime, g_pGlobals->m_flFrameTime * CEngineServer__GetTimescale());
}
}
}
}
}
-void ServerLimitsManager::AddPlayer(R2::CBaseClient* player)
+void ServerLimitsManager::AddPlayer(CBaseClient* player)
{
PlayerLimitData limitData;
limitData.flFrameUserCmdBudget =
- R2::g_pGlobals->m_flTickInterval * CEngineServer__GetTimescale() * Cvar_sv_antispeedhack_maxtickbudget->GetFloat();
+ g_pGlobals->m_flTickInterval * CEngineServer__GetTimescale() * Cvar_sv_antispeedhack_maxtickbudget->GetFloat();
m_PlayerLimitData.insert(std::make_pair(player, limitData));
}
-void ServerLimitsManager::RemovePlayer(R2::CBaseClient* player)
+void ServerLimitsManager::RemovePlayer(CBaseClient* player)
{
if (m_PlayerLimitData.find(player) != m_PlayerLimitData.end())
m_PlayerLimitData.erase(player);
}
-bool ServerLimitsManager::CheckStringCommandLimits(R2::CBaseClient* player)
+bool ServerLimitsManager::CheckStringCommandLimits(CBaseClient* player)
{
if (CVar_sv_quota_stringcmdspersecond->GetInt() != -1)
{
// note: this isn't super perfect, legit clients can trigger it in lobby if they try, mostly good enough tho imo
- if (Tier0::Plat_FloatTime() - m_PlayerLimitData[player].lastClientCommandQuotaStart >= 1.0)
+ if (Plat_FloatTime() - m_PlayerLimitData[player].lastClientCommandQuotaStart >= 1.0)
{
// reset quota
- m_PlayerLimitData[player].lastClientCommandQuotaStart = Tier0::Plat_FloatTime();
+ m_PlayerLimitData[player].lastClientCommandQuotaStart = Plat_FloatTime();
m_PlayerLimitData[player].numClientCommandsInQuota = 0;
}
@@ -74,11 +74,11 @@ bool ServerLimitsManager::CheckStringCommandLimits(R2::CBaseClient* player)
return true;
}
-bool ServerLimitsManager::CheckChatLimits(R2::CBaseClient* player)
+bool ServerLimitsManager::CheckChatLimits(CBaseClient* player)
{
- if (Tier0::Plat_FloatTime() - m_PlayerLimitData[player].lastSayTextLimitStart >= 1.0)
+ if (Plat_FloatTime() - m_PlayerLimitData[player].lastSayTextLimitStart >= 1.0)
{
- m_PlayerLimitData[player].lastSayTextLimitStart = Tier0::Plat_FloatTime();
+ m_PlayerLimitData[player].lastSayTextLimitStart = Plat_FloatTime();
m_PlayerLimitData[player].sayTextLimitCount = 0;
}
@@ -100,14 +100,14 @@ char, __fastcall, (void* self, void* buf))
NETCHANLIMIT_KICK
};
- double startTime = Tier0::Plat_FloatTime();
+ double startTime = Plat_FloatTime();
char ret = CNetChan__ProcessMessages(self, buf);
// check processing limits, unless we're in a level transition
- if (R2::g_pHostState->m_iCurrentState == R2::HostState_t::HS_RUN && Tier0::ThreadInServerFrameThread())
+ if (g_pHostState->m_iCurrentState == HostState_t::HS_RUN && ThreadInServerFrameThread())
{
// player that sent the message
- R2::CBaseClient* sender = *(R2::CBaseClient**)((char*)self + 368);
+ CBaseClient* sender = *(CBaseClient**)((char*)self + 368);
// if no sender, return
// relatively certain this is fine?
@@ -121,7 +121,7 @@ char, __fastcall, (void* self, void* buf))
g_pServerLimits->m_PlayerLimitData[sender].lastNetChanProcessingLimitStart = startTime;
g_pServerLimits->m_PlayerLimitData[sender].netChanProcessingLimitTime = 0.0;
}
- g_pServerLimits->m_PlayerLimitData[sender].netChanProcessingLimitTime += (Tier0::Plat_FloatTime() * 1000) - (startTime * 1000);
+ g_pServerLimits->m_PlayerLimitData[sender].netChanProcessingLimitTime += (Plat_FloatTime() * 1000) - (startTime * 1000);
if (g_pServerLimits->m_PlayerLimitData[sender].netChanProcessingLimitTime >=
g_pServerLimits->Cvar_net_chan_limit_msec_per_sec->GetInt())
@@ -133,9 +133,9 @@ char, __fastcall, (void* self, void* buf))
g_pServerLimits->Cvar_net_chan_limit_msec_per_sec->GetInt());
// never kick local player
- if (g_pServerLimits->Cvar_net_chan_limit_mode->GetInt() != NETCHANLIMIT_WARN && strcmp(R2::g_pLocalPlayerUserID, sender->m_UID))
+ if (g_pServerLimits->Cvar_net_chan_limit_mode->GetInt() != NETCHANLIMIT_WARN && strcmp(g_pLocalPlayerUserID, sender->m_UID))
{
- R2::CBaseClient__Disconnect(sender, 1, "Exceeded net channel processing limit");
+ CBaseClient__Disconnect(sender, 1, "Exceeded net channel processing limit");
return false;
}
}
@@ -144,12 +144,12 @@ char, __fastcall, (void* self, void* buf))
return ret;
}
-bool ServerLimitsManager::CheckConnectionlessPacketLimits(R2::netpacket_t* packet)
+bool ServerLimitsManager::CheckConnectionlessPacketLimits(netpacket_t* packet)
{
- static const ConVar* Cvar_net_data_block_enabled = R2::g_pCVar->FindVar("net_data_block_enabled");
+ static const ConVar* Cvar_net_data_block_enabled = g_pCVar->FindVar("net_data_block_enabled");
// don't ratelimit datablock packets as long as datablock is enabled
- if (packet->adr.type == R2::NA_IP &&
+ if (packet->adr.type == NA_IP &&
(!(packet->data[4] == 'N' && Cvar_net_data_block_enabled->GetBool()) || !Cvar_net_data_block_enabled->GetBool()))
{
// bad lookup: optimise later tm
@@ -169,12 +169,12 @@ bool ServerLimitsManager::CheckConnectionlessPacketLimits(R2::netpacket_t* packe
memcpy(sendData->ip, packet->adr.ip, 16);
}
- if (Tier0::Plat_FloatTime() < sendData->timeoutEnd)
+ if (Plat_FloatTime() < sendData->timeoutEnd)
return false;
- if (Tier0::Plat_FloatTime() - sendData->lastQuotaStart >= 1.0)
+ if (Plat_FloatTime() - sendData->lastQuotaStart >= 1.0)
{
- sendData->lastQuotaStart = Tier0::Plat_FloatTime();
+ sendData->lastQuotaStart = Plat_FloatTime();
sendData->packetCount = 0;
}
@@ -188,7 +188,7 @@ bool ServerLimitsManager::CheckConnectionlessPacketLimits(R2::netpacket_t* packe
packet->data[4]);
// timeout for a minute
- sendData->timeoutEnd = Tier0::Plat_FloatTime() + 60.0;
+ sendData->timeoutEnd = Plat_FloatTime() + 60.0;
return false;
}
}
@@ -232,12 +232,12 @@ struct alignas(4) SV_CUserCmd
// clang-format off
AUTOHOOK(CPlayerMove__RunCommand, server.dll + 0x5B8100,
-void, __fastcall, (void* self, R2::CBasePlayer* player, SV_CUserCmd* pUserCmd, uint64_t a4))
+void, __fastcall, (void* self, CBasePlayer* player, SV_CUserCmd* pUserCmd, uint64_t a4))
// clang-format on
{
if (g_pServerLimits->Cvar_sv_antispeedhack_enable->GetBool())
{
- R2::CBaseClient* pClient = &R2::g_pClientArray[player->m_nPlayerIndex - 1];
+ CBaseClient* pClient = &g_pClientArray[player->m_nPlayerIndex - 1];
if (g_pServerLimits->m_PlayerLimitData.find(pClient) != g_pServerLimits->m_PlayerLimitData.end())
{
diff --git a/NorthstarDLL/shared/exploit_fixes/ns_limits.h b/NorthstarDLL/shared/exploit_fixes/ns_limits.h
index d1f7f2ed..a2cc431f 100644
--- a/NorthstarDLL/shared/exploit_fixes/ns_limits.h
+++ b/NorthstarDLL/shared/exploit_fixes/ns_limits.h
@@ -37,16 +37,16 @@ class ServerLimitsManager
ConVar* Cvar_sv_antispeedhack_maxtickbudget;
ConVar* Cvar_sv_antispeedhack_budgetincreasemultiplier;
- std::unordered_map<R2::CBaseClient*, PlayerLimitData> m_PlayerLimitData;
+ std::unordered_map<CBaseClient*, PlayerLimitData> m_PlayerLimitData;
std::vector<UnconnectedPlayerLimitData> m_UnconnectedPlayerLimitData;
public:
void RunFrame(double flCurrentTime, float flFrameTime);
- void AddPlayer(R2::CBaseClient* player);
- void RemovePlayer(R2::CBaseClient* player);
- bool CheckStringCommandLimits(R2::CBaseClient* player);
- bool CheckChatLimits(R2::CBaseClient* player);
- bool CheckConnectionlessPacketLimits(R2::netpacket_t* packet);
+ void AddPlayer(CBaseClient* player);
+ void RemovePlayer(CBaseClient* player);
+ bool CheckStringCommandLimits(CBaseClient* player);
+ bool CheckChatLimits(CBaseClient* player);
+ bool CheckConnectionlessPacketLimits(netpacket_t* packet);
};
extern ServerLimitsManager* g_pServerLimits;
diff --git a/NorthstarDLL/shared/maxplayers.cpp b/NorthstarDLL/shared/maxplayers.cpp
index 4af8ea1c..711193d4 100644
--- a/NorthstarDLL/shared/maxplayers.cpp
+++ b/NorthstarDLL/shared/maxplayers.cpp
@@ -48,21 +48,17 @@ constexpr int Team_AddedSize = Team_PlayerArray_AddedSize;
bool MaxPlayersIncreaseEnabled()
{
- static bool bMaxPlayersIncreaseEnabled = Tier0::CommandLine()->CheckParm("-experimentalmaxplayersincrease");
+ static bool bMaxPlayersIncreaseEnabled = CommandLine()->CheckParm("-experimentalmaxplayersincrease");
return bMaxPlayersIncreaseEnabled;
}
-// should we use R2 for this? not sure
-namespace R2 // use R2 namespace for game funcs
+int GetMaxPlayers()
{
- int GetMaxPlayers()
- {
- if (MaxPlayersIncreaseEnabled())
- return NEW_MAX_PLAYERS;
+ if (MaxPlayersIncreaseEnabled())
+ return NEW_MAX_PLAYERS;
- return 32;
- }
-} // namespace R2
+ return 32;
+}
template <class T> void ChangeOffset(CMemoryAddress addr, unsigned int offset)
{
diff --git a/NorthstarDLL/shared/maxplayers.h b/NorthstarDLL/shared/maxplayers.h
index b251f6a6..40a3ac58 100644
--- a/NorthstarDLL/shared/maxplayers.h
+++ b/NorthstarDLL/shared/maxplayers.h
@@ -1,7 +1,3 @@
#pragma once
-// should we use R2 for this? not sure
-namespace R2 // use R2 namespace for game funcs
-{
- int GetMaxPlayers();
-} // namespace R2
+int GetMaxPlayers();
diff --git a/NorthstarDLL/shared/misccommands.cpp b/NorthstarDLL/shared/misccommands.cpp
index 5d9ced99..15da6767 100644
--- a/NorthstarDLL/shared/misccommands.cpp
+++ b/NorthstarDLL/shared/misccommands.cpp
@@ -15,21 +15,21 @@ void ConCommand_force_newgame(const CCommand& arg)
if (arg.ArgC() < 2)
return;
- R2::g_pHostState->m_iNextState = R2::HostState_t::HS_NEW_GAME;
- strncpy(R2::g_pHostState->m_levelName, arg.Arg(1), sizeof(R2::g_pHostState->m_levelName));
+ g_pHostState->m_iNextState = HostState_t::HS_NEW_GAME;
+ strncpy(g_pHostState->m_levelName, arg.Arg(1), sizeof(g_pHostState->m_levelName));
}
void ConCommand_ns_start_reauth_and_leave_to_lobby(const CCommand& arg)
{
// hack for special case where we're on a local server, so we erase our own newly created auth data on disconnect
g_pMasterServerManager->m_bNewgameAfterSelfAuth = true;
- g_pMasterServerManager->AuthenticateWithOwnServer(R2::g_pLocalPlayerUserID, g_pMasterServerManager->m_sOwnClientAuthToken);
+ g_pMasterServerManager->AuthenticateWithOwnServer(g_pLocalPlayerUserID, g_pMasterServerManager->m_sOwnClientAuthToken);
}
void ConCommand_ns_end_reauth_and_leave_to_lobby(const CCommand& arg)
{
if (g_pServerAuthentication->m_RemoteAuthenticationData.size())
- R2::g_pCVar->FindVar("serverfilter")->SetValue(g_pServerAuthentication->m_RemoteAuthenticationData.begin()->first.c_str());
+ g_pCVar->FindVar("serverfilter")->SetValue(g_pServerAuthentication->m_RemoteAuthenticationData.begin()->first.c_str());
// weird way of checking, but check if client script vm is initialised, mainly just to allow players to cancel this
if (g_pSquirrel<ScriptContext::CLIENT>->m_pSQVM)
@@ -39,8 +39,8 @@ void ConCommand_ns_end_reauth_and_leave_to_lobby(const CCommand& arg)
// this won't set playlist correctly on remote clients, don't think they can set playlist until they've left which sorta
// fucks things should maybe set this in HostState_NewGame?
R2::SetCurrentPlaylist("tdm");
- strcpy(R2::g_pHostState->m_levelName, "mp_lobby");
- R2::g_pHostState->m_iNextState = R2::HostState_t::HS_NEW_GAME;
+ strcpy(g_pHostState->m_levelName, "mp_lobby");
+ g_pHostState->m_iNextState = HostState_t::HS_NEW_GAME;
}
}
@@ -52,7 +52,7 @@ void ConCommand_cvar_setdefaultvalue(const CCommand& arg)
return;
}
- ConVar* pCvar = R2::g_pCVar->FindVar(arg.Arg(1));
+ ConVar* pCvar = g_pCVar->FindVar(arg.Arg(1));
if (!pCvar)
{
spdlog::info("usage: cvar_setdefaultvalue mp_gamemode tdm");
@@ -75,7 +75,7 @@ void ConCommand_cvar_setvalueanddefaultvalue(const CCommand& arg)
return;
}
- ConVar* pCvar = R2::g_pCVar->FindVar(arg.Arg(1));
+ ConVar* pCvar = g_pCVar->FindVar(arg.Arg(1));
if (!pCvar)
{
spdlog::info("usage: cvar_setvalueanddefaultvalue mp_gamemode tdm");
@@ -99,7 +99,7 @@ void ConCommand_cvar_reset(const CCommand& arg)
return;
}
- ConVar* pCvar = R2::g_pCVar->FindVar(arg.Arg(1));
+ ConVar* pCvar = g_pCVar->FindVar(arg.Arg(1));
if (!pCvar)
{
spdlog::info("usage: cvar_reset mp_gamemode");
@@ -143,11 +143,11 @@ void AddMiscConCommands()
// fixes up various cvar flags to have more sane values
void FixupCvarFlags()
{
- if (Tier0::CommandLine()->CheckParm("-allowdevcvars"))
+ if (CommandLine()->CheckParm("-allowdevcvars"))
{
// strip hidden and devonly cvar flags
int iNumCvarsAltered = 0;
- for (auto& pair : R2::g_pCVar->DumpToMap())
+ for (auto& pair : g_pCVar->DumpToMap())
{
// strip flags
int flags = pair.second->GetFlags();
@@ -177,7 +177,7 @@ void FixupCvarFlags()
int i = 0;
do
{
- ConCommandBase* pCommand = R2::g_pCVar->FindCommandBase(ppEngineClientCommands[i]);
+ ConCommandBase* pCommand = g_pCVar->FindCommandBase(ppEngineClientCommands[i]);
if (pCommand) // not all the commands in this array actually exist in respawn source
pCommand->m_nFlags |= FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS;
} while (ppEngineClientCommands[++i]);
@@ -367,21 +367,21 @@ void FixupCvarFlags()
for (auto& fixup : CVAR_FIXUP_ADD_FLAGS)
{
- ConCommandBase* command = R2::g_pCVar->FindCommandBase(std::get<0>(fixup));
+ ConCommandBase* command = g_pCVar->FindCommandBase(std::get<0>(fixup));
if (command)
command->m_nFlags |= std::get<1>(fixup);
}
for (auto& fixup : CVAR_FIXUP_REMOVE_FLAGS)
{
- ConCommandBase* command = R2::g_pCVar->FindCommandBase(std::get<0>(fixup));
+ ConCommandBase* command = g_pCVar->FindCommandBase(std::get<0>(fixup));
if (command)
command->m_nFlags &= ~std::get<1>(fixup);
}
for (auto& fixup : CVAR_FIXUP_DEFAULT_VALUES)
{
- ConVar* cvar = R2::g_pCVar->FindVar(std::get<0>(fixup));
+ ConVar* cvar = g_pCVar->FindVar(std::get<0>(fixup));
if (cvar && !strcmp(cvar->GetString(), cvar->m_pszDefaultValue))
{
cvar->SetValue(std::get<1>(fixup));
diff --git a/NorthstarDLL/shared/playlist.cpp b/NorthstarDLL/shared/playlist.cpp
index ab7aab22..2b9ad979 100644
--- a/NorthstarDLL/shared/playlist.cpp
+++ b/NorthstarDLL/shared/playlist.cpp
@@ -26,7 +26,7 @@ char, __fastcall, (void* a1, void* a2))
{
// the private_match playlist on mp_lobby is the only situation where there should be any legitimate sending of this netmessage
if (!Cvar_ns_use_clc_SetPlaylistVarOverride->GetBool() || strcmp(R2::GetCurrentPlaylistName(), "private_match") ||
- strcmp(R2::g_pGlobals->m_pMapName, "mp_lobby"))
+ strcmp(g_pGlobals->m_pMapName, "mp_lobby"))
return 1;
return clc_SetPlaylistVarOverride__Process(a1, a2);