diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 92 |
1 files changed, 89 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index a680a59..df6a17b 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -93,6 +93,10 @@ namespace OpenSim | |||
93 | 93 | ||
94 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 94 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
95 | 95 | ||
96 | private List<string> m_permsModules; | ||
97 | |||
98 | private bool m_securePermissionsLoading = true; | ||
99 | |||
96 | /// <value> | 100 | /// <value> |
97 | /// The config information passed into the OpenSimulator region server. | 101 | /// The config information passed into the OpenSimulator region server. |
98 | /// </value> | 102 | /// </value> |
@@ -197,6 +201,11 @@ namespace OpenSim | |||
197 | CreatePIDFile(pidFile); | 201 | CreatePIDFile(pidFile); |
198 | 202 | ||
199 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 203 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
204 | |||
205 | m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); | ||
206 | |||
207 | string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
208 | m_permsModules = new List<string>(permissionModules.Split(',')); | ||
200 | } | 209 | } |
201 | 210 | ||
202 | // Load the simulation data service | 211 | // Load the simulation data service |
@@ -225,6 +234,12 @@ namespace OpenSim | |||
225 | m_moduleLoader = new ModuleLoader(m_config.Source); | 234 | m_moduleLoader = new ModuleLoader(m_config.Source); |
226 | 235 | ||
227 | LoadPlugins(); | 236 | LoadPlugins(); |
237 | |||
238 | if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch! | ||
239 | { | ||
240 | Environment.Exit(1); | ||
241 | } | ||
242 | |||
228 | foreach (IApplicationPlugin plugin in m_plugins) | 243 | foreach (IApplicationPlugin plugin in m_plugins) |
229 | { | 244 | { |
230 | plugin.PostInitialise(); | 245 | plugin.PostInitialise(); |
@@ -372,7 +387,41 @@ namespace OpenSim | |||
372 | } | 387 | } |
373 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); | 388 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); |
374 | 389 | ||
390 | if (m_securePermissionsLoading) | ||
391 | { | ||
392 | foreach (string s in m_permsModules) | ||
393 | { | ||
394 | if (!scene.RegionModules.ContainsKey(s)) | ||
395 | { | ||
396 | bool found = false; | ||
397 | foreach (IRegionModule m in modules) | ||
398 | { | ||
399 | if (m.Name == s) | ||
400 | { | ||
401 | found = true; | ||
402 | } | ||
403 | } | ||
404 | if (!found) | ||
405 | { | ||
406 | m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
407 | Environment.Exit(0); | ||
408 | } | ||
409 | } | ||
410 | } | ||
411 | } | ||
412 | |||
375 | scene.SetModuleInterfaces(); | 413 | scene.SetModuleInterfaces(); |
414 | // First Step of bootreport sequence | ||
415 | if (scene.SnmpService != null) | ||
416 | { | ||
417 | scene.SnmpService.ColdStart(1,scene); | ||
418 | scene.SnmpService.LinkDown(scene); | ||
419 | } | ||
420 | |||
421 | if (scene.SnmpService != null) | ||
422 | { | ||
423 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
424 | } | ||
376 | 425 | ||
377 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | 426 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) |
378 | SetUpEstateOwner(scene); | 427 | SetUpEstateOwner(scene); |
@@ -383,6 +432,10 @@ namespace OpenSim | |||
383 | // TODO : Try setting resource for region xstats here on scene | 432 | // TODO : Try setting resource for region xstats here on scene |
384 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); | 433 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); |
385 | 434 | ||
435 | if (scene.SnmpService != null) | ||
436 | { | ||
437 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
438 | } | ||
386 | try | 439 | try |
387 | { | 440 | { |
388 | scene.RegisterRegionWithGrid(); | 441 | scene.RegisterRegionWithGrid(); |
@@ -393,11 +446,20 @@ namespace OpenSim | |||
393 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | 446 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", |
394 | e.Message, e.StackTrace); | 447 | e.Message, e.StackTrace); |
395 | 448 | ||
449 | if (scene.SnmpService != null) | ||
450 | { | ||
451 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
452 | } | ||
396 | // Carrying on now causes a lot of confusion down the | 453 | // Carrying on now causes a lot of confusion down the |
397 | // line - we need to get the user's attention | 454 | // line - we need to get the user's attention |
398 | Environment.Exit(1); | 455 | Environment.Exit(1); |
399 | } | 456 | } |
400 | 457 | ||
458 | if (scene.SnmpService != null) | ||
459 | { | ||
460 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
461 | } | ||
462 | |||
401 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 463 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
402 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 464 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
403 | 465 | ||
@@ -405,6 +467,11 @@ namespace OpenSim | |||
405 | // scripting engines. | 467 | // scripting engines. |
406 | scene.CreateScriptInstances(); | 468 | scene.CreateScriptInstances(); |
407 | 469 | ||
470 | if (scene.SnmpService != null) | ||
471 | { | ||
472 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
473 | } | ||
474 | |||
408 | m_sceneManager.Add(scene); | 475 | m_sceneManager.Add(scene); |
409 | 476 | ||
410 | if (m_autoCreateClientStack) | 477 | if (m_autoCreateClientStack) |
@@ -413,6 +480,10 @@ namespace OpenSim | |||
413 | clientServer.Start(); | 480 | clientServer.Start(); |
414 | } | 481 | } |
415 | 482 | ||
483 | if (scene.SnmpService != null) | ||
484 | { | ||
485 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
486 | } | ||
416 | if (do_post_init) | 487 | if (do_post_init) |
417 | { | 488 | { |
418 | foreach (IRegionModule module in modules) | 489 | foreach (IRegionModule module in modules) |
@@ -424,7 +495,14 @@ namespace OpenSim | |||
424 | 495 | ||
425 | mscene = scene; | 496 | mscene = scene; |
426 | 497 | ||
498 | if (scene.SnmpService != null) | ||
499 | { | ||
500 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
501 | scene.SnmpService.LinkUp(scene); | ||
502 | } | ||
503 | |||
427 | scene.StartTimer(); | 504 | scene.StartTimer(); |
505 | scene.StartTimerWatchdog(); | ||
428 | 506 | ||
429 | scene.StartScripts(); | 507 | scene.StartScripts(); |
430 | 508 | ||
@@ -501,6 +579,11 @@ namespace OpenSim | |||
501 | private void ShutdownRegion(Scene scene) | 579 | private void ShutdownRegion(Scene scene) |
502 | { | 580 | { |
503 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 581 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
582 | if (scene.SnmpService != null) | ||
583 | { | ||
584 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
585 | scene.SnmpService.LinkDown(scene); | ||
586 | } | ||
504 | IRegionModulesController controller; | 587 | IRegionModulesController controller; |
505 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 588 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
506 | { | 589 | { |
@@ -944,7 +1027,7 @@ namespace OpenSim | |||
944 | = MainConsole.Instance.CmdPrompt( | 1027 | = MainConsole.Instance.CmdPrompt( |
945 | string.Format( | 1028 | string.Format( |
946 | "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), | 1029 | "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), |
947 | "yes", | 1030 | "no", |
948 | new List<string>() { "yes", "no" }); | 1031 | new List<string>() { "yes", "no" }); |
949 | 1032 | ||
950 | if (response == "no") | 1033 | if (response == "no") |
@@ -960,12 +1043,15 @@ namespace OpenSim | |||
960 | = MainConsole.Instance.CmdPrompt( | 1043 | = MainConsole.Instance.CmdPrompt( |
961 | string.Format( | 1044 | string.Format( |
962 | "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), | 1045 | "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), |
963 | estateNames[0]); | 1046 | "None"); |
1047 | |||
1048 | if (response == "None") | ||
1049 | continue; | ||
964 | 1050 | ||
965 | List<int> estateIDs = EstateDataService.GetEstates(response); | 1051 | List<int> estateIDs = EstateDataService.GetEstates(response); |
966 | if (estateIDs.Count < 1) | 1052 | if (estateIDs.Count < 1) |
967 | { | 1053 | { |
968 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); | 1054 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); |
969 | continue; | 1055 | continue; |
970 | } | 1056 | } |
971 | 1057 | ||