aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/server
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/server
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/server')
-rw-r--r--NorthstarDLL/server/alltalk.cpp2
-rw-r--r--NorthstarDLL/server/auth/serverauthentication.cpp2
-rw-r--r--NorthstarDLL/server/buildainfile.cpp8
-rw-r--r--NorthstarDLL/server/r2server.cpp4
-rw-r--r--NorthstarDLL/server/serverchathooks.cpp26
-rw-r--r--NorthstarDLL/server/serverpresence.cpp2
6 files changed, 22 insertions, 22 deletions
diff --git a/NorthstarDLL/server/alltalk.cpp b/NorthstarDLL/server/alltalk.cpp
index 6283a1a2..d71b0bae 100644
--- a/NorthstarDLL/server/alltalk.cpp
+++ b/NorthstarDLL/server/alltalk.cpp
@@ -15,7 +15,7 @@ size_t __fastcall ShouldAllowAlltalk()
ON_DLL_LOAD_RELIESON("engine.dll", ServerAllTalk, ConVar, (CModule module))
{
// replace strcmp function called in CClient::ProcessVoiceData with our own code that calls ShouldAllowAllTalk
- MemoryAddress base = module.Offset(0x1085FA);
+ CMemoryAddress base = module.Offset(0x1085FA);
base.Patch("48 B8"); // mov rax, 64 bit int
// (uint8_t*)&ShouldAllowAlltalk doesn't work for some reason? need to make it a uint64 first
diff --git a/NorthstarDLL/server/auth/serverauthentication.cpp b/NorthstarDLL/server/auth/serverauthentication.cpp
index 8f62e1dd..d5653dcc 100644
--- a/NorthstarDLL/server/auth/serverauthentication.cpp
+++ b/NorthstarDLL/server/auth/serverauthentication.cpp
@@ -368,7 +368,7 @@ ON_DLL_LOAD_RELIESON("engine.dll", ServerAuthentication, (ConCommand, ConVar), (
// patch to disable fairfight marking players as cheaters and kicking them
module.Offset(0x101012).Patch("E9 90 00");
- CBaseServer__RejectConnection = module.Offset(0x1182E0).As<CBaseServer__RejectConnectionType>();
+ CBaseServer__RejectConnection = module.Offset(0x1182E0).RCast<CBaseServer__RejectConnectionType>();
if (Tier0::CommandLine()->CheckParm("-allowdupeaccounts"))
{
diff --git a/NorthstarDLL/server/buildainfile.cpp b/NorthstarDLL/server/buildainfile.cpp
index 848d8569..d0143295 100644
--- a/NorthstarDLL/server/buildainfile.cpp
+++ b/NorthstarDLL/server/buildainfile.cpp
@@ -388,8 +388,8 @@ ON_DLL_LOAD("server.dll", BuildAINFile, (CModule module))
Cvar_ns_ai_dumpAINfileFromLoad = new ConVar(
"ns_ai_dumpAINfileFromLoad", "0", FCVAR_NONE, "For debugging: whether we should dump ain data for ains loaded from disk");
- pUnkStruct0Count = module.Offset(0x1063BF8).As<int*>();
- pppUnkNodeStruct0s = module.Offset(0x1063BE0).As<UnkNodeStruct0***>();
- pUnkLinkStruct1Count = module.Offset(0x1063AA8).As<int*>();
- pppUnkStruct1s = module.Offset(0x1063A90).As<UnkLinkStruct1***>();
+ pUnkStruct0Count = module.Offset(0x1063BF8).RCast<int*>();
+ pppUnkNodeStruct0s = module.Offset(0x1063BE0).RCast<UnkNodeStruct0***>();
+ pUnkLinkStruct1Count = module.Offset(0x1063AA8).RCast<int*>();
+ pppUnkStruct1s = module.Offset(0x1063A90).RCast<UnkLinkStruct1***>();
}
diff --git a/NorthstarDLL/server/r2server.cpp b/NorthstarDLL/server/r2server.cpp
index a8aa84ce..cf7add0d 100644
--- a/NorthstarDLL/server/r2server.cpp
+++ b/NorthstarDLL/server/r2server.cpp
@@ -11,6 +11,6 @@ namespace R2
ON_DLL_LOAD("server.dll", R2GameServer, (CModule module))
{
- Server_GetEntityByIndex = module.Offset(0xFB820).As<CBaseEntity* (*)(int)>();
- UTIL_PlayerByIndex = module.Offset(0x26AA10).As<CBasePlayer*(__fastcall*)(int)>();
+ Server_GetEntityByIndex = module.Offset(0xFB820).RCast<CBaseEntity* (*)(int)>();
+ UTIL_PlayerByIndex = module.Offset(0x26AA10).RCast<CBasePlayer*(__fastcall*)(int)>();
}
diff --git a/NorthstarDLL/server/serverchathooks.cpp b/NorthstarDLL/server/serverchathooks.cpp
index 96765697..cb3af244 100644
--- a/NorthstarDLL/server/serverchathooks.cpp
+++ b/NorthstarDLL/server/serverchathooks.cpp
@@ -151,7 +151,7 @@ ADD_SQFUNC(
ON_DLL_LOAD("engine.dll", EngineServerChatHooks, (CModule module))
{
- g_pServerGameDLL = module.Offset(0x13F0AA98).As<CServerGameDLL*>();
+ g_pServerGameDLL = module.Offset(0x13F0AA98).RCast<CServerGameDLL*>();
}
ON_DLL_LOAD_RELIESON("server.dll", ServerChatHooks, ServerSquirrel, (CModule module))
@@ -159,16 +159,16 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerChatHooks, ServerSquirrel, (CModule mod
AUTOHOOK_DISPATCH_MODULE(server.dll)
CServerGameDLL__OnReceivedSayTextMessage =
- module.Offset(0x1595C0).As<void(__fastcall*)(CServerGameDLL*, unsigned int, const char*, int)>();
- CRecipientFilter__Construct = module.Offset(0x1E9440).As<void(__fastcall*)(CRecipientFilter*)>();
- CRecipientFilter__Destruct = module.Offset(0x1E9700).As<void(__fastcall*)(CRecipientFilter*)>();
- CRecipientFilter__AddAllPlayers = module.Offset(0x1E9940).As<void(__fastcall*)(CRecipientFilter*)>();
- CRecipientFilter__AddRecipient = module.Offset(0x1E9B30).As<void(__fastcall*)(CRecipientFilter*, const R2::CBasePlayer*)>();
- CRecipientFilter__MakeReliable = module.Offset(0x1EA4E0).As<void(__fastcall*)(CRecipientFilter*)>();
-
- UserMessageBegin = module.Offset(0x15C520).As<void(__fastcall*)(CRecipientFilter*, const char*)>();
- MessageEnd = module.Offset(0x158880).As<void(__fastcall*)()>();
- MessageWriteByte = module.Offset(0x158A90).As<void(__fastcall*)(int)>();
- MessageWriteString = module.Offset(0x158D00).As<void(__fastcall*)(const char*)>();
- MessageWriteBool = module.Offset(0x158A00).As<void(__fastcall*)(bool)>();
+ module.Offset(0x1595C0).RCast<void(__fastcall*)(CServerGameDLL*, unsigned int, const char*, int)>();
+ CRecipientFilter__Construct = module.Offset(0x1E9440).RCast<void(__fastcall*)(CRecipientFilter*)>();
+ CRecipientFilter__Destruct = module.Offset(0x1E9700).RCast<void(__fastcall*)(CRecipientFilter*)>();
+ CRecipientFilter__AddAllPlayers = module.Offset(0x1E9940).RCast<void(__fastcall*)(CRecipientFilter*)>();
+ CRecipientFilter__AddRecipient = module.Offset(0x1E9B30).RCast<void(__fastcall*)(CRecipientFilter*, const R2::CBasePlayer*)>();
+ CRecipientFilter__MakeReliable = module.Offset(0x1EA4E0).RCast<void(__fastcall*)(CRecipientFilter*)>();
+
+ UserMessageBegin = module.Offset(0x15C520).RCast<void(__fastcall*)(CRecipientFilter*, const char*)>();
+ MessageEnd = module.Offset(0x158880).RCast<void(__fastcall*)()>();
+ MessageWriteByte = module.Offset(0x158A90).RCast<void(__fastcall*)(int)>();
+ MessageWriteString = module.Offset(0x158D00).RCast<void(__fastcall*)(const char*)>();
+ MessageWriteBool = module.Offset(0x158A00).RCast<void(__fastcall*)(bool)>();
}
diff --git a/NorthstarDLL/server/serverpresence.cpp b/NorthstarDLL/server/serverpresence.cpp
index 945f5810..ed9185c1 100644
--- a/NorthstarDLL/server/serverpresence.cpp
+++ b/NorthstarDLL/server/serverpresence.cpp
@@ -224,5 +224,5 @@ void ServerPresenceManager::SetPlayerCount(const int iPlayerCount)
ON_DLL_LOAD_RELIESON("engine.dll", ServerPresence, ConVar, (CModule module))
{
g_pServerPresence->CreateConVars();
- Cvar_hostname = module.Offset(0x1315BAE8).Deref().As<ConVar*>();
+ Cvar_hostname = module.Offset(0x1315BAE8).Deref().RCast<ConVar*>();
}