diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2023-12-27 00:32:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 01:32:01 +0100 |
commit | f5ab6fb5e8be7b73e6003d4145081d5e0c0ce287 (patch) | |
tree | 90f2c6a4885dbd181799e2325cf33588697674e1 /NorthstarDLL/server/alltalk.cpp | |
parent | bb8ed59f6891b1196c5f5bbe7346cd171c8215fa (diff) | |
download | NorthstarLauncher-f5ab6fb5e8be7b73e6003d4145081d5e0c0ce287.tar.gz NorthstarLauncher-f5ab6fb5e8be7b73e6003d4145081d5e0c0ce287.zip |
Folder restructuring from primedev (#624)v1.21.2-rc3v1.21.2
Copies of over the primedev folder structure for easier cherry-picking of further changes
Co-authored-by: F1F7Y <filip.bartos07@proton.me>
Diffstat (limited to 'NorthstarDLL/server/alltalk.cpp')
-rw-r--r-- | NorthstarDLL/server/alltalk.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/NorthstarDLL/server/alltalk.cpp b/NorthstarDLL/server/alltalk.cpp deleted file mode 100644 index 74119309..00000000 --- a/NorthstarDLL/server/alltalk.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "core/convar/convar.h" -#include "engine/r2engine.h" - -size_t __fastcall ShouldAllowAlltalk() -{ - // this needs to return a 64 bit integer where 0 = true and 1 = false - static ConVar* Cvar_sv_alltalk = g_pCVar->FindVar("sv_alltalk"); - if (Cvar_sv_alltalk->GetBool()) - return 0; - - // lobby should default to alltalk, otherwise don't allow it - return strcmp(g_pGlobals->m_pMapName, "mp_lobby"); -} - -ON_DLL_LOAD_RELIESON("engine.dll", ServerAllTalk, ConVar, (CModule module)) -{ - // replace strcmp function called in CClient::ProcessVoiceData with our own code that calls ShouldAllowAllTalk - 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 - uint64_t pShouldAllowAllTalk = reinterpret_cast<uint64_t>(ShouldAllowAlltalk); - base.Offset(0x2).Patch((uint8_t*)&pShouldAllowAllTalk, 8); - base.Offset(0xA).Patch("FF D0"); // call rax - - // nop until compare (test eax, eax) - base.Offset(0xC).NOP(0x7); -} |