aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/demofixes.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-11 17:03:30 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-11 17:03:30 +0100
commitbd4119d0d70567325e7e979a3305f6d631c98dad (patch)
treeabdc1f5121042547e0059d17ec218001126100d6 /NorthstarDedicatedTest/demofixes.cpp
parent8205f96ceb7da38c15ef6f1af30ea1bbbeede1bf (diff)
downloadNorthstarLauncher-bd4119d0d70567325e7e979a3305f6d631c98dad.tar.gz
NorthstarLauncher-bd4119d0d70567325e7e979a3305f6d631c98dad.zip
make cvar print work on dedi, move demo fix stuff, add findflags
Diffstat (limited to 'NorthstarDedicatedTest/demofixes.cpp')
-rw-r--r--NorthstarDedicatedTest/demofixes.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/demofixes.cpp b/NorthstarDedicatedTest/demofixes.cpp
new file mode 100644
index 00000000..0cfb35f4
--- /dev/null
+++ b/NorthstarDedicatedTest/demofixes.cpp
@@ -0,0 +1,25 @@
+#include "pch.h"
+#include "demofixes.h"
+#include "convar.h"
+#include "NSMem.h"
+
+ON_DLL_LOAD_CLIENT_RELIESON("client.dll", DemoFixes, ConVar, [](HMODULE baseAddress)
+{
+ // allow demo recording on loopback
+ NSMem::NOP((uintptr_t)GetModuleHandleA("engine.dll") + 0x8E1B1, 2);
+ NSMem::NOP((uintptr_t)GetModuleHandleA("engine.dll") + 0x56CC3, 2);
+
+ // change default values of demo cvars to enable them by default, but not autorecord
+ // this is before Host_Init, the setvalue calls here will get overwritten by custom cfgs/launch options
+ ConVar* Cvar_demo_enableDemos = g_pCVar->FindVar("demo_enabledemos");
+ Cvar_demo_enableDemos->m_pszDefaultValue = "1";
+ Cvar_demo_enableDemos->SetValue(true);
+
+ ConVar* Cvar_demo_writeLocalFile = g_pCVar->FindVar("demo_writeLocalFile");
+ Cvar_demo_writeLocalFile->m_pszDefaultValue = "1";
+ Cvar_demo_writeLocalFile->SetValue(true);
+
+ ConVar* Cvar_demo_autoRecord = g_pCVar->FindVar("demo_autoRecord");
+ Cvar_demo_autoRecord->m_pszDefaultValue = "0";
+ Cvar_demo_autoRecord->SetValue(false);
+}) \ No newline at end of file