diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-07-18 00:00:39 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-07-18 00:00:39 +0100 |
commit | b0bef05111a95a4cce6250d2b79e2aa5baa6dd98 (patch) | |
tree | 5bdc39717bebfc437adf8683405d58d97e1f43b2 /NorthstarDLL/limits.cpp | |
parent | 6ae30c9b15fcc200c7b642016e7adbfdf9b979f4 (diff) | |
download | NorthstarLauncher-b0bef05111a95a4cce6250d2b79e2aa5baa6dd98.tar.gz NorthstarLauncher-b0bef05111a95a4cce6250d2b79e2aa5baa6dd98.zip |
use modular ServerPresence system for registering servers
Diffstat (limited to 'NorthstarDLL/limits.cpp')
-rw-r--r-- | NorthstarDLL/limits.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/NorthstarDLL/limits.cpp b/NorthstarDLL/limits.cpp index 051ed8f8..60c04e16 100644 --- a/NorthstarDLL/limits.cpp +++ b/NorthstarDLL/limits.cpp @@ -12,13 +12,13 @@ ServerLimitsManager* g_pServerLimits; ConVar* Cvar_net_datablock_enabled;
-void ServerLimitsManager::AddPlayer(R2::CBasePlayer* player)
+void ServerLimitsManager::AddPlayer(R2::CBaseClient* player)
{
PlayerLimitData limitData;
m_PlayerLimitData.insert(std::make_pair(player, limitData));
}
-bool ServerLimitsManager::CheckStringCommandLimits(R2::CBasePlayer* player)
+bool ServerLimitsManager::CheckStringCommandLimits(R2::CBaseClient* player)
{
if (CVar_sv_quota_stringcmdspersecond->GetInt() != -1)
{
@@ -42,7 +42,7 @@ bool ServerLimitsManager::CheckStringCommandLimits(R2::CBasePlayer* player) return true;
}
-bool ServerLimitsManager::CheckChatLimits(R2::CBasePlayer* player)
+bool ServerLimitsManager::CheckChatLimits(R2::CBaseClient* player)
{
if (Tier0::Plat_FloatTime() - m_PlayerLimitData[player].lastSayTextLimitStart >= 1.0)
{
@@ -57,7 +57,8 @@ bool ServerLimitsManager::CheckChatLimits(R2::CBasePlayer* player) return true;
}
-AUTOHOOK(CNetChan__ProcessMessages, engine.dll + 0x2140A0, char, __fastcall, (void* self, void* buf))
+AUTOHOOK(CNetChan__ProcessMessages, engine.dll + 0x2140A0,
+char, __fastcall, (void* self, void* buf))
{
enum eNetChanLimitMode
{
@@ -72,7 +73,7 @@ AUTOHOOK(CNetChan__ProcessMessages, engine.dll + 0x2140A0, char, __fastcall, (vo if (R2::g_pHostState->m_iCurrentState == R2::HostState_t::HS_RUN && Tier0::ThreadInServerFrameThread())
{
// player that sent the message
- R2::CBasePlayer* sender = *(R2::CBasePlayer**)((char*)self + 368);
+ R2::CBaseClient* sender = *(R2::CBaseClient**)((char*)self + 368);
// if no sender, return
// relatively certain this is fine?
@@ -111,7 +112,8 @@ AUTOHOOK(CNetChan__ProcessMessages, engine.dll + 0x2140A0, char, __fastcall, (vo return ret;
}
-AUTOHOOK(ProcessConnectionlessPacket, engine.dll + 0x117800, bool, , (void* a1, R2::netpacket_t* packet))
+AUTOHOOK(ProcessConnectionlessPacket, engine.dll + 0x117800,
+bool, , (void* a1, R2::netpacket_t* packet))
{
if (packet->adr.type == R2::NA_IP &&
(!(packet->data[4] == 'N' && Cvar_net_datablock_enabled->GetBool()) || !Cvar_net_datablock_enabled->GetBool()))
|