feat: added scheduling

This commit is contained in:
2025-11-18 21:19:07 +01:00
parent 9d36ce0f18
commit a7faf91b28
2 changed files with 26 additions and 4 deletions

View File

@@ -1,9 +1,29 @@
#include <windows.h>
#include <detail/fxn.hpp>
DWORD WINAPI ThreadProc(LPVOID lpParameter)
#include <blackbase/library/library.hpp>
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;
}

View File

@@ -7,6 +7,7 @@
#include <detail/rage.hpp>
#include <detail/dispatcher.hpp>
#include <detail/hooking.hpp>
#include <detail/scheduler.hpp>
#include <blackbase/xorstr.hpp>
#include <blackbase/library/library.hpp>
@@ -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)
{