Fix more compile issues with lua, add TriggerGlobalEvent

This commit is contained in:
Lion Kortlepel 2021-09-16 13:06:04 +02:00
parent 26231c6272
commit dca573b15c
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B
2 changed files with 5 additions and 1 deletions

View File

@ -56,6 +56,7 @@ add_executable(BeamMP-Server
include_directories(BeamMP-Server PUBLIC ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
find_package(Lua REQUIRED)
include_directories(${LUA_INCLUDE_DIR})
find_package(OpenSSL REQUIRED)
target_link_libraries(BeamMP-Server sol2::sol2 ${LUA_LIBRARIES})

View File

@ -159,7 +159,10 @@ TLuaEngine::StateThreadData::StateThreadData(const std::string& Name, std::atomi
[this](const std::string& EventName, const std::string& FunctionName) {
RegisterEvent(EventName, FunctionName);
});
Table.set_function("");
Table.set_function("TriggerGlobalEvent",
[&](const std::string& EventName) {
return mEngine->TriggerEvent(EventName);
});
Table.create_named("Settings",
"Debug", 0,
"Private", 1,