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