diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index eb18e83..c08da18 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -88,6 +88,10 @@ namespace OpenSim | |||
88 | 88 | ||
89 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 89 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
90 | 90 | ||
91 | private List<string> m_permsModules; | ||
92 | |||
93 | private bool m_securePermissionsLoading = true; | ||
94 | |||
91 | /// <value> | 95 | /// <value> |
92 | /// The config information passed into the OpenSimulator region server. | 96 | /// The config information passed into the OpenSimulator region server. |
93 | /// </value> | 97 | /// </value> |
@@ -185,6 +189,11 @@ namespace OpenSim | |||
185 | CreatePIDFile(pidFile); | 189 | CreatePIDFile(pidFile); |
186 | 190 | ||
187 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 191 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
192 | |||
193 | m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); | ||
194 | |||
195 | string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
196 | m_permsModules = new List<string>(permissionModules.Split(',')); | ||
188 | } | 197 | } |
189 | 198 | ||
190 | base.StartupSpecific(); | 199 | base.StartupSpecific(); |
@@ -342,11 +351,50 @@ namespace OpenSim | |||
342 | } | 351 | } |
343 | else m_log.Error("[MODULES]: The new RegionModulesController is missing..."); | 352 | else m_log.Error("[MODULES]: The new RegionModulesController is missing..."); |
344 | 353 | ||
354 | if (m_securePermissionsLoading) | ||
355 | { | ||
356 | foreach (string s in m_permsModules) | ||
357 | { | ||
358 | if (!scene.RegionModules.ContainsKey(s)) | ||
359 | { | ||
360 | bool found = false; | ||
361 | foreach (IRegionModule m in modules) | ||
362 | { | ||
363 | if (m.Name == s) | ||
364 | { | ||
365 | found = true; | ||
366 | } | ||
367 | } | ||
368 | if (!found) | ||
369 | { | ||
370 | m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
371 | Environment.Exit(0); | ||
372 | } | ||
373 | } | ||
374 | } | ||
375 | } | ||
376 | |||
345 | scene.SetModuleInterfaces(); | 377 | scene.SetModuleInterfaces(); |
378 | // First Step of bootreport sequence | ||
379 | if (scene.SnmpService != null) | ||
380 | { | ||
381 | scene.SnmpService.ColdStart(1,scene); | ||
382 | scene.SnmpService.LinkDown(scene); | ||
383 | } | ||
384 | |||
385 | if (scene.SnmpService != null) | ||
386 | { | ||
387 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
388 | } | ||
346 | 389 | ||
347 | // Prims have to be loaded after module configuration since some modules may be invoked during the load | 390 | // Prims have to be loaded after module configuration since some modules may be invoked during the load |
348 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); | 391 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); |
349 | 392 | ||
393 | if (scene.SnmpService != null) | ||
394 | { | ||
395 | scene.SnmpService.BootInfo("Creating region texture", scene); | ||
396 | } | ||
397 | |||
350 | // moved these here as the map texture has to be created after the modules are initialized | 398 | // moved these here as the map texture has to be created after the modules are initialized |
351 | // and has to happen before the region is registered with the grid. | 399 | // and has to happen before the region is registered with the grid. |
352 | IWorldMapModule mapModule = scene.RequestModuleInterface<IWorldMapModule>(); | 400 | IWorldMapModule mapModule = scene.RequestModuleInterface<IWorldMapModule>(); |
@@ -358,6 +406,10 @@ namespace OpenSim | |||
358 | // TODO : Try setting resource for region xstats here on scene | 406 | // TODO : Try setting resource for region xstats here on scene |
359 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); | 407 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); |
360 | 408 | ||
409 | if (scene.SnmpService != null) | ||
410 | { | ||
411 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
412 | } | ||
361 | try | 413 | try |
362 | { | 414 | { |
363 | scene.RegisterRegionWithGrid(); | 415 | scene.RegisterRegionWithGrid(); |
@@ -366,11 +418,20 @@ namespace OpenSim | |||
366 | { | 418 | { |
367 | m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace); | 419 | m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace); |
368 | 420 | ||
421 | if (scene.SnmpService != null) | ||
422 | { | ||
423 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
424 | } | ||
369 | // Carrying on now causes a lot of confusion down the | 425 | // Carrying on now causes a lot of confusion down the |
370 | // line - we need to get the user's attention | 426 | // line - we need to get the user's attention |
371 | Environment.Exit(1); | 427 | Environment.Exit(1); |
372 | } | 428 | } |
373 | 429 | ||
430 | if (scene.SnmpService != null) | ||
431 | { | ||
432 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
433 | } | ||
434 | |||
374 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 435 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
375 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 436 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
376 | 437 | ||
@@ -378,6 +439,11 @@ namespace OpenSim | |||
378 | // scripting engines. | 439 | // scripting engines. |
379 | scene.CreateScriptInstances(); | 440 | scene.CreateScriptInstances(); |
380 | 441 | ||
442 | if (scene.SnmpService != null) | ||
443 | { | ||
444 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
445 | } | ||
446 | |||
381 | m_sceneManager.Add(scene); | 447 | m_sceneManager.Add(scene); |
382 | 448 | ||
383 | if (m_autoCreateClientStack) | 449 | if (m_autoCreateClientStack) |
@@ -386,6 +452,10 @@ namespace OpenSim | |||
386 | clientServer.Start(); | 452 | clientServer.Start(); |
387 | } | 453 | } |
388 | 454 | ||
455 | if (scene.SnmpService != null) | ||
456 | { | ||
457 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
458 | } | ||
389 | if (do_post_init) | 459 | if (do_post_init) |
390 | { | 460 | { |
391 | foreach (IRegionModule module in modules) | 461 | foreach (IRegionModule module in modules) |
@@ -397,6 +467,12 @@ namespace OpenSim | |||
397 | 467 | ||
398 | mscene = scene; | 468 | mscene = scene; |
399 | 469 | ||
470 | if (scene.SnmpService != null) | ||
471 | { | ||
472 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
473 | scene.SnmpService.LinkUp(scene); | ||
474 | } | ||
475 | |||
400 | scene.StartTimer(); | 476 | scene.StartTimer(); |
401 | 477 | ||
402 | return clientServer; | 478 | return clientServer; |
@@ -405,6 +481,11 @@ namespace OpenSim | |||
405 | private void ShutdownRegion(Scene scene) | 481 | private void ShutdownRegion(Scene scene) |
406 | { | 482 | { |
407 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 483 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
484 | if (scene.SnmpService != null) | ||
485 | { | ||
486 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
487 | scene.SnmpService.LinkDown(scene); | ||
488 | } | ||
408 | IRegionModulesController controller; | 489 | IRegionModulesController controller; |
409 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 490 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
410 | { | 491 | { |