mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 06:16:04 +00:00
call onInit on hot-reload, cleanup, remove warnings
onInit is now called on hot-reload, for the whole plugin. Arguably, this is not expected behavior, since only one file is being reloaded, but this is the easiest way to do it, and the entire hot-reload process is only for development purposes. Open an issue if this breaks your stuff :^)
This commit is contained in:
@@ -47,8 +47,8 @@ void TPluginMonitor::operator()() {
|
||||
TLuaChunk Chunk(Contents, Pair.first, fs::path(Pair.first).parent_path().string());
|
||||
auto StateID = mEngine->GetStateIDForPlugin(fs::path(Pair.first).parent_path());
|
||||
auto Res = mEngine->EnqueueScript(StateID, Chunk);
|
||||
// TODO: call onInit
|
||||
mEngine->AddResultToCheck(Res);
|
||||
mEngine->ReportErrors(mEngine->TriggerLocalEvent(StateID, "onInit"));
|
||||
} else {
|
||||
// TODO: trigger onFileChanged event
|
||||
beammp_trace("Change detected in file \"" + Pair.first + "\", event trigger not implemented yet");
|
||||
|
||||
Reference in New Issue
Block a user