aboutsummaryrefslogtreecommitdiff
path: root/primedev/engine/r2engine.cpp
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2023-12-27 00:32:01 +0000
committerGitHub <noreply@github.com>2023-12-27 01:32:01 +0100
commitf5ab6fb5e8be7b73e6003d4145081d5e0c0ce287 (patch)
tree90f2c6a4885dbd181799e2325cf33588697674e1 /primedev/engine/r2engine.cpp
parentbb8ed59f6891b1196c5f5bbe7346cd171c8215fa (diff)
downloadNorthstarLauncher-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 'primedev/engine/r2engine.cpp')
-rw-r--r--primedev/engine/r2engine.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/primedev/engine/r2engine.cpp b/primedev/engine/r2engine.cpp
new file mode 100644
index 00000000..88500376
--- /dev/null
+++ b/primedev/engine/r2engine.cpp
@@ -0,0 +1,37 @@
+#include "r2engine.h"
+
+Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer;
+Cbuf_AddTextType Cbuf_AddText;
+Cbuf_ExecuteType Cbuf_Execute;
+
+bool (*CCommand__Tokenize)(CCommand& self, const char* pCommandString, cmd_source_t commandSource);
+
+CEngine* g_pEngine;
+
+void (*CBaseClient__Disconnect)(void* self, uint32_t unknownButAlways1, const char* reason, ...);
+CBaseClient* g_pClientArray;
+
+server_state_t* g_pServerState;
+
+char* g_pModName =
+ nullptr; // we cant set this up here atm since we dont have an offset to it in engine, instead we store it in IsRespawnMod
+
+CGlobalVars* g_pGlobals;
+
+ON_DLL_LOAD("engine.dll", R2Engine, (CModule module))
+{
+ Cbuf_GetCurrentPlayer = module.Offset(0x120630).RCast<Cbuf_GetCurrentPlayerType>();
+ Cbuf_AddText = module.Offset(0x1203B0).RCast<Cbuf_AddTextType>();
+ Cbuf_Execute = module.Offset(0x1204B0).RCast<Cbuf_ExecuteType>();
+
+ CCommand__Tokenize = module.Offset(0x418380).RCast<bool (*)(CCommand&, const char*, cmd_source_t)>();
+
+ g_pEngine = module.Offset(0x7D70C8).Deref().RCast<CEngine*>();
+
+ CBaseClient__Disconnect = module.Offset(0x1012C0).RCast<void (*)(void*, uint32_t, const char*, ...)>();
+ g_pClientArray = module.Offset(0x12A53F90).RCast<CBaseClient*>();
+
+ g_pServerState = module.Offset(0x12A53D48).RCast<server_state_t*>();
+
+ g_pGlobals = module.Offset(0x7C6F70).RCast<CGlobalVars*>();
+}