MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / RegisterPlugin

Method RegisterPlugin

src/openrct2/scripting/ScriptEngine.cpp:861–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861void ScriptEngine::RegisterPlugin(std::string_view path)
862{
863 try
864 {
865 auto plugin = std::make_shared<Plugin>(path);
866
867 // We must load the plugin to get the metadata for it
868 ScriptExecutionInfo::PluginScope scope(_execInfo, plugin, false);
869 plugin->Load();
870
871 // Unload the plugin now, metadata is kept
872 plugin->Unload();
873
874 LogPluginInfo(plugin, "Registered");
875 _plugins.push_back(std::move(plugin));
876 }
877 catch (const std::exception& e)
878 {
879 _console.WriteLineError(e.what());
880 }
881}
882
883void ScriptEngine::StartIntransientPlugins()
884{

Callers

nothing calls this directly

Calls 5

WriteLineErrorMethod · 0.80
LoadMethod · 0.45
UnloadMethod · 0.45
push_backMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected