diff options
author | unknown <for.oliver.kirkham@gmail.com> | 2023-02-14 13:34:48 +0000 |
---|---|---|
committer | BobTheBob <for.oliver.kirkham@gmail.com> | 2023-02-22 22:18:57 +0000 |
commit | c57a98a8cab5077a4b0cd9dfd1872306bfb30705 (patch) | |
tree | a38de05f3c392275b29a809f24548303d1eec95c /NorthstarDLL/shared | |
parent | c6c95424345a3065cdcaf86377b414d0da2d6313 (diff) | |
download | NorthstarLauncher-c57a98a8cab5077a4b0cd9dfd1872306bfb30705.tar.gz NorthstarLauncher-c57a98a8cab5077a4b0cd9dfd1872306bfb30705.zip |
temp commit for changing branch
Diffstat (limited to 'NorthstarDLL/shared')
-rw-r--r-- | NorthstarDLL/shared/misccommands.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/NorthstarDLL/shared/misccommands.cpp b/NorthstarDLL/shared/misccommands.cpp index 15e12720..ba00de29 100644 --- a/NorthstarDLL/shared/misccommands.cpp +++ b/NorthstarDLL/shared/misccommands.cpp @@ -10,6 +10,8 @@ #include "server/auth/serverauthentication.h" #include "squirrel/squirrel.h" +AUTOHOOK_INIT() + void ConCommand_force_newgame(const CCommand& arg) { if (arg.ArgC() < 2) @@ -140,6 +142,22 @@ void AddMiscConCommands() RegisterConCommand("cvar_reset", ConCommand_cvar_reset, "resets a cvar's value to its default value", FCVAR_NONE); } +AUTOHOOK(Connect_f, engine.dll + 0x76720, void, , (const CCommand& arg)) +{ + // tickcount number is weird, but consistent! + // todo this check sucks + + if (*R2::g_pServerState != R2::server_state_t::ss_dead && R2::g_pGlobals->m_nTickCount != 60 && !strncmp(arg.Arg(1), "localhost", 9)) + strncpy(const_cast<char*>(arg.GetCommandString() + 8), "127.0.0.1", 9); + + Connect_f(arg); +} + +ON_DLL_LOAD("engine.dll", connecttest, (CModule module)) +{ + AUTOHOOK_DISPATCH() +} + // fixes up various cvar flags to have more sane values void FixupCvarFlags() { |