aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs95
1 files changed, 90 insertions, 5 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index b032e7f..0f3bac4 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -98,6 +98,10 @@ namespace OpenSim
98 98
99 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 99 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
100 100
101 private List<string> m_permsModules;
102
103 private bool m_securePermissionsLoading = true;
104
101 /// <value> 105 /// <value>
102 /// The config information passed into the OpenSimulator region server. 106 /// The config information passed into the OpenSimulator region server.
103 /// </value> 107 /// </value>
@@ -189,6 +193,12 @@ namespace OpenSim
189 CreatePIDFile(pidFile); 193 CreatePIDFile(pidFile);
190 194
191 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 195 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
196
197 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
198
199 string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
200 m_permsModules = new List<string>(permissionModules.Split(','));
201
192 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); 202 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty);
193 } 203 }
194 204
@@ -227,6 +237,12 @@ namespace OpenSim
227 base.StartupSpecific(); 237 base.StartupSpecific();
228 238
229 LoadPlugins(); 239 LoadPlugins();
240
241 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
242 {
243 Environment.Exit(1);
244 }
245
230 foreach (IApplicationPlugin plugin in m_plugins) 246 foreach (IApplicationPlugin plugin in m_plugins)
231 { 247 {
232 plugin.PostInitialise(); 248 plugin.PostInitialise();
@@ -250,10 +266,10 @@ namespace OpenSim
250 "help " + capitalizedTopic, 266 "help " + capitalizedTopic,
251 "Get help on plugin command '" + topic + "'", 267 "Get help on plugin command '" + topic + "'",
252 HandleCommanderHelp); 268 HandleCommanderHelp);
253 console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, 269// console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
254 "help " + capitalizedTopic, 270// "help " + capitalizedTopic,
255 "Get help on plugin command '" + topic + "'", 271// "Get help on plugin command '" + topic + "'",
256 HandleCommanderHelp); 272// HandleCommanderHelp);
257 273
258 ICommander commander = null; 274 ICommander commander = null;
259 275
@@ -376,7 +392,42 @@ namespace OpenSim
376 } 392 }
377 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 393 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
378 394
395 // XPTO: Fix this
396// if (m_securePermissionsLoading)
397// {
398// foreach (string s in m_permsModules)
399// {
400// if (!scene.RegionModules.ContainsKey(s))
401// {
402// bool found = false;
403// foreach (IRegionModule m in modules)
404// {
405// if (m.Name == s)
406// {
407// found = true;
408// }
409// }
410// if (!found)
411// {
412// m_log.Fatal("[MODULES]: Required module " + s + " not found.");
413// Environment.Exit(0);
414// }
415// }
416// }
417// }
418
379 scene.SetModuleInterfaces(); 419 scene.SetModuleInterfaces();
420// First Step of bootreport sequence
421 if (scene.SnmpService != null)
422 {
423 scene.SnmpService.ColdStart(1,scene);
424 scene.SnmpService.LinkDown(scene);
425 }
426
427 if (scene.SnmpService != null)
428 {
429 scene.SnmpService.BootInfo("Loading prins", scene);
430 }
380 431
381 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 432 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
382 SetUpEstateOwner(scene); 433 SetUpEstateOwner(scene);
@@ -390,6 +441,11 @@ namespace OpenSim
390 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 441 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
391 scene.EventManager.TriggerParcelPrimCountUpdate(); 442 scene.EventManager.TriggerParcelPrimCountUpdate();
392 443
444 if (scene.SnmpService != null)
445 {
446 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
447 }
448
393 try 449 try
394 { 450 {
395 scene.RegisterRegionWithGrid(); 451 scene.RegisterRegionWithGrid();
@@ -400,15 +456,29 @@ namespace OpenSim
400 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 456 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
401 e.Message, e.StackTrace); 457 e.Message, e.StackTrace);
402 458
459 if (scene.SnmpService != null)
460 {
461 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
462 }
403 // Carrying on now causes a lot of confusion down the 463 // Carrying on now causes a lot of confusion down the
404 // line - we need to get the user's attention 464 // line - we need to get the user's attention
405 Environment.Exit(1); 465 Environment.Exit(1);
406 } 466 }
407 467
468 if (scene.SnmpService != null)
469 {
470 scene.SnmpService.BootInfo("Grid Registration done", scene);
471 }
472
408 // We need to do this after we've initialized the 473 // We need to do this after we've initialized the
409 // scripting engines. 474 // scripting engines.
410 scene.CreateScriptInstances(); 475 scene.CreateScriptInstances();
411 476
477 if (scene.SnmpService != null)
478 {
479 scene.SnmpService.BootInfo("ScriptEngine started", scene);
480 }
481
412 SceneManager.Add(scene); 482 SceneManager.Add(scene);
413 483
414 if (m_autoCreateClientStack) 484 if (m_autoCreateClientStack)
@@ -420,10 +490,20 @@ namespace OpenSim
420 } 490 }
421 } 491 }
422 492
493 if (scene.SnmpService != null)
494 {
495 scene.SnmpService.BootInfo("Initializing region modules", scene);
496 }
423 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; 497 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
424 498
425 mscene = scene; 499 mscene = scene;
426 500
501 if (scene.SnmpService != null)
502 {
503 scene.SnmpService.BootInfo("The region is operational", scene);
504 scene.SnmpService.LinkUp(scene);
505 }
506
427 return clientServers; 507 return clientServers;
428 } 508 }
429 509
@@ -539,6 +619,11 @@ namespace OpenSim
539 private void ShutdownRegion(Scene scene) 619 private void ShutdownRegion(Scene scene)
540 { 620 {
541 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 621 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
622 if (scene.SnmpService != null)
623 {
624 scene.SnmpService.BootInfo("The region is shutting down", scene);
625 scene.SnmpService.LinkDown(scene);
626 }
542 IRegionModulesController controller; 627 IRegionModulesController controller;
543 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 628 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
544 { 629 {
@@ -1048,4 +1133,4 @@ namespace OpenSim
1048 { 1133 {
1049 public IConfigSource Source; 1134 public IConfigSource Source;
1050 } 1135 }
1051} \ No newline at end of file 1136}