From 74ed1c342a197755b816b74c0933013377fd60ab Mon Sep 17 00:00:00 2001 From: FutureRave Date: Sat, 7 May 2022 00:15:58 +0100 Subject: [PATCH] Fix some mistakes (still wrong pipeline being used somewhere) --- src/Components/Modules/ConnectProtocol.cpp | 2 +- src/Components/Modules/Console.cpp | 2 +- src/Components/Modules/Dedicated.cpp | 2 +- src/Components/Modules/FastFiles.cpp | 4 ++-- src/Components/Modules/Logger.cpp | 2 +- src/Components/Modules/Scheduler.cpp | 6 +++--- src/Components/Modules/ServerList.cpp | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Components/Modules/ConnectProtocol.cpp b/src/Components/Modules/ConnectProtocol.cpp index 387196a1..703bb2f5 100644 --- a/src/Components/Modules/ConnectProtocol.cpp +++ b/src/Components/Modules/ConnectProtocol.cpp @@ -213,7 +213,7 @@ namespace Components }); // Invocation handler - Scheduler::OnGameInitialized(ConnectProtocol::Invocation, Scheduler::Pipeline::CLIENT); + Scheduler::OnGameInitialized(ConnectProtocol::Invocation, Scheduler::Pipeline::MAIN); ConnectProtocol::InstallProtocol(); ConnectProtocol::EvaluateProtocol(); diff --git a/src/Components/Modules/Console.cpp b/src/Components/Modules/Console.cpp index d3667054..0f2bc7d6 100644 --- a/src/Components/Modules/Console.cpp +++ b/src/Components/Modules/Console.cpp @@ -622,7 +622,7 @@ namespace Components } }, HOOK_CALL).install()->quick(); - Scheduler::OnGameInitialized([] + Scheduler::Loop([] { Console::LastRefresh = Game::Sys_Milliseconds(); }, Scheduler::Pipeline::MAIN); diff --git a/src/Components/Modules/Dedicated.cpp b/src/Components/Modules/Dedicated.cpp index c3520383..061b3ae0 100644 --- a/src/Components/Modules/Dedicated.cpp +++ b/src/Components/Modules/Dedicated.cpp @@ -371,7 +371,7 @@ namespace Components { Dedicated::Heartbeat(); } - }, Scheduler::Pipeline::SERVER); + }, Scheduler::Pipeline::SERVER, 2min); Dvar::OnInit([]() { diff --git a/src/Components/Modules/FastFiles.cpp b/src/Components/Modules/FastFiles.cpp index e9497a73..39e5f31a 100644 --- a/src/Components/Modules/FastFiles.cpp +++ b/src/Components/Modules/FastFiles.cpp @@ -580,11 +580,11 @@ namespace Components auto FFCurrentOffset = *reinterpret_cast(0x10AA608); float fastfileLoadProgress = (float(FFCurrentOffset) / float(FFTotalSize)) * 100.0f; - if (isinf(fastfileLoadProgress)) + if (std::isinf(fastfileLoadProgress)) { fastfileLoadProgress = 100.0f; } - else if (isnan(fastfileLoadProgress)) + else if (std::isnan(fastfileLoadProgress)) { fastfileLoadProgress = 0.0f; } diff --git a/src/Components/Modules/Logger.cpp b/src/Components/Modules/Logger.cpp index f2905e18..50a005e9 100644 --- a/src/Components/Modules/Logger.cpp +++ b/src/Components/Modules/Logger.cpp @@ -245,7 +245,7 @@ namespace Components Logger::PipeOutput(nullptr); - Scheduler::OnGameInitialized(Logger::Frame, Scheduler::Pipeline::MAIN); + Scheduler::Loop(Logger::Frame, Scheduler::Pipeline::MAIN); Utils::Hook(0x4B0218, Logger::GameLogStub, HOOK_CALL).install()->quick(); Utils::Hook(Game::Com_PrintMessage, Logger::PrintMessageStub, HOOK_JUMP).install()->quick(); diff --git a/src/Components/Modules/Scheduler.cpp b/src/Components/Modules/Scheduler.cpp index ef403946..c3cfbf57 100644 --- a/src/Components/Modules/Scheduler.cpp +++ b/src/Components/Modules/Scheduler.cpp @@ -69,14 +69,14 @@ namespace Components void Scheduler::REndFrame_Hk() { - Execute(Pipeline::RENDERER); Utils::Hook::Call(0x50AB20)(); + Execute(Pipeline::RENDERER); } void Scheduler::ServerFrame_Hk() { - Execute(Pipeline::SERVER); Utils::Hook::Call(0x471C50)(); + Execute(Pipeline::SERVER); } void Scheduler::ClientFrame_Hk(const int localClientNum) @@ -87,8 +87,8 @@ namespace Components void Scheduler::MainFrame_Hk() { - Execute(Pipeline::MAIN); Utils::Hook::Call(0x47DCA0)(); + Execute(Pipeline::MAIN); } void Scheduler::SysSetBlockSystemHotkeys_Hk(int block) diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index fe79963f..e2b6b8a2 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -922,7 +922,7 @@ namespace Components UIScript::AddOwnerDraw(253, ServerList::UpdateGameType); // Add frame callback - Scheduler::OnGameInitialized(ServerList::Frame, Scheduler::Pipeline::CLIENT); + Scheduler::Loop(ServerList::Frame, Scheduler::Pipeline::CLIENT); } ServerList::~ServerList()