mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-06 07:46:06 +00:00
start working on event handlers
This commit is contained in:
@@ -131,6 +131,9 @@ Error LuaPlugin::initialize_libraries() {
|
||||
glob["MP"]["GetPluginPath"] = [this] {
|
||||
return std::filesystem::absolute(m_path).string();
|
||||
};
|
||||
glob["MP"]["RegisterEvent"] = [this] (const std::string& event_name, const std::string& handler) {
|
||||
|
||||
};
|
||||
|
||||
glob["MP"]["ScheduleCallRepeat"] = [this](size_t ms, sol::function fn, sol::variadic_args args) {
|
||||
return l_mp_schedule_call_repeat(ms, fn, args);
|
||||
|
||||
@@ -170,6 +170,11 @@ int BeamMPServerMain(MainArguments Arguments) {
|
||||
PluginManager PluginManager;
|
||||
(void)PluginManager.add_plugin(Plugin::make_pointer<LuaPlugin>("Resources/Server/Test"));
|
||||
|
||||
PluginManager.trigger_event("onInit", std::make_shared<Value>(HashMap<std::string, Value> {
|
||||
{ "big", "balls" },
|
||||
{ "longer", "falls" },
|
||||
}));
|
||||
|
||||
if (Application::Settings.HTTPServerEnabled) {
|
||||
Http::Server::THttpServerInstance HttpServerInstance {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user