aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/shared/misccommands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/shared/misccommands.cpp')
-rw-r--r--NorthstarDLL/shared/misccommands.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/NorthstarDLL/shared/misccommands.cpp b/NorthstarDLL/shared/misccommands.cpp
index f3817867..5894f5a2 100644
--- a/NorthstarDLL/shared/misccommands.cpp
+++ b/NorthstarDLL/shared/misccommands.cpp
@@ -11,6 +11,8 @@
#include "server/auth/serverauthentication.h"
#include "squirrel/squirrel.h"
+AUTOHOOK_INIT()
+
void ConCommand_force_newgame(const CCommand& arg)
{
if (arg.ArgC() < 2)
@@ -141,6 +143,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()
{