mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-07-06 19:21:55 +00:00
Grealy improve boot times
This commit is contained in:
@ -97,8 +97,15 @@ namespace utils::hook
|
||||
MH_DisableHook(this->place_);
|
||||
}
|
||||
|
||||
void detour::create(void* place, void* target)
|
||||
void detour::create(void* place, void* target, bool quick)
|
||||
{
|
||||
// each detour is ~30ms to install, quick is for instances where we will NEVER need to invoke the original
|
||||
if (quick)
|
||||
{
|
||||
jump(reinterpret_cast<std::uintptr_t>(place), target);
|
||||
return;
|
||||
}
|
||||
|
||||
this->clear();
|
||||
this->place_ = place;
|
||||
|
||||
@ -110,9 +117,9 @@ namespace utils::hook
|
||||
this->enable();
|
||||
}
|
||||
|
||||
void detour::create(const size_t place, void* target)
|
||||
void detour::create(const size_t place, void* target, bool quick)
|
||||
{
|
||||
this->create(reinterpret_cast<void*>(place), target);
|
||||
this->create(reinterpret_cast<void*>(place), target, quick);
|
||||
}
|
||||
|
||||
void detour::clear()
|
||||
|
@ -86,8 +86,8 @@ namespace utils::hook
|
||||
void enable() const;
|
||||
void disable() const;
|
||||
|
||||
void create(void* place, void* target);
|
||||
void create(size_t place, void* target);
|
||||
void create(void* place, void* target, bool quick = false);
|
||||
void create(size_t place, void* target, bool quick = false);
|
||||
void clear();
|
||||
|
||||
template <typename T>
|
||||
|
Reference in New Issue
Block a user