diff options
author | Emma Miler <emma.pi@protonmail.com> | 2022-12-19 19:32:16 +0100 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-01-04 14:45:48 +0100 |
commit | 27afb0ba38dcf0e74a4d09ba43e73261542b8e96 (patch) | |
tree | 28c737bdecc761fc8ca5257adfafaf2b325e1918 /NorthstarDLL/engine/host.cpp | |
parent | af64117f09ba9b70d27c6b6da885d0474180849b (diff) | |
download | NorthstarLauncher-27afb0ba38dcf0e74a4d09ba43e73261542b8e96.tar.gz NorthstarLauncher-27afb0ba38dcf0e74a4d09ba43e73261542b8e96.zip |
Restructuring (#365)
* Remove launcher proxy
* Restructuring
* More restructuring
* Fix include dirs
* Fix merge
* Remove clang thing
* Filters
* Oops
Diffstat (limited to 'NorthstarDLL/engine/host.cpp')
-rw-r--r-- | NorthstarDLL/engine/host.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/NorthstarDLL/engine/host.cpp b/NorthstarDLL/engine/host.cpp new file mode 100644 index 00000000..a55c8dfd --- /dev/null +++ b/NorthstarDLL/engine/host.cpp @@ -0,0 +1,31 @@ +#include "pch.h" +#include "core/convar/convar.h" +#include "mods/modmanager.h" +#include "util/printcommands.h" +#include "util/printmaps.h" +#include "shared/misccommands.h" +#include "r2engine.h" +#include "core/tier0.h" +AUTOHOOK_INIT() +// clang-format off +AUTOHOOK(Host_Init, engine.dll + 0x155EA0, +void, __fastcall, (bool bDedicated)) +// clang-format on +{ + spdlog::info("Host_Init()"); + Host_Init(bDedicated); + FixupCvarFlags(); + // need to initialise these after host_init since they do stuff to preexisting concommands/convars without being client/server specific + InitialiseCommandPrint(); + InitialiseMapsPrint(); + // client/server autoexecs on necessary platforms + // dedi needs autoexec_ns_server on boot, while non-dedi will run it on on listen server start + if (bDedicated) + R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "exec autoexec_ns_server", R2::cmd_source_t::kCommandSrcCode); + else + R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "exec autoexec_ns_client", R2::cmd_source_t::kCommandSrcCode); +} +ON_DLL_LOAD("engine.dll", Host_Init, (CModule module)) +{ + AUTOHOOK_DISPATCH() +} |