feat: added scheduling
This commit is contained in:
@@ -1,9 +1,29 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <detail/fxn.hpp>
|
#include <detail/fxn.hpp>
|
||||||
|
|
||||||
DWORD WINAPI ThreadProc(LPVOID lpParameter)
|
#include <blackbase/library/library.hpp>
|
||||||
|
|
||||||
|
void Initialize()
|
||||||
{
|
{
|
||||||
auto& fxnManager = fxn::FxnManager::GetInstance();
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <detail/rage.hpp>
|
#include <detail/rage.hpp>
|
||||||
#include <detail/dispatcher.hpp>
|
#include <detail/dispatcher.hpp>
|
||||||
#include <detail/hooking.hpp>
|
#include <detail/hooking.hpp>
|
||||||
|
#include <detail/scheduler.hpp>
|
||||||
|
|
||||||
#include <blackbase/xorstr.hpp>
|
#include <blackbase/xorstr.hpp>
|
||||||
#include <blackbase/library/library.hpp>
|
#include <blackbase/library/library.hpp>
|
||||||
@@ -151,11 +152,12 @@ namespace fxn
|
|||||||
auto job = [this, context]()
|
auto job = [this, context]()
|
||||||
{
|
{
|
||||||
this->InvokeNative(context);
|
this->InvokeNative(context);
|
||||||
|
|
||||||
|
context->SetExecuted(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Implement scheduling logic here.
|
static auto& scheduler = fxn::NativeScheduler::GetInstance();
|
||||||
|
scheduler.Schedule(job);
|
||||||
// END OF TODO
|
|
||||||
|
|
||||||
if (waitForCompletion)
|
if (waitForCompletion)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user