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 54caac4..8d38bb8 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -91,6 +91,10 @@ namespace OpenSim | |||
91 | 91 | ||
92 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 92 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
93 | 93 | ||
94 | private List<string> m_permsModules; | ||
95 | |||
96 | private bool m_securePermissionsLoading = true; | ||
97 | |||
94 | /// <value> | 98 | /// <value> |
95 | /// The config information passed into the OpenSimulator region server. | 99 | /// The config information passed into the OpenSimulator region server. |
96 | /// </value> | 100 | /// </value> |
@@ -188,6 +192,11 @@ namespace OpenSim | |||
188 | CreatePIDFile(pidFile); | 192 | CreatePIDFile(pidFile); |
189 | 193 | ||
190 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 194 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
195 | |||
196 | m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); | ||
197 | |||
198 | string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
199 | m_permsModules = new List<string>(permissionModules.Split(',')); | ||
191 | } | 200 | } |
192 | 201 | ||
193 | // Load the simulation data service | 202 | // Load the simulation data service |
@@ -216,6 +225,12 @@ namespace OpenSim | |||
216 | m_moduleLoader = new ModuleLoader(m_config.Source); | 225 | m_moduleLoader = new ModuleLoader(m_config.Source); |
217 | 226 | ||
218 | LoadPlugins(); | 227 | LoadPlugins(); |
228 | |||
229 | if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch! | ||
230 | { | ||
231 | Environment.Exit(1); | ||
232 | } | ||
233 | |||
219 | foreach (IApplicationPlugin plugin in m_plugins) | 234 | foreach (IApplicationPlugin plugin in m_plugins) |
220 | { | 235 | { |
221 | plugin.PostInitialise(); | 236 | plugin.PostInitialise(); |
@@ -363,7 +378,41 @@ namespace OpenSim | |||
363 | } | 378 | } |
364 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); | 379 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); |
365 | 380 | ||
381 | if (m_securePermissionsLoading) | ||
382 | { | ||
383 | foreach (string s in m_permsModules) | ||
384 | { | ||
385 | if (!scene.RegionModules.ContainsKey(s)) | ||
386 | { | ||
387 | bool found = false; | ||
388 | foreach (IRegionModule m in modules) | ||
389 | { | ||
390 | if (m.Name == s) | ||
391 | { | ||
392 | found = true; | ||
393 | } | ||
394 | } | ||
395 | if (!found) | ||
396 | { | ||
397 | m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
398 | Environment.Exit(0); | ||
399 | } | ||
400 | } | ||
401 | } | ||
402 | } | ||
403 | |||
366 | scene.SetModuleInterfaces(); | 404 | scene.SetModuleInterfaces(); |
405 | // First Step of bootreport sequence | ||
406 | if (scene.SnmpService != null) | ||
407 | { | ||
408 | scene.SnmpService.ColdStart(1,scene); | ||
409 | scene.SnmpService.LinkDown(scene); | ||
410 | } | ||
411 | |||
412 | if (scene.SnmpService != null) | ||
413 | { | ||
414 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
415 | } | ||
367 | 416 | ||
368 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | 417 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) |
369 | SetUpEstateOwner(scene); | 418 | SetUpEstateOwner(scene); |
@@ -374,6 +423,10 @@ namespace OpenSim | |||
374 | // TODO : Try setting resource for region xstats here on scene | 423 | // TODO : Try setting resource for region xstats here on scene |
375 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); | 424 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); |
376 | 425 | ||
426 | if (scene.SnmpService != null) | ||
427 | { | ||
428 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
429 | } | ||
377 | try | 430 | try |
378 | { | 431 | { |
379 | scene.RegisterRegionWithGrid(); | 432 | scene.RegisterRegionWithGrid(); |
@@ -384,11 +437,20 @@ namespace OpenSim | |||
384 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | 437 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", |
385 | e.Message, e.StackTrace); | 438 | e.Message, e.StackTrace); |
386 | 439 | ||
440 | if (scene.SnmpService != null) | ||
441 | { | ||
442 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
443 | } | ||
387 | // Carrying on now causes a lot of confusion down the | 444 | // Carrying on now causes a lot of confusion down the |
388 | // line - we need to get the user's attention | 445 | // line - we need to get the user's attention |
389 | Environment.Exit(1); | 446 | Environment.Exit(1); |
390 | } | 447 | } |
391 | 448 | ||
449 | if (scene.SnmpService != null) | ||
450 | { | ||
451 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
452 | } | ||
453 | |||
392 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 454 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
393 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 455 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
394 | 456 | ||
@@ -396,6 +458,11 @@ namespace OpenSim | |||
396 | // scripting engines. | 458 | // scripting engines. |
397 | scene.CreateScriptInstances(); | 459 | scene.CreateScriptInstances(); |
398 | 460 | ||
461 | if (scene.SnmpService != null) | ||
462 | { | ||
463 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
464 | } | ||
465 | |||
399 | m_sceneManager.Add(scene); | 466 | m_sceneManager.Add(scene); |
400 | 467 | ||
401 | if (m_autoCreateClientStack) | 468 | if (m_autoCreateClientStack) |
@@ -404,6 +471,10 @@ namespace OpenSim | |||
404 | clientServer.Start(); | 471 | clientServer.Start(); |
405 | } | 472 | } |
406 | 473 | ||
474 | if (scene.SnmpService != null) | ||
475 | { | ||
476 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
477 | } | ||
407 | if (do_post_init) | 478 | if (do_post_init) |
408 | { | 479 | { |
409 | foreach (IRegionModule module in modules) | 480 | foreach (IRegionModule module in modules) |
@@ -415,7 +486,14 @@ namespace OpenSim | |||
415 | 486 | ||
416 | mscene = scene; | 487 | mscene = scene; |
417 | 488 | ||
489 | if (scene.SnmpService != null) | ||
490 | { | ||
491 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
492 | scene.SnmpService.LinkUp(scene); | ||
493 | } | ||
494 | |||
418 | scene.StartTimer(); | 495 | scene.StartTimer(); |
496 | scene.StartTimerWatchdog(); | ||
419 | 497 | ||
420 | scene.StartScripts(); | 498 | scene.StartScripts(); |
421 | 499 | ||
@@ -483,6 +561,11 @@ namespace OpenSim | |||
483 | private void ShutdownRegion(Scene scene) | 561 | private void ShutdownRegion(Scene scene) |
484 | { | 562 | { |
485 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 563 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
564 | if (scene.SnmpService != null) | ||
565 | { | ||
566 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
567 | scene.SnmpService.LinkDown(scene); | ||
568 | } | ||
486 | IRegionModulesController controller; | 569 | IRegionModulesController controller; |
487 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 570 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
488 | { | 571 | { |
@@ -926,7 +1009,7 @@ namespace OpenSim | |||
926 | = MainConsole.Instance.CmdPrompt( | 1009 | = MainConsole.Instance.CmdPrompt( |
927 | string.Format( | 1010 | string.Format( |
928 | "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), | 1011 | "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), |
929 | "yes", | 1012 | "no", |
930 | new List<string>() { "yes", "no" }); | 1013 | new List<string>() { "yes", "no" }); |
931 | 1014 | ||
932 | if (response == "no") | 1015 | if (response == "no") |
@@ -942,12 +1025,15 @@ namespace OpenSim | |||
942 | = MainConsole.Instance.CmdPrompt( | 1025 | = MainConsole.Instance.CmdPrompt( |
943 | string.Format( | 1026 | string.Format( |
944 | "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), | 1027 | "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), |
945 | estateNames[0]); | 1028 | "None"); |
1029 | |||
1030 | if (response == "None") | ||
1031 | continue; | ||
946 | 1032 | ||
947 | List<int> estateIDs = EstateDataService.GetEstates(response); | 1033 | List<int> estateIDs = EstateDataService.GetEstates(response); |
948 | if (estateIDs.Count < 1) | 1034 | if (estateIDs.Count < 1) |
949 | { | 1035 | { |
950 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); | 1036 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); |
951 | continue; | 1037 | continue; |
952 | } | 1038 | } |
953 | 1039 | ||