aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/shared/maxplayers.cpp
diff options
context:
space:
mode:
authorF1F7Y <64418963+F1F7Y@users.noreply.github.com>2023-07-07 12:28:35 +0200
committerGitHub <noreply@github.com>2023-07-07 12:28:35 +0200
commit513705e33f59273c5b463c0da874a0066e8d0589 (patch)
tree76c66af8d46d0cdd864cefcc2ef9a237a80ddb5b /NorthstarDLL/shared/maxplayers.cpp
parent043fb83d8febc9d277064d5b24e60832375a110f (diff)
downloadNorthstarLauncher-513705e33f59273c5b463c0da874a0066e8d0589.tar.gz
NorthstarLauncher-513705e33f59273c5b463c0da874a0066e8d0589.zip
Memory class renaming (#469)
- Renames `MemoryAddress` to `CMemoryAddress` - Renames `CMemoryAddress::As` to `CMemoryAddress::RCast`
Diffstat (limited to 'NorthstarDLL/shared/maxplayers.cpp')
-rw-r--r--NorthstarDLL/shared/maxplayers.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/NorthstarDLL/shared/maxplayers.cpp b/NorthstarDLL/shared/maxplayers.cpp
index dcf4044e..b2a09578 100644
--- a/NorthstarDLL/shared/maxplayers.cpp
+++ b/NorthstarDLL/shared/maxplayers.cpp
@@ -64,7 +64,7 @@ namespace R2 // use R2 namespace for game funcs
}
} // namespace R2
-template <class T> void ChangeOffset(MemoryAddress addr, unsigned int offset)
+template <class T> void ChangeOffset(CMemoryAddress addr, unsigned int offset)
{
addr.Patch((BYTE*)&offset, sizeof(T));
}
@@ -432,8 +432,8 @@ ON_DLL_LOAD("server.dll", MaxPlayersOverride_Server, (CModule module))
ChangeOffset<unsigned int>(module.Offset(0x5C6654 + 3), CPlayerResource_OriginalSize + PlayerResource_KillStats_Start);
ChangeOffset<unsigned int>(module.Offset(0x5C665B + 3), CPlayerResource_OriginalSize + PlayerResource_KillStats_Start);
- *module.Offset(0x14E7390).As<DWORD*>() = 0;
- auto DT_PlayerResource_Construct = module.Offset(0x5C4FE0).As<__int64(__fastcall*)()>();
+ *module.Offset(0x14E7390).RCast<DWORD*>() = 0;
+ auto DT_PlayerResource_Construct = module.Offset(0x5C4FE0).RCast<__int64(__fastcall*)()>();
DT_PlayerResource_Construct();
constexpr int CTeam_OriginalSize = 3336;
@@ -446,8 +446,8 @@ ON_DLL_LOAD("server.dll", MaxPlayersOverride_Server, (CModule module))
// CTeam::CTeam - increase memset length to clean newly allocated data
ChangeOffset<unsigned int>(module.Offset(0x2395AE + 2), 256 + CTeam_AddedSize);
- *module.Offset(0xC945A0).As<DWORD*>() = 0;
- auto DT_Team_Construct = module.Offset(0x238F50).As<__int64(__fastcall*)()>();
+ *module.Offset(0xC945A0).RCast<DWORD*>() = 0;
+ auto DT_Team_Construct = module.Offset(0x238F50).RCast<__int64(__fastcall*)()>();
DT_Team_Construct();
}
@@ -621,8 +621,8 @@ ON_DLL_LOAD("client.dll", MaxPlayersOverride_Client, (CModule module))
// Some other get name func 2 (that seems to be unused too) - change m_bConnected address
ChangeOffset<unsigned int>(module.Offset(0x164834 + 3), C_PlayerResource_OriginalSize + PlayerResource_Connected_Start);
- *module.Offset(0xC35068).As<DWORD*>() = 0;
- auto DT_PlayerResource_Construct = module.Offset(0x163400).As<__int64(__fastcall*)()>();
+ *module.Offset(0xC35068).RCast<DWORD*>() = 0;
+ auto DT_PlayerResource_Construct = module.Offset(0x163400).RCast<__int64(__fastcall*)()>();
DT_PlayerResource_Construct();
constexpr int C_Team_OriginalSize = 3200;
@@ -638,7 +638,7 @@ ON_DLL_LOAD("client.dll", MaxPlayersOverride_Client, (CModule module))
// DT_Team size
ChangeOffset<unsigned int>(module.Offset(0xC3AA0C), C_Team_ModifiedSize);
- *module.Offset(0xC3AFF8).As<DWORD*>() = 0;
- auto DT_Team_Construct = module.Offset(0x17F950).As<__int64(__fastcall*)()>();
+ *module.Offset(0xC3AFF8).RCast<DWORD*>() = 0;
+ auto DT_Team_Construct = module.Offset(0x17F950).RCast<__int64(__fastcall*)()>();
DT_Team_Construct();
}