diff options
author | Melanie | 2012-10-12 19:05:06 +0100 |
---|---|---|
committer | Melanie | 2012-10-12 19:05:06 +0100 |
commit | 6ce93b22d1bc0f2a89c0d7a8d79bfe8c85a2d9b4 (patch) | |
tree | d81136f8cc2c602d5cc6b783e5cb3d23343a089e /OpenSim/Region/CoreModules/World | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | BulletSim: only use native sphere shape if it is a sphere. (diff) | |
download | opensim-SC_OLD-6ce93b22d1bc0f2a89c0d7a8d79bfe8c85a2d9b4.zip opensim-SC_OLD-6ce93b22d1bc0f2a89c0d7a8d79bfe8c85a2d9b4.tar.gz opensim-SC_OLD-6ce93b22d1bc0f2a89c0d7a8d79bfe8c85a2d9b4.tar.bz2 opensim-SC_OLD-6ce93b22d1bc0f2a89c0d7a8d79bfe8c85a2d9b4.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
3 files changed, 89 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index fdef9d8..5fd1bce 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -40,6 +40,7 @@ using OpenMetaverse; | |||
40 | using OpenSim.Framework; | 40 | using OpenSim.Framework; |
41 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
43 | using RegionFlags = OpenMetaverse.RegionFlags; | ||
43 | 44 | ||
44 | namespace OpenSim.Region.CoreModules.World.Estate | 45 | namespace OpenSim.Region.CoreModules.World.Estate |
45 | { | 46 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 4f06737..d5b2adb 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -33,6 +33,7 @@ using OpenMetaverse; | |||
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
35 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
36 | using RegionFlags = OpenMetaverse.RegionFlags; | ||
36 | 37 | ||
37 | namespace OpenSim.Region.CoreModules.World.Land | 38 | namespace OpenSim.Region.CoreModules.World.Land |
38 | { | 39 | { |
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 6e39e9a..7a35182 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Linq; | ||
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using System.Text; | 32 | using System.Text; |
32 | using System.Text.RegularExpressions; | 33 | using System.Text.RegularExpressions; |
@@ -83,29 +84,56 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
83 | m_console.Commands.AddCommand( | 84 | m_console.Commands.AddCommand( |
84 | "Objects", false, "delete object owner", | 85 | "Objects", false, "delete object owner", |
85 | "delete object owner <UUID>", | 86 | "delete object owner <UUID>", |
86 | "Delete a scene object by owner", HandleDeleteObject); | 87 | "Delete scene objects by owner", |
88 | "Command will ask for confirmation before proceeding.", | ||
89 | HandleDeleteObject); | ||
87 | 90 | ||
88 | m_console.Commands.AddCommand( | 91 | m_console.Commands.AddCommand( |
89 | "Objects", false, "delete object creator", | 92 | "Objects", false, "delete object creator", |
90 | "delete object creator <UUID>", | 93 | "delete object creator <UUID>", |
91 | "Delete a scene object by creator", HandleDeleteObject); | 94 | "Delete scene objects by creator", |
95 | "Command will ask for confirmation before proceeding.", | ||
96 | HandleDeleteObject); | ||
92 | 97 | ||
93 | m_console.Commands.AddCommand( | 98 | m_console.Commands.AddCommand( |
94 | "Objects", false, "delete object uuid", | 99 | "Objects", false, "delete object uuid", |
95 | "delete object uuid <UUID>", | 100 | "delete object uuid <UUID>", |
96 | "Delete a scene object by uuid", HandleDeleteObject); | 101 | "Delete a scene object by uuid", |
102 | HandleDeleteObject); | ||
97 | 103 | ||
98 | m_console.Commands.AddCommand( | 104 | m_console.Commands.AddCommand( |
99 | "Objects", false, "delete object name", | 105 | "Objects", false, "delete object name", |
100 | "delete object name [--regex] <name>", | 106 | "delete object name [--regex] <name>", |
101 | "Delete a scene object by name.", | 107 | "Delete a scene object by name.", |
102 | "If --regex is specified then the name is treatead as a regular expression", | 108 | "Command will ask for confirmation before proceeding.\n" |
109 | + "If --regex is specified then the name is treatead as a regular expression", | ||
103 | HandleDeleteObject); | 110 | HandleDeleteObject); |
104 | 111 | ||
105 | m_console.Commands.AddCommand( | 112 | m_console.Commands.AddCommand( |
106 | "Objects", false, "delete object outside", | 113 | "Objects", false, "delete object outside", |
107 | "delete object outside", | 114 | "delete object outside", |
108 | "Delete all scene objects outside region boundaries", HandleDeleteObject); | 115 | "Delete all scene objects outside region boundaries", |
116 | "Command will ask for confirmation before proceeding.", | ||
117 | HandleDeleteObject); | ||
118 | |||
119 | m_console.Commands.AddCommand( | ||
120 | "Objects", | ||
121 | false, | ||
122 | "delete object pos", | ||
123 | "delete object pos <start-coord> to <end-coord>", | ||
124 | "Delete scene objects within the given area.", | ||
125 | "Each component of the coord is comma separated. There must be no spaces between the commas.\n" | ||
126 | + "If you don't care about the z component you can simply omit it.\n" | ||
127 | + "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n" | ||
128 | + "If you want to specify the maxmimum value of a component then you can use ~ instead of a number\n" | ||
129 | + "If you want to specify the minimum value of a component then you can use -~ instead of a number\n" | ||
130 | + "e.g.\n" | ||
131 | + "delete object pos 20,20,20 to 40,40,40\n" | ||
132 | + "delete object pos 20,20 to 40,40\n" | ||
133 | + "delete object pos ,20,20 to ,40,40\n" | ||
134 | + "delete object pos ,,30 to ,,~\n" | ||
135 | + "delete object pos ,,-~ to ,,30", | ||
136 | HandleDeleteObject); | ||
109 | 137 | ||
110 | m_console.Commands.AddCommand( | 138 | m_console.Commands.AddCommand( |
111 | "Objects", | 139 | "Objects", |
@@ -301,23 +329,10 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
301 | return; | 329 | return; |
302 | } | 330 | } |
303 | 331 | ||
304 | string rawConsoleStartVector = cmdparams[3]; | 332 | Vector3 startVector, endVector; |
305 | Vector3 startVector; | ||
306 | 333 | ||
307 | if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector)) | 334 | if (!TryParseVectorRange(cmdparams.Skip(3).Take(3), out startVector, out endVector)) |
308 | { | ||
309 | m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector); | ||
310 | return; | 335 | return; |
311 | } | ||
312 | |||
313 | string rawConsoleEndVector = cmdparams[5]; | ||
314 | Vector3 endVector; | ||
315 | |||
316 | if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector)) | ||
317 | { | ||
318 | m_console.OutputFormat("Error: End vector {0} does not have a valid format", rawConsoleEndVector); | ||
319 | return; | ||
320 | } | ||
321 | 336 | ||
322 | Predicate<SceneObjectGroup> searchPredicate | 337 | Predicate<SceneObjectGroup> searchPredicate |
323 | = so => Util.IsInsideBox(so.AbsolutePosition, startVector, endVector); | 338 | = so => Util.IsInsideBox(so.AbsolutePosition, startVector, endVector); |
@@ -557,6 +572,10 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
557 | 572 | ||
558 | break; | 573 | break; |
559 | 574 | ||
575 | case "pos": | ||
576 | deletes = GetDeleteCandidatesByPos(module, cmd); | ||
577 | break; | ||
578 | |||
560 | default: | 579 | default: |
561 | m_console.OutputFormat("Unrecognized mode {0}", mode); | 580 | m_console.OutputFormat("Unrecognized mode {0}", mode); |
562 | return; | 581 | return; |
@@ -571,7 +590,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
571 | string.Format( | 590 | string.Format( |
572 | "Are you sure that you want to delete {0} objects from {1}", | 591 | "Are you sure that you want to delete {0} objects from {1}", |
573 | deletes.Count, m_scene.RegionInfo.RegionName), | 592 | deletes.Count, m_scene.RegionInfo.RegionName), |
574 | "n"); | 593 | "y/N"); |
575 | 594 | ||
576 | if (response.ToLower() != "y") | 595 | if (response.ToLower() != "y") |
577 | { | 596 | { |
@@ -593,9 +612,6 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
593 | 612 | ||
594 | private List<SceneObjectGroup> GetDeleteCandidatesByName(string module, string[] cmdparams) | 613 | private List<SceneObjectGroup> GetDeleteCandidatesByName(string module, string[] cmdparams) |
595 | { | 614 | { |
596 | if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) | ||
597 | return null; | ||
598 | |||
599 | bool useRegex = false; | 615 | bool useRegex = false; |
600 | OptionSet options = new OptionSet().Add("regex", v=> useRegex = v != null ); | 616 | OptionSet options = new OptionSet().Add("regex", v=> useRegex = v != null ); |
601 | 617 | ||
@@ -629,5 +645,52 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
629 | 645 | ||
630 | return sceneObjects; | 646 | return sceneObjects; |
631 | } | 647 | } |
648 | |||
649 | /// <summary> | ||
650 | /// Get scene object delete candidates by position | ||
651 | /// </summary> | ||
652 | /// <param name='module'></param> | ||
653 | /// <param name='cmdparams'></param> | ||
654 | /// <returns>null if parsing failed on one of the arguments, otherwise a list of objects to delete. If there | ||
655 | /// are no objects to delete then the list will be empty./returns> | ||
656 | private List<SceneObjectGroup> GetDeleteCandidatesByPos(string module, string[] cmdparams) | ||
657 | { | ||
658 | if (cmdparams.Length < 5) | ||
659 | { | ||
660 | m_console.OutputFormat("Usage: delete object pos <start-coord> to <end-coord>"); | ||
661 | return null; | ||
662 | } | ||
663 | |||
664 | Vector3 startVector, endVector; | ||
665 | |||
666 | if (!TryParseVectorRange(cmdparams.Skip(3).Take(3), out startVector, out endVector)) | ||
667 | return null; | ||
668 | |||
669 | return m_scene.GetSceneObjectGroups().FindAll( | ||
670 | so => !so.IsAttachment && Util.IsInsideBox(so.AbsolutePosition, startVector, endVector)); | ||
671 | } | ||
672 | |||
673 | private bool TryParseVectorRange(IEnumerable<string> rawComponents, out Vector3 startVector, out Vector3 endVector) | ||
674 | { | ||
675 | string rawConsoleStartVector = rawComponents.Take(1).Single(); | ||
676 | |||
677 | if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector)) | ||
678 | { | ||
679 | m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector); | ||
680 | endVector = Vector3.Zero; | ||
681 | |||
682 | return false; | ||
683 | } | ||
684 | |||
685 | string rawConsoleEndVector = rawComponents.Skip(1).Take(1).Single(); | ||
686 | |||
687 | if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector)) | ||
688 | { | ||
689 | m_console.OutputFormat("Error: End vector {0} does not have a valid format", rawConsoleEndVector); | ||
690 | return false; | ||
691 | } | ||
692 | |||
693 | return true; | ||
694 | } | ||
632 | } | 695 | } |
633 | } \ No newline at end of file | 696 | } \ No newline at end of file |