aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorlbsa712007-10-10 18:40:09 +0000
committerlbsa712007-10-10 18:40:09 +0000
commitdbdacc26a46cf7c6627babff9e183d6e16550cb7 (patch)
tree889068f79d7fb1860952ad301cd4ed52fb494275
parent* Gave ModuleLoader some good lovin' (diff)
downloadopensim-SC-dbdacc26a46cf7c6627babff9e183d6e16550cb7.zip
opensim-SC-dbdacc26a46cf7c6627babff9e183d6e16550cb7.tar.gz
opensim-SC-dbdacc26a46cf7c6627babff9e183d6e16550cb7.tar.bz2
opensim-SC-dbdacc26a46cf7c6627babff9e183d6e16550cb7.tar.xz
* Now loading modules from ScriptEngines directory as well.
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs20
-rw-r--r--OpenSim/Region/Environment/ModuleLoader.cs33
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs4
3 files changed, 11 insertions, 46 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 2fc2d0a..08b499d 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -76,11 +76,6 @@ namespace OpenSim
76 private readonly string m_logFilename = ("region-console.log"); 76 private readonly string m_logFilename = ("region-console.log");
77 private bool m_permissions = false; 77 private bool m_permissions = false;
78 78
79 private bool m_DefaultModules = true;
80 private string m_exceptModules = "";
81 private bool m_DefaultSharedModules = true;
82 private string m_exceptSharedModules = "";
83
84 private bool standaloneAuthenticate = false; 79 private bool standaloneAuthenticate = false;
85 private string standaloneWelcomeMessage = null; 80 private string standaloneWelcomeMessage = null;
86 private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; 81 private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
@@ -128,10 +123,10 @@ namespace OpenSim
128 123
129 m_assetStorage = configSource.Configs["Startup"].GetString("asset_database", "db4o"); 124 m_assetStorage = configSource.Configs["Startup"].GetString("asset_database", "db4o");
130 125
131 m_DefaultModules = configSource.Configs["Startup"].GetBoolean("default_modules", true); 126 configSource.Configs["Startup"].GetBoolean("default_modules", true);
132 m_DefaultSharedModules = configSource.Configs["Startup"].GetBoolean("default_shared_modules", true); 127 configSource.Configs["Startup"].GetBoolean("default_shared_modules", true);
133 m_exceptModules = configSource.Configs["Startup"].GetString("except_modules", ""); 128 configSource.Configs["Startup"].GetString("except_modules", "");
134 m_exceptSharedModules = configSource.Configs["Startup"].GetString("except_shared_modules", ""); 129 configSource.Configs["Startup"].GetString("except_shared_modules", "");
135 130
136 standaloneAuthenticate = configSource.Configs["StandAlone"].GetBoolean("accounts_authenticate", false); 131 standaloneAuthenticate = configSource.Configs["StandAlone"].GetBoolean("accounts_authenticate", false);
137 standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim"); 132 standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
@@ -204,7 +199,7 @@ namespace OpenSim
204 199
205 m_moduleLoader = new ModuleLoader( m_log ); 200 m_moduleLoader = new ModuleLoader( m_log );
206 MainLog.Instance.Verbose("Loading Shared Modules"); 201 MainLog.Instance.Verbose("Loading Shared Modules");
207 m_moduleLoader.LoadDefaultSharedModules(m_exceptSharedModules); 202 m_moduleLoader.LoadDefaultSharedModules();
208 203
209 // Load all script engines found (scripting engine is now a IRegionModule so loaded in the module loader 204 // Load all script engines found (scripting engine is now a IRegionModule so loaded in the module loader
210 // OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader ScriptEngineLoader = new OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader(m_log); 205 // OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader ScriptEngineLoader = new OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader(m_log);
@@ -221,8 +216,9 @@ namespace OpenSim
221 m_moduleLoader.InitialiseSharedModules(scene); 216 m_moduleLoader.InitialiseSharedModules(scene);
222 MainLog.Instance.Verbose("Loading Region's Modules"); 217 MainLog.Instance.Verbose("Loading Region's Modules");
223 218
224 //m_moduleLoader.CreateDefaultModules(scene, m_exceptModules); 219 m_moduleLoader.PickupModules(scene, ".");
225 m_moduleLoader.PickupModules( scene ); 220 m_moduleLoader.PickupModules(scene, "ScriptEngines");
221
226 scene.SetModuleInterfaces(); 222 scene.SetModuleInterfaces();
227 223
228 // Check if we have a script engine to load 224 // Check if we have a script engine to load
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index b24b651..5c3eefc 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -22,37 +22,8 @@ namespace OpenSim.Region.Environment
22 m_log = log; 22 m_log = log;
23 } 23 }
24 24
25 /// <summary> 25 public void PickupModules(Scene scene, string moduleDir)
26 /// Should have a module factory?
27 /// </summary>
28 /// <param name="scene"></param>
29 //public void CreateDefaultModules(Scene scene, string exceptModules)
30 //{
31 // IRegionModule module = new XferModule();
32 // InitializeModule(module, scene);
33
34 // module = new ChatModule();
35 // InitializeModule(module, scene);
36
37 // module = new AvatarProfilesModule();
38 // InitializeModule(module, scene);
39
40 // module = new XMLRPCModule();
41 // InitializeModule(module, scene);
42
43 // module = new WorldCommModule();
44 // InitializeModule(module, scene);
45
46 // LoadRegionModule("OpenSim.Region.ExtensionsScriptModule.dll", "ExtensionsScriptingModule", scene);
47
48 // string lslPath = Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine.DotNetEngine.dll");
49 // LoadRegionModule(lslPath, "LSLScriptingModule", scene);
50 //}
51
52 public void PickupModules(Scene scene)
53 { 26 {
54 string moduleDir = ".";
55
56 DirectoryInfo dir = new DirectoryInfo(moduleDir); 27 DirectoryInfo dir = new DirectoryInfo(moduleDir);
57 28
58 foreach (FileInfo fileInfo in dir.GetFiles("*.dll")) 29 foreach (FileInfo fileInfo in dir.GetFiles("*.dll"))
@@ -61,7 +32,7 @@ namespace OpenSim.Region.Environment
61 } 32 }
62 } 33 }
63 34
64 public void LoadDefaultSharedModules(string exceptModules) 35 public void LoadDefaultSharedModules()
65 { 36 {
66 DynamicTextureModule dynamicModule = new DynamicTextureModule(); 37 DynamicTextureModule dynamicModule = new DynamicTextureModule();
67 LoadedSharedModules.Add(dynamicModule.Name, dynamicModule); 38 LoadedSharedModules.Add(dynamicModule.Name, dynamicModule);
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index b8517f7..5f470b1 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -63,14 +63,12 @@ namespace SimpleApp
63 UDPServer udpServer; 63 UDPServer udpServer;
64 64
65 m_moduleLoader = new ModuleLoader( m_log ); 65 m_moduleLoader = new ModuleLoader( m_log );
66 m_moduleLoader.LoadDefaultSharedModules(""); 66 m_moduleLoader.LoadDefaultSharedModules();
67 67
68 Scene scene = SetupScene(regionInfo, out udpServer); 68 Scene scene = SetupScene(regionInfo, out udpServer);
69 69
70 m_moduleLoader.InitialiseSharedModules(scene); 70 m_moduleLoader.InitialiseSharedModules(scene);
71 71
72 // m_moduleLoader.CreateDefaultModules(scene, "");
73
74 scene.SetModuleInterfaces(); 72 scene.SetModuleInterfaces();
75 73
76 scene.StartTimer(); 74 scene.StartTimer();