* Now loading modules from ScriptEngines directory as well.

afrisby
lbsa71 2007-10-10 18:40:09 +00:00
parent a40e7100a2
commit dbdacc26a4
3 changed files with 11 additions and 46 deletions

View File

@ -76,11 +76,6 @@ namespace OpenSim
private readonly string m_logFilename = ("region-console.log");
private bool m_permissions = false;
private bool m_DefaultModules = true;
private string m_exceptModules = "";
private bool m_DefaultSharedModules = true;
private string m_exceptSharedModules = "";
private bool standaloneAuthenticate = false;
private string standaloneWelcomeMessage = null;
private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
@ -128,10 +123,10 @@ namespace OpenSim
m_assetStorage = configSource.Configs["Startup"].GetString("asset_database", "db4o");
m_DefaultModules = configSource.Configs["Startup"].GetBoolean("default_modules", true);
m_DefaultSharedModules = configSource.Configs["Startup"].GetBoolean("default_shared_modules", true);
m_exceptModules = configSource.Configs["Startup"].GetString("except_modules", "");
m_exceptSharedModules = configSource.Configs["Startup"].GetString("except_shared_modules", "");
configSource.Configs["Startup"].GetBoolean("default_modules", true);
configSource.Configs["Startup"].GetBoolean("default_shared_modules", true);
configSource.Configs["Startup"].GetString("except_modules", "");
configSource.Configs["Startup"].GetString("except_shared_modules", "");
standaloneAuthenticate = configSource.Configs["StandAlone"].GetBoolean("accounts_authenticate", false);
standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
@ -204,7 +199,7 @@ namespace OpenSim
m_moduleLoader = new ModuleLoader( m_log );
MainLog.Instance.Verbose("Loading Shared Modules");
m_moduleLoader.LoadDefaultSharedModules(m_exceptSharedModules);
m_moduleLoader.LoadDefaultSharedModules();
// Load all script engines found (scripting engine is now a IRegionModule so loaded in the module loader
// OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader ScriptEngineLoader = new OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader(m_log);
@ -221,8 +216,9 @@ namespace OpenSim
m_moduleLoader.InitialiseSharedModules(scene);
MainLog.Instance.Verbose("Loading Region's Modules");
//m_moduleLoader.CreateDefaultModules(scene, m_exceptModules);
m_moduleLoader.PickupModules( scene );
m_moduleLoader.PickupModules(scene, ".");
m_moduleLoader.PickupModules(scene, "ScriptEngines");
scene.SetModuleInterfaces();
// Check if we have a script engine to load

View File

@ -22,37 +22,8 @@ namespace OpenSim.Region.Environment
m_log = log;
}
/// <summary>
/// Should have a module factory?
/// </summary>
/// <param name="scene"></param>
//public void CreateDefaultModules(Scene scene, string exceptModules)
//{
// IRegionModule module = new XferModule();
// InitializeModule(module, scene);
// module = new ChatModule();
// InitializeModule(module, scene);
// module = new AvatarProfilesModule();
// InitializeModule(module, scene);
// module = new XMLRPCModule();
// InitializeModule(module, scene);
// module = new WorldCommModule();
// InitializeModule(module, scene);
// LoadRegionModule("OpenSim.Region.ExtensionsScriptModule.dll", "ExtensionsScriptingModule", scene);
// string lslPath = Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine.DotNetEngine.dll");
// LoadRegionModule(lslPath, "LSLScriptingModule", scene);
//}
public void PickupModules(Scene scene)
public void PickupModules(Scene scene, string moduleDir)
{
string moduleDir = ".";
DirectoryInfo dir = new DirectoryInfo(moduleDir);
foreach (FileInfo fileInfo in dir.GetFiles("*.dll"))
@ -61,7 +32,7 @@ namespace OpenSim.Region.Environment
}
}
public void LoadDefaultSharedModules(string exceptModules)
public void LoadDefaultSharedModules()
{
DynamicTextureModule dynamicModule = new DynamicTextureModule();
LoadedSharedModules.Add(dynamicModule.Name, dynamicModule);

View File

@ -63,14 +63,12 @@ namespace SimpleApp
UDPServer udpServer;
m_moduleLoader = new ModuleLoader( m_log );
m_moduleLoader.LoadDefaultSharedModules("");
m_moduleLoader.LoadDefaultSharedModules();
Scene scene = SetupScene(regionInfo, out udpServer);
m_moduleLoader.InitialiseSharedModules(scene);
// m_moduleLoader.CreateDefaultModules(scene, "");
scene.SetModuleInterfaces();
scene.StartTimer();