diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 94 |
1 files changed, 89 insertions, 5 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 137bd81..7497d88 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -97,6 +97,10 @@ namespace OpenSim | |||
97 | 97 | ||
98 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 98 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
99 | 99 | ||
100 | private List<string> m_permsModules; | ||
101 | |||
102 | private bool m_securePermissionsLoading = true; | ||
103 | |||
100 | /// <value> | 104 | /// <value> |
101 | /// The config information passed into the OpenSimulator region server. | 105 | /// The config information passed into the OpenSimulator region server. |
102 | /// </value> | 106 | /// </value> |
@@ -192,6 +196,11 @@ namespace OpenSim | |||
192 | CreatePIDFile(pidFile); | 196 | CreatePIDFile(pidFile); |
193 | 197 | ||
194 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 198 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
199 | |||
200 | m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); | ||
201 | |||
202 | string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
203 | m_permsModules = new List<string>(permissionModules.Split(',')); | ||
195 | } | 204 | } |
196 | 205 | ||
197 | // Load the simulation data service | 206 | // Load the simulation data service |
@@ -229,6 +238,12 @@ namespace OpenSim | |||
229 | base.StartupSpecific(); | 238 | base.StartupSpecific(); |
230 | 239 | ||
231 | LoadPlugins(); | 240 | LoadPlugins(); |
241 | |||
242 | if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch! | ||
243 | { | ||
244 | Environment.Exit(1); | ||
245 | } | ||
246 | |||
232 | foreach (IApplicationPlugin plugin in m_plugins) | 247 | foreach (IApplicationPlugin plugin in m_plugins) |
233 | { | 248 | { |
234 | plugin.PostInitialise(); | 249 | plugin.PostInitialise(); |
@@ -255,10 +270,10 @@ namespace OpenSim | |||
255 | "help " + capitalizedTopic, | 270 | "help " + capitalizedTopic, |
256 | "Get help on plugin command '" + topic + "'", | 271 | "Get help on plugin command '" + topic + "'", |
257 | HandleCommanderHelp); | 272 | HandleCommanderHelp); |
258 | console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, | 273 | // console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, |
259 | "help " + capitalizedTopic, | 274 | // "help " + capitalizedTopic, |
260 | "Get help on plugin command '" + topic + "'", | 275 | // "Get help on plugin command '" + topic + "'", |
261 | HandleCommanderHelp); | 276 | // HandleCommanderHelp); |
262 | 277 | ||
263 | ICommander commander = null; | 278 | ICommander commander = null; |
264 | 279 | ||
@@ -381,7 +396,42 @@ namespace OpenSim | |||
381 | } | 396 | } |
382 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); | 397 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); |
383 | 398 | ||
399 | // XPTO: Fix this | ||
400 | // if (m_securePermissionsLoading) | ||
401 | // { | ||
402 | // foreach (string s in m_permsModules) | ||
403 | // { | ||
404 | // if (!scene.RegionModules.ContainsKey(s)) | ||
405 | // { | ||
406 | // bool found = false; | ||
407 | // foreach (IRegionModule m in modules) | ||
408 | // { | ||
409 | // if (m.Name == s) | ||
410 | // { | ||
411 | // found = true; | ||
412 | // } | ||
413 | // } | ||
414 | // if (!found) | ||
415 | // { | ||
416 | // m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
417 | // Environment.Exit(0); | ||
418 | // } | ||
419 | // } | ||
420 | // } | ||
421 | // } | ||
422 | |||
384 | scene.SetModuleInterfaces(); | 423 | scene.SetModuleInterfaces(); |
424 | // First Step of bootreport sequence | ||
425 | if (scene.SnmpService != null) | ||
426 | { | ||
427 | scene.SnmpService.ColdStart(1,scene); | ||
428 | scene.SnmpService.LinkDown(scene); | ||
429 | } | ||
430 | |||
431 | if (scene.SnmpService != null) | ||
432 | { | ||
433 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
434 | } | ||
385 | 435 | ||
386 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | 436 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) |
387 | SetUpEstateOwner(scene); | 437 | SetUpEstateOwner(scene); |
@@ -395,6 +445,11 @@ namespace OpenSim | |||
395 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 445 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
396 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 446 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
397 | 447 | ||
448 | if (scene.SnmpService != null) | ||
449 | { | ||
450 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
451 | } | ||
452 | |||
398 | try | 453 | try |
399 | { | 454 | { |
400 | scene.RegisterRegionWithGrid(); | 455 | scene.RegisterRegionWithGrid(); |
@@ -405,15 +460,29 @@ namespace OpenSim | |||
405 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | 460 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", |
406 | e.Message, e.StackTrace); | 461 | e.Message, e.StackTrace); |
407 | 462 | ||
463 | if (scene.SnmpService != null) | ||
464 | { | ||
465 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
466 | } | ||
408 | // Carrying on now causes a lot of confusion down the | 467 | // Carrying on now causes a lot of confusion down the |
409 | // line - we need to get the user's attention | 468 | // line - we need to get the user's attention |
410 | Environment.Exit(1); | 469 | Environment.Exit(1); |
411 | } | 470 | } |
412 | 471 | ||
472 | if (scene.SnmpService != null) | ||
473 | { | ||
474 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
475 | } | ||
476 | |||
413 | // We need to do this after we've initialized the | 477 | // We need to do this after we've initialized the |
414 | // scripting engines. | 478 | // scripting engines. |
415 | scene.CreateScriptInstances(); | 479 | scene.CreateScriptInstances(); |
416 | 480 | ||
481 | if (scene.SnmpService != null) | ||
482 | { | ||
483 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
484 | } | ||
485 | |||
417 | SceneManager.Add(scene); | 486 | SceneManager.Add(scene); |
418 | 487 | ||
419 | if (m_autoCreateClientStack) | 488 | if (m_autoCreateClientStack) |
@@ -425,10 +494,20 @@ namespace OpenSim | |||
425 | } | 494 | } |
426 | } | 495 | } |
427 | 496 | ||
497 | if (scene.SnmpService != null) | ||
498 | { | ||
499 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
500 | } | ||
428 | scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; | 501 | scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; |
429 | 502 | ||
430 | mscene = scene; | 503 | mscene = scene; |
431 | 504 | ||
505 | if (scene.SnmpService != null) | ||
506 | { | ||
507 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
508 | scene.SnmpService.LinkUp(scene); | ||
509 | } | ||
510 | |||
432 | scene.Start(); | 511 | scene.Start(); |
433 | scene.StartScripts(); | 512 | scene.StartScripts(); |
434 | 513 | ||
@@ -547,6 +626,11 @@ namespace OpenSim | |||
547 | private void ShutdownRegion(Scene scene) | 626 | private void ShutdownRegion(Scene scene) |
548 | { | 627 | { |
549 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 628 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
629 | if (scene.SnmpService != null) | ||
630 | { | ||
631 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
632 | scene.SnmpService.LinkDown(scene); | ||
633 | } | ||
550 | IRegionModulesController controller; | 634 | IRegionModulesController controller; |
551 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 635 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
552 | { | 636 | { |
@@ -1093,4 +1177,4 @@ namespace OpenSim | |||
1093 | { | 1177 | { |
1094 | public IConfigSource Source; | 1178 | public IConfigSource Source; |
1095 | } | 1179 | } |
1096 | } \ No newline at end of file | 1180 | } |