mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-04-20 05:25:44 +00:00
main sched
This commit is contained in:
parent
8a6f707e4e
commit
fe55a14edc
@ -93,6 +93,11 @@ namespace scheduler
|
|||||||
execute(pipeline::server);
|
execute(pipeline::server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void execute_main()
|
||||||
|
{
|
||||||
|
execute(pipeline::main);
|
||||||
|
}
|
||||||
|
|
||||||
utils::hook::detour com_init_hook;
|
utils::hook::detour com_init_hook;
|
||||||
utils::hook::detour gscr_postloadscripts_hook;
|
utils::hook::detour gscr_postloadscripts_hook;
|
||||||
|
|
||||||
@ -110,6 +115,8 @@ namespace scheduler
|
|||||||
{
|
{
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_init_funcs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void com_init_stub()
|
void com_init_stub()
|
||||||
@ -156,7 +163,7 @@ namespace scheduler
|
|||||||
{
|
{
|
||||||
if (com_inited)
|
if (com_inited)
|
||||||
{
|
{
|
||||||
callback();
|
once(callback, pipeline::main);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -180,6 +187,7 @@ namespace scheduler
|
|||||||
|
|
||||||
com_init_hook.create(SELECT(0x0, 0x59D710), com_init_stub);
|
com_init_hook.create(SELECT(0x0, 0x59D710), com_init_stub);
|
||||||
utils::hook::call(SELECT(0x0, 0x503B5D), execute_server);
|
utils::hook::call(SELECT(0x0, 0x503B5D), execute_server);
|
||||||
|
utils::hook::call(SELECT(0x0, 0x59DCFD), execute_main);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -6,17 +6,18 @@ namespace scheduler
|
|||||||
{
|
{
|
||||||
server,
|
server,
|
||||||
async,
|
async,
|
||||||
|
main,
|
||||||
count,
|
count,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const bool cond_continue = false;
|
static const bool cond_continue = false;
|
||||||
static const bool cond_end = true;
|
static const bool cond_end = true;
|
||||||
|
|
||||||
void schedule(const std::function<bool()>& callback, pipeline type = pipeline::server,
|
void schedule(const std::function<bool()>& callback, pipeline type = pipeline::main,
|
||||||
std::chrono::milliseconds delay = 0ms);
|
std::chrono::milliseconds delay = 0ms);
|
||||||
void loop(const std::function<void()>& callback, pipeline type = pipeline::server,
|
void loop(const std::function<void()>& callback, pipeline type = pipeline::main,
|
||||||
std::chrono::milliseconds delay = 0ms);
|
std::chrono::milliseconds delay = 0ms);
|
||||||
void once(const std::function<void()>& callback, pipeline type = pipeline::server,
|
void once(const std::function<void()>& callback, pipeline type = pipeline::main,
|
||||||
std::chrono::milliseconds delay = 0ms);
|
std::chrono::milliseconds delay = 0ms);
|
||||||
|
|
||||||
void on_init(const std::function<void()>& callback);
|
void on_init(const std::function<void()>& callback);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user