aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/maxplayers.cpp
diff options
context:
space:
mode:
authorNorthstar <northstar@northstar.tf>2022-04-13 19:29:44 -0300
committerBarichello <artur@barichello.me>2022-04-13 19:30:40 -0300
commit47ea109be0d73120ddfe6896494e1fce986515b3 (patch)
treefb440b3ab2a00bf506182a9c9a9500d1c4711e0c /NorthstarDedicatedTest/maxplayers.cpp
parent04b0b417d1c9f45a708d3e2eec9146fabe09c1d1 (diff)
downloadNorthstarLauncher-47ea109be0d73120ddfe6896494e1fce986515b3.tar.gz
NorthstarLauncher-47ea109be0d73120ddfe6896494e1fce986515b3.zip
Format project
Diffstat (limited to 'NorthstarDedicatedTest/maxplayers.cpp')
-rw-r--r--NorthstarDedicatedTest/maxplayers.cpp58
1 files changed, 33 insertions, 25 deletions
diff --git a/NorthstarDedicatedTest/maxplayers.cpp b/NorthstarDedicatedTest/maxplayers.cpp
index 9550553c..32f3b2ec 100644
--- a/NorthstarDedicatedTest/maxplayers.cpp
+++ b/NorthstarDedicatedTest/maxplayers.cpp
@@ -9,7 +9,7 @@
#define PAD_NUMBER(number, boundary) (((number) + ((boundary)-1)) / (boundary)) * (boundary)
// this is horrible
-constexpr int PlayerResource_Name_Start = 0; // Start of modded allocated space.
+constexpr int PlayerResource_Name_Start = 0; // Start of modded allocated space.
constexpr int PlayerResource_Name_Size = ((NEW_MAX_PLAYERS + 1) * 8); // const char* m_szName[MAX_PLAYERS + 1];
constexpr int PlayerResource_Ping_Start = PlayerResource_Name_Start + PlayerResource_Name_Size;
@@ -46,7 +46,10 @@ constexpr int Team_PlayerArray_AddedSize = PAD_NUMBER(Team_PlayerArray_AddedLeng
constexpr int Team_AddedSize = Team_PlayerArray_AddedSize;
#include "NSMem.h"
-template <class T> void ChangeOffset(void* addr, unsigned int offset) { NSMem::BytePatch((uintptr_t)addr, (BYTE*)&offset, sizeof(T)); }
+template <class T> void ChangeOffset(void* addr, unsigned int offset)
+{
+ NSMem::BytePatch((uintptr_t)addr, (BYTE*)&offset, sizeof(T));
+}
/*
typedef bool(*MatchRecvPropsToSendProps_R_Type)(__int64 lookup, __int64 tableNameBroken, __int64 sendTable, __int64 recvTable);
@@ -100,7 +103,10 @@ void* StringTables_CreateStringTable_Hook(
return StringTables_CreateStringTable_Original(thisptr, name, maxentries, userdatafixedsize, userdatanetworkbits, flags);
}
-bool MaxPlayersIncreaseEnabled() { return CommandLine() && CommandLine()->CheckParm("-experimentalmaxplayersincrease"); }
+bool MaxPlayersIncreaseEnabled()
+{
+ return CommandLine() && CommandLine()->CheckParm("-experimentalmaxplayersincrease");
+}
void InitialiseMaxPlayersOverride_Engine(HMODULE baseAddress)
{
@@ -148,7 +154,9 @@ void InitialiseMaxPlayersOverride_Engine(HMODULE baseAddress)
// &DataTable_SetupReceiveTableFromSendTable_Hook, reinterpret_cast<LPVOID*>(&DataTable_SetupReceiveTableFromSendTable_Original));
ENABLER_CREATEHOOK(
- hook, (char*)baseAddress + 0x22E220, &StringTables_CreateStringTable_Hook,
+ hook,
+ (char*)baseAddress + 0x22E220,
+ &StringTables_CreateStringTable_Hook,
reinterpret_cast<LPVOID*>(&StringTables_CreateStringTable_Original));
}
@@ -161,27 +169,27 @@ auto RandomIntZeroMax = (__int64(__fastcall*)())0;
// lazy rebuild
void RunUserCmds_Hook(bool a1, float a2)
{
- unsigned char v3; // bl
- int v5; // er14
- int i; // edi
- __int64 v7; // rax
- DWORD* v8; // rbx
- int v9; // edi
- __int64* v10; // rsi
- __int64 v11; // rax
- int v12; // er12
- __int64 v13; // rdi
- int v14; // ebx
- int v15; // eax
- __int64 v16; // r8
- int v17; // edx
- char v18; // r15
- char v19; // bp
- int v20; // esi
- __int64* v21; // rdi
- __int64 v22; // rcx
- bool v23; // al
- __int64 v24; // rax
+ unsigned char v3; // bl
+ int v5; // er14
+ int i; // edi
+ __int64 v7; // rax
+ DWORD* v8; // rbx
+ int v9; // edi
+ __int64* v10; // rsi
+ __int64 v11; // rax
+ int v12; // er12
+ __int64 v13; // rdi
+ int v14; // ebx
+ int v15; // eax
+ __int64 v16; // r8
+ int v17; // edx
+ char v18; // r15
+ char v19; // bp
+ int v20; // esi
+ __int64* v21; // rdi
+ __int64 v22; // rcx
+ bool v23; // al
+ __int64 v24; // rax
__int64 v25[NEW_MAX_PLAYERS]; // [rsp+20h] [rbp-138h] BYREF
uintptr_t base = (__int64)serverBase;