Wait for the server to start before loading plugins or allowing connections

This commit is contained in:
Tixx
2025-02-15 21:47:17 +01:00
parent 27d50fc2b5
commit 00560f7646
3 changed files with 17 additions and 6 deletions

View File

@@ -80,10 +80,11 @@ TEST_CASE("TLuaEngine ctor & dtor") {
void TLuaEngine::operator()() {
RegisterThread("LuaEngine");
Application::SetSubsystemStatus("LuaEngine", Application::Status::Good);
// lua engine main thread
beammp_infof("Lua v{}.{}.{}", LUA_VERSION_MAJOR, LUA_VERSION_MINOR, LUA_VERSION_RELEASE);
CollectAndInitPlugins();
Application::SetSubsystemStatus("LuaEngine", Application::Status::Good);
// now call all onInit's
auto Futures = TriggerEvent("onInit", "");
WaitForAll(Futures, std::chrono::seconds(5));