From a7faf91b287f9a9cbae79d418c61743f9e81a537 Mon Sep 17 00:00:00 2001 From: slayercio Date: Tue, 18 Nov 2025 21:19:07 +0100 Subject: [PATCH] feat: added scheduling --- src/impl/dllmain.cpp | 22 +++++++++++++++++++++- src/impl/fxn.cpp | 8 +++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/impl/dllmain.cpp b/src/impl/dllmain.cpp index 41b7e8c..295574b 100644 --- a/src/impl/dllmain.cpp +++ b/src/impl/dllmain.cpp @@ -1,9 +1,29 @@ #include #include -DWORD WINAPI ThreadProc(LPVOID lpParameter) +#include + +void Initialize() { auto& fxnManager = fxn::FxnManager::GetInstance(); +} + +DWORD WINAPI ThreadProc(LPVOID lpParameter) +{ + auto currentLibrary = blackbase::Library::GetCurrent(); + if (!currentLibrary.has_value()) + { + return FALSE; + } + + auto name = currentLibrary->GetName(); + if (!name.contains("GameProcess") && !name.contains("GTAProcess")) + { + return FALSE; + } + + Sleep(5000); + Initialize(); return TRUE; } diff --git a/src/impl/fxn.cpp b/src/impl/fxn.cpp index ac8ce72..2b6d282 100644 --- a/src/impl/fxn.cpp +++ b/src/impl/fxn.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -151,11 +152,12 @@ namespace fxn auto job = [this, context]() { this->InvokeNative(context); + + context->SetExecuted(true); }; - // TODO: Implement scheduling logic here. - - // END OF TODO + static auto& scheduler = fxn::NativeScheduler::GetInstance(); + scheduler.Schedule(job); if (waitForCompletion) {