Add a development mode
Pluggin development needs the pluggin to be directly loaded so the running program may be stopped for inspection and modifications. This is controlled by a configuration switch in the Robust.iniintegration
parent
0a949a20ca
commit
a57ec18fb5
|
@ -84,11 +84,51 @@ namespace OpenSim.Services.IntegrationService
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
|
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
|
||||||
|
|
||||||
|
m_IntegrationConfigLoc = serverConfig.GetString("IntegrationConfig", String.Empty);
|
||||||
|
AddinRegistry registry ;
|
||||||
|
bool DEVELOPMENT = serverConfig.GetBoolean("DevelopmentMode", false);
|
||||||
|
|
||||||
|
// Are we developing plugins? We will load them now
|
||||||
|
if (DEVELOPMENT == true)
|
||||||
|
{
|
||||||
|
AddinManager.Initialize (".");
|
||||||
|
registry = new AddinRegistry(".", ".");
|
||||||
|
registry.Update ();
|
||||||
|
|
||||||
|
AddinManager.AddinLoaded += on_addinloaded_;
|
||||||
|
AddinManager.AddinLoadError += on_addinloaderror_;
|
||||||
|
AddinManager.AddinUnloaded += HandleAddinManagerAddinUnloaded;
|
||||||
|
AddinManager.AddinEngine.ExtensionChanged += HandleAddinManagerAddinEngineExtensionChanged;
|
||||||
|
// AddinManager.GetExtensionObjects("/OpenSim/IntegrationService");
|
||||||
|
|
||||||
|
registry.Update ();
|
||||||
|
foreach (IntegrationPlugin cmd in AddinManager.GetExtensionObjects("/OpenSim/IntegrationService"))
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[INTEGRATION SERVICE]: Processing _Addin {0}", cmd.Name);
|
||||||
|
LoadingPlugin(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
Addin[] addins = registry.GetAddins();
|
||||||
|
|
||||||
|
foreach (Addin addin in addins)
|
||||||
|
{
|
||||||
|
if (addin.Description.Category == "IntegrationPlugin")
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[INTEGRATION SERVICE]: Processing O Addin {0}", addin.Name);
|
||||||
|
addin.Enabled = true;
|
||||||
|
registry.EnableAddin(addin.Id);
|
||||||
|
registry.Update();
|
||||||
|
AddinManager.AddinEngine.LoadAddin(null, addin.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// defaults to the ./bin directory
|
// defaults to the ./bin directory
|
||||||
string RegistryLocation = serverConfig.GetString("PluginRegistryLocation",
|
string RegistryLocation = serverConfig.GetString("PluginRegistryLocation",
|
||||||
".");
|
".");
|
||||||
|
|
||||||
AddinRegistry registry = new AddinRegistry(RegistryLocation, ".");
|
registry = new AddinRegistry(RegistryLocation, ".");
|
||||||
|
|
||||||
Ux.suppress_console_output_(true);
|
Ux.suppress_console_output_(true);
|
||||||
m_PluginManager = new PluginManager(registry);
|
m_PluginManager = new PluginManager(registry);
|
||||||
|
@ -118,6 +158,7 @@ namespace OpenSim.Services.IntegrationService
|
||||||
AddinManager.AddExtensionNodeHandler ("/OpenSim/IntegrationService", OnExtensionChanged);
|
AddinManager.AddExtensionNodeHandler ("/OpenSim/IntegrationService", OnExtensionChanged);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void HandleAddinManagerAddinEngineExtensionChanged (object sender, ExtensionEventArgs args)
|
void HandleAddinManagerAddinEngineExtensionChanged (object sender, ExtensionEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue