Dedi post initialization.

This commit is contained in:
momo5502 2016-01-02 18:49:58 +01:00
parent 54db04e1f2
commit 1c0b9f6aa1
2 changed files with 33 additions and 0 deletions

View File

@ -29,6 +29,33 @@ namespace Components
Utils::Hook::Call<void()>(0x4F84C0)(); Utils::Hook::Call<void()>(0x4F84C0)();
} }
void Dedicated::PostInitialization()
{
Command::Execute("exec autoexec.cfg");
Command::Execute("onlinegame 1");
Command::Execute("exec default_xboxlive.cfg");
Command::Execute("xblive_rankedmatch 1");
Command::Execute("xblive_privatematch 0");
//Command::Execute("xstartprivatematch");
Command::Execute("sv_network_fps 1000");
Command::Execute("com_maxfps 125");
// Process command line?
Utils::Hook::Call<void()>(0x60C3D0)();
}
void __declspec(naked) Dedicated::PostInitializationStub()
{
__asm
{
call Dedicated::PostInitialization
// Start Com_EvenLoop
mov eax, 43D140h
jmp eax
}
}
void Dedicated::MapRotate() void Dedicated::MapRotate()
{ {
if (Dvar::Var("party_host").Get<bool>()) if (Dvar::Var("party_host").Get<bool>())
@ -197,6 +224,9 @@ namespace Components
// Dedicated frame handler // Dedicated frame handler
Utils::Hook(0x4B0F81, Dedicated::FrameStub, HOOK_CALL).Install()->Quick(); Utils::Hook(0x4B0F81, Dedicated::FrameStub, HOOK_CALL).Install()->Quick();
// Post initialization point
Utils::Hook(0x60BFBF, Dedicated::PostInitializationStub, HOOK_JUMP).Install()->Quick();
// isHost script call return 0 // isHost script call return 0
Utils::Hook::Set<DWORD>(0x5DEC04, 0); Utils::Hook::Set<DWORD>(0x5DEC04, 0);

View File

@ -22,5 +22,8 @@ namespace Components
static void MapRotate(); static void MapRotate();
static void FrameStub(); static void FrameStub();
static void InitDedicatedServer(); static void InitDedicatedServer();
static void PostInitialization();
static void PostInitializationStub();
}; };
} }