Add main pipeline

This commit is contained in:
Federico Cecchetto 2021-04-24 16:22:26 +02:00
parent f909521cfb
commit 11d6098c69
3 changed files with 9 additions and 10 deletions

View File

@ -85,6 +85,7 @@ namespace scheduler
task_pipeline pipelines[pipeline::count];
utils::hook::detour r_end_frame_hook;
utils::hook::detour g_run_frame_hook;
utils::hook::detour main_frame_hook;
void execute(const pipeline type)
{
@ -103,6 +104,12 @@ namespace scheduler
g_run_frame_hook.invoke<void>();
execute(pipeline::server);
}
void main_frame_stub()
{
main_frame_hook.invoke<void>();
execute(pipeline::main);
}
}
void schedule(const std::function<bool()>& callback, const pipeline type,
@ -154,6 +161,7 @@ namespace scheduler
r_end_frame_hook.create(game::base_address + 0x76D7B0, scheduler::r_end_frame_stub);
g_run_frame_hook.create(game::base_address + 0x4CB030, scheduler::server_frame_stub);
main_frame_hook.create(game::base_address + 0x417FA0, scheduler::main_frame_stub);
}
};
}

View File

@ -24,8 +24,6 @@ namespace scripting
utils::hook::detour scr_add_class_field_hook;
std::unordered_map<std::string, int> known_events;
void vm_notify_stub(const unsigned int notify_list_owner_id, const game::scr_string_t string_value,
game::VariableValue* top)
{
@ -41,13 +39,6 @@ namespace scripting
e.arguments.emplace_back(*value);
}
if (known_events.find(e.name) == known_events.end())
{
//printf("notify: %s\n", e.name.data());
known_events[e.name] = 1;
}
lua::engine::notify(e);
}