diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 92 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 87 |
2 files changed, 171 insertions, 8 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index c2d9942..85049c9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -297,10 +297,20 @@ namespace OpenSim | |||
297 | HandleEditScale); | 297 | HandleEditScale); |
298 | 298 | ||
299 | m_console.Commands.AddCommand("Objects", false, "rotate scene", | 299 | m_console.Commands.AddCommand("Objects", false, "rotate scene", |
300 | "rotate scene <degrees>", | 300 | "rotate scene <degrees> [centerX, centerY]", |
301 | "Rotates all scene objects around x:128, y:128", | 301 | "Rotates all scene objects around centerX, centerY (defailt 128, 128) (please back up your region before using)", |
302 | HandleRotateScene); | 302 | HandleRotateScene); |
303 | 303 | ||
304 | m_console.Commands.AddCommand("Objects", false, "scale scene", | ||
305 | "scale scene <factor>", | ||
306 | "Scales the scene objects (please back up your region before using)", | ||
307 | HandleScaleScene); | ||
308 | |||
309 | m_console.Commands.AddCommand("Objects", false, "translate scene", | ||
310 | "translate scene xOffset yOffset zOffset", | ||
311 | "translates the scene objects (please back up your region before using)", | ||
312 | HandleTranslateScene); | ||
313 | |||
304 | m_console.Commands.AddCommand("Users", false, "kick user", | 314 | m_console.Commands.AddCommand("Users", false, "kick user", |
305 | "kick user <first> <last> [--force] [message]", | 315 | "kick user <first> <last> [--force] [message]", |
306 | "Kick a user off the simulator", | 316 | "Kick a user off the simulator", |
@@ -455,7 +465,7 @@ namespace OpenSim | |||
455 | if (alert != null) | 465 | if (alert != null) |
456 | presence.ControllingClient.Kick(alert); | 466 | presence.ControllingClient.Kick(alert); |
457 | else | 467 | else |
458 | presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); | 468 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); |
459 | 469 | ||
460 | presence.Scene.CloseAgent(presence.UUID, force); | 470 | presence.Scene.CloseAgent(presence.UUID, force); |
461 | break; | 471 | break; |
@@ -549,6 +559,82 @@ namespace OpenSim | |||
549 | }); | 559 | }); |
550 | } | 560 | } |
551 | 561 | ||
562 | private void HandleScaleScene(string module, string[] args) | ||
563 | { | ||
564 | string usage = "Usage: scale scene <factor>"; | ||
565 | |||
566 | if (args.Length < 3) | ||
567 | { | ||
568 | MainConsole.Instance.Output(usage); | ||
569 | return; | ||
570 | } | ||
571 | |||
572 | float factor = (float)(Convert.ToSingle(args[2])); | ||
573 | |||
574 | float minZ = float.MaxValue; | ||
575 | |||
576 | SceneManager.ForEachSelectedScene(delegate(Scene scene) | ||
577 | { | ||
578 | scene.ForEachSOG(delegate(SceneObjectGroup sog) | ||
579 | { | ||
580 | if (sog.AttachmentPoint == 0) | ||
581 | { | ||
582 | if (sog.RootPart.AbsolutePosition.Z < minZ) | ||
583 | minZ = sog.RootPart.AbsolutePosition.Z; | ||
584 | } | ||
585 | }); | ||
586 | }); | ||
587 | |||
588 | SceneManager.ForEachSelectedScene(delegate(Scene scene) | ||
589 | { | ||
590 | scene.ForEachSOG(delegate(SceneObjectGroup sog) | ||
591 | { | ||
592 | if (sog.AttachmentPoint == 0) | ||
593 | { | ||
594 | Vector3 tmpRootPos = sog.RootPart.AbsolutePosition; | ||
595 | tmpRootPos.Z -= minZ; | ||
596 | tmpRootPos *= factor; | ||
597 | tmpRootPos.Z += minZ; | ||
598 | |||
599 | foreach (SceneObjectPart sop in sog.Parts) | ||
600 | { | ||
601 | if (sop.ParentID != 0) | ||
602 | sop.OffsetPosition *= factor; | ||
603 | sop.Scale *= factor; | ||
604 | } | ||
605 | |||
606 | sog.UpdateGroupPosition(tmpRootPos); | ||
607 | } | ||
608 | }); | ||
609 | }); | ||
610 | } | ||
611 | |||
612 | private void HandleTranslateScene(string module, string[] args) | ||
613 | { | ||
614 | string usage = "Usage: translate scene <xOffset, yOffset, zOffset>"; | ||
615 | |||
616 | if (args.Length < 5) | ||
617 | { | ||
618 | MainConsole.Instance.Output(usage); | ||
619 | return; | ||
620 | } | ||
621 | |||
622 | float xOFfset = (float)Convert.ToSingle(args[2]); | ||
623 | float yOffset = (float)Convert.ToSingle(args[3]); | ||
624 | float zOffset = (float)Convert.ToSingle(args[4]); | ||
625 | |||
626 | Vector3 offset = new Vector3(xOFfset, yOffset, zOffset); | ||
627 | |||
628 | SceneManager.ForEachSelectedScene(delegate(Scene scene) | ||
629 | { | ||
630 | scene.ForEachSOG(delegate(SceneObjectGroup sog) | ||
631 | { | ||
632 | if (sog.AttachmentPoint == 0) | ||
633 | sog.UpdateGroupPosition(sog.AbsolutePosition + offset); | ||
634 | }); | ||
635 | }); | ||
636 | } | ||
637 | |||
552 | /// <summary> | 638 | /// <summary> |
553 | /// Creates a new region based on the parameters specified. This will ask the user questions on the console | 639 | /// Creates a new region based on the parameters specified. This will ask the user questions on the console |
554 | /// </summary> | 640 | /// </summary> |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 308638c..f663c77 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -98,6 +98,10 @@ namespace OpenSim | |||
98 | 98 | ||
99 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 99 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
100 | 100 | ||
101 | private List<string> m_permsModules; | ||
102 | |||
103 | private bool m_securePermissionsLoading = true; | ||
104 | |||
101 | /// <value> | 105 | /// <value> |
102 | /// The config information passed into the OpenSimulator region server. | 106 | /// The config information passed into the OpenSimulator region server. |
103 | /// </value> | 107 | /// </value> |
@@ -189,6 +193,14 @@ namespace OpenSim | |||
189 | CreatePIDFile(pidFile); | 193 | CreatePIDFile(pidFile); |
190 | 194 | ||
191 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 195 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
196 | |||
197 | m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); | ||
198 | |||
199 | string permissionModules = Util.GetConfigVarFromSections<string>(Config, "permissionmodules", | ||
200 | new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); | ||
201 | |||
202 | m_permsModules = new List<string>(permissionModules.Split(',')); | ||
203 | |||
192 | managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); | 204 | managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); |
193 | } | 205 | } |
194 | 206 | ||
@@ -227,6 +239,12 @@ namespace OpenSim | |||
227 | base.StartupSpecific(); | 239 | base.StartupSpecific(); |
228 | 240 | ||
229 | LoadPlugins(); | 241 | LoadPlugins(); |
242 | |||
243 | if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch! | ||
244 | { | ||
245 | Environment.Exit(1); | ||
246 | } | ||
247 | |||
230 | foreach (IApplicationPlugin plugin in m_plugins) | 248 | foreach (IApplicationPlugin plugin in m_plugins) |
231 | { | 249 | { |
232 | plugin.PostInitialise(); | 250 | plugin.PostInitialise(); |
@@ -250,10 +268,10 @@ namespace OpenSim | |||
250 | "help " + capitalizedTopic, | 268 | "help " + capitalizedTopic, |
251 | "Get help on plugin command '" + topic + "'", | 269 | "Get help on plugin command '" + topic + "'", |
252 | HandleCommanderHelp); | 270 | HandleCommanderHelp); |
253 | console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, | 271 | // console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, |
254 | "help " + capitalizedTopic, | 272 | // "help " + capitalizedTopic, |
255 | "Get help on plugin command '" + topic + "'", | 273 | // "Get help on plugin command '" + topic + "'", |
256 | HandleCommanderHelp); | 274 | // HandleCommanderHelp); |
257 | 275 | ||
258 | ICommander commander = null; | 276 | ICommander commander = null; |
259 | 277 | ||
@@ -376,7 +394,32 @@ namespace OpenSim | |||
376 | } | 394 | } |
377 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); | 395 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); |
378 | 396 | ||
397 | if (m_securePermissionsLoading) | ||
398 | { | ||
399 | foreach (string s in m_permsModules) | ||
400 | { | ||
401 | if (!scene.RegionModules.ContainsKey(s)) | ||
402 | { | ||
403 | m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
404 | Environment.Exit(0); | ||
405 | } | ||
406 | } | ||
407 | |||
408 | m_log.InfoFormat("[SCENE]: Secure permissions loading enabled, modules loaded: {0}", String.Join(" ", m_permsModules.ToArray())); | ||
409 | } | ||
410 | |||
379 | scene.SetModuleInterfaces(); | 411 | scene.SetModuleInterfaces(); |
412 | // First Step of bootreport sequence | ||
413 | if (scene.SnmpService != null) | ||
414 | { | ||
415 | scene.SnmpService.ColdStart(1,scene); | ||
416 | scene.SnmpService.LinkDown(scene); | ||
417 | } | ||
418 | |||
419 | if (scene.SnmpService != null) | ||
420 | { | ||
421 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
422 | } | ||
380 | 423 | ||
381 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | 424 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) |
382 | SetUpEstateOwner(scene); | 425 | SetUpEstateOwner(scene); |
@@ -390,6 +433,11 @@ namespace OpenSim | |||
390 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 433 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
391 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 434 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
392 | 435 | ||
436 | if (scene.SnmpService != null) | ||
437 | { | ||
438 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
439 | } | ||
440 | |||
393 | try | 441 | try |
394 | { | 442 | { |
395 | scene.RegisterRegionWithGrid(); | 443 | scene.RegisterRegionWithGrid(); |
@@ -400,15 +448,29 @@ namespace OpenSim | |||
400 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | 448 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", |
401 | e.Message, e.StackTrace); | 449 | e.Message, e.StackTrace); |
402 | 450 | ||
451 | if (scene.SnmpService != null) | ||
452 | { | ||
453 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
454 | } | ||
403 | // Carrying on now causes a lot of confusion down the | 455 | // Carrying on now causes a lot of confusion down the |
404 | // line - we need to get the user's attention | 456 | // line - we need to get the user's attention |
405 | Environment.Exit(1); | 457 | Environment.Exit(1); |
406 | } | 458 | } |
407 | 459 | ||
460 | if (scene.SnmpService != null) | ||
461 | { | ||
462 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
463 | } | ||
464 | |||
408 | // We need to do this after we've initialized the | 465 | // We need to do this after we've initialized the |
409 | // scripting engines. | 466 | // scripting engines. |
410 | scene.CreateScriptInstances(); | 467 | scene.CreateScriptInstances(); |
411 | 468 | ||
469 | if (scene.SnmpService != null) | ||
470 | { | ||
471 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
472 | } | ||
473 | |||
412 | SceneManager.Add(scene); | 474 | SceneManager.Add(scene); |
413 | 475 | ||
414 | if (m_autoCreateClientStack) | 476 | if (m_autoCreateClientStack) |
@@ -420,10 +482,20 @@ namespace OpenSim | |||
420 | } | 482 | } |
421 | } | 483 | } |
422 | 484 | ||
485 | if (scene.SnmpService != null) | ||
486 | { | ||
487 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
488 | } | ||
423 | scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; | 489 | scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; |
424 | 490 | ||
425 | mscene = scene; | 491 | mscene = scene; |
426 | 492 | ||
493 | if (scene.SnmpService != null) | ||
494 | { | ||
495 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
496 | scene.SnmpService.LinkUp(scene); | ||
497 | } | ||
498 | |||
427 | return clientServers; | 499 | return clientServers; |
428 | } | 500 | } |
429 | 501 | ||
@@ -539,6 +611,11 @@ namespace OpenSim | |||
539 | private void ShutdownRegion(Scene scene) | 611 | private void ShutdownRegion(Scene scene) |
540 | { | 612 | { |
541 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 613 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
614 | if (scene.SnmpService != null) | ||
615 | { | ||
616 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
617 | scene.SnmpService.LinkDown(scene); | ||
618 | } | ||
542 | IRegionModulesController controller; | 619 | IRegionModulesController controller; |
543 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 620 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
544 | { | 621 | { |
@@ -1048,4 +1125,4 @@ namespace OpenSim | |||
1048 | { | 1125 | { |
1049 | public IConfigSource Source; | 1126 | public IConfigSource Source; |
1050 | } | 1127 | } |
1051 | } \ No newline at end of file | 1128 | } |