[Dedicated] Fix frame handler

This commit is contained in:
momo5502 2016-12-12 21:53:54 +01:00
parent 9355b4b7c8
commit f1d90af0d7
4 changed files with 22 additions and 9 deletions

View File

@ -244,7 +244,7 @@ namespace Components
Dedicated::FrameSignal.connect(callback);
}
void Dedicated::FrameStub()
void Dedicated::FrameHandler()
{
auto copy = Dedicated::FrameSignal;
copy();
@ -252,8 +252,19 @@ namespace Components
copy = Dedicated::FrameOnceSignal;
Dedicated::FrameOnceSignal.clear();
copy();
}
Utils::Hook::Call<void()>(0x5A8E80)();
__declspec(naked) void Dedicated::FrameStub()
{
__asm
{
pushad
call Dedicated::FrameHandler
popad
push 5A8E80h
retn
}
}
Dedicated::Dedicated()

View File

@ -26,6 +26,7 @@ namespace Components
static bool SendChat;
static void MapRotate();
static void FrameHandler();
static void FrameStub();
static void InitDedicatedServer();

View File

@ -326,7 +326,7 @@ namespace Components
// increase max port binding attempts from 10 to 100
Utils::Hook::Set<BYTE>(0x4FD48A, 100);
// increase cl_maxpackets limit to 120
// increase cl_maxpackets limit
Utils::Hook::Set<BYTE>(0x4050A1, 125);
// Parse port as short in Net_AddrToString

View File

@ -68,7 +68,7 @@ namespace Components
SlowMotion::Delay = delay;
// set snapshot num to 1 behind (T6 does this, why shouldn't we?)
for (int i = 0; i < *Game::svs_numclients; i++)
for (int i = 0; i < *Game::svs_numclients; ++i)
{
Game::svs_clients[i].snapNum = (*reinterpret_cast<DWORD*>(0x31D9384)) - 1;
}
@ -76,10 +76,11 @@ namespace Components
SlowMotion::SlowMotion()
{
if (!Dedicated::IsEnabled()) return;
if (Dedicated::IsEnabled())
{
SlowMotion::Delay = 0;
Utils::Hook(0x5F5FF2, SlowMotion::SetSlowMotion, HOOK_JUMP).install()->quick();
Utils::Hook(0x60B38A, SlowMotion::ApplySlowMotionStub, HOOK_CALL).install()->quick();
}
}
}