From efd9791506b00e424bb5f1846b37d79e7638bda2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Oct 2012 23:30:48 +0100 Subject: Add "delete object pos to " console command. This allows one to delete objects within a certain volume. See help on console for more details. --- .../World/Objects/Commands/ObjectCommandsModule.cs | 109 ++++++++++++++++----- 1 file changed, 85 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 6e39e9a..85779ec 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; using System.Text; using System.Text.RegularExpressions; @@ -83,29 +84,56 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands m_console.Commands.AddCommand( "Objects", false, "delete object owner", "delete object owner ", - "Delete a scene object by owner", HandleDeleteObject); + "Delete scene objects by owner", + "Command will ask for confirmation before proceeding.", + HandleDeleteObject); m_console.Commands.AddCommand( "Objects", false, "delete object creator", "delete object creator ", - "Delete a scene object by creator", HandleDeleteObject); + "Delete scene objects by creator", + "Command will ask for confirmation before proceeding.", + HandleDeleteObject); m_console.Commands.AddCommand( "Objects", false, "delete object uuid", "delete object uuid ", - "Delete a scene object by uuid", HandleDeleteObject); + "Delete a scene object by uuid", + HandleDeleteObject); m_console.Commands.AddCommand( "Objects", false, "delete object name", "delete object name [--regex] ", "Delete a scene object by name.", - "If --regex is specified then the name is treatead as a regular expression", + "Command will ask for confirmation before proceeding.\n" + + "If --regex is specified then the name is treatead as a regular expression", HandleDeleteObject); m_console.Commands.AddCommand( "Objects", false, "delete object outside", "delete object outside", - "Delete all scene objects outside region boundaries", HandleDeleteObject); + "Delete all scene objects outside region boundaries", + "Command will ask for confirmation before proceeding.", + HandleDeleteObject); + + m_console.Commands.AddCommand( + "Objects", + false, + "delete object pos", + "delete object pos to ", + "Delete scene objects within the given area.", + "Each component of the coord is comma separated. There must be no spaces between the commas.\n" + + "If you don't care about the z component you can simply omit it.\n" + + "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n" + + "If you want to specify the maxmimum value of a component then you can use ~ instead of a number\n" + + "If you want to specify the minimum value of a component then you can use -~ instead of a number\n" + + "e.g.\n" + + "delete object pos 20,20,20 to 40,40,40\n" + + "delete object pos 20,20 to 40,40\n" + + "delete object pos ,20,20 to ,40,40\n" + + "delete object pos ,,30 to ,,~\n" + + "delete object pos ,,-~ to ,,30", + HandleDeleteObject); m_console.Commands.AddCommand( "Objects", @@ -301,23 +329,10 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands return; } - string rawConsoleStartVector = cmdparams[3]; - Vector3 startVector; + Vector3 startVector, endVector; - if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector)) - { - m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector); + if (!TryParseVectorRange(cmdparams.Skip(3).Take(3), out startVector, out endVector)) return; - } - - string rawConsoleEndVector = cmdparams[5]; - Vector3 endVector; - - if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector)) - { - m_console.OutputFormat("Error: End vector {0} does not have a valid format", rawConsoleEndVector); - return; - } Predicate searchPredicate = so => Util.IsInsideBox(so.AbsolutePosition, startVector, endVector); @@ -557,6 +572,10 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands break; + case "pos": + deletes = GetDeleteCandidatesByPos(module, cmd); + break; + default: m_console.OutputFormat("Unrecognized mode {0}", mode); return; @@ -571,7 +590,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands string.Format( "Are you sure that you want to delete {0} objects from {1}", deletes.Count, m_scene.RegionInfo.RegionName), - "n"); + "y/N"); if (response.ToLower() != "y") { @@ -593,9 +612,6 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands private List GetDeleteCandidatesByName(string module, string[] cmdparams) { - if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) - return null; - bool useRegex = false; OptionSet options = new OptionSet().Add("regex", v=> useRegex = v != null ); @@ -629,5 +645,50 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands return sceneObjects; } + + /// + /// Get scene object delete candidates by position + /// + /// + /// + /// null if parsing failed on one of the arguments, otherwise a list of objects to delete. If there + /// are no objects to delete then the list will be empty./returns> + private List GetDeleteCandidatesByPos(string module, string[] cmdparams) + { + if (cmdparams.Length < 5) + { + m_console.OutputFormat("Usage: delete object pos to "); + return null; + } + + Vector3 startVector, endVector; + + if (!TryParseVectorRange(cmdparams.Skip(3).Take(3), out startVector, out endVector)) + return null; + + return m_scene.GetSceneObjectGroups().FindAll( + so => !so.IsAttachment && Util.IsInsideBox(so.AbsolutePosition, startVector, endVector)); + } + + private bool TryParseVectorRange(IEnumerable rawComponents, out Vector3 startVector, out Vector3 endVector) + { + string rawConsoleStartVector = rawComponents.Take(1).Single(); + + if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector)) + { + m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector); + return false; + } + + string rawConsoleEndVector = rawComponents.Skip(1).Take(1).Single(); + + if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector)) + { + m_console.OutputFormat("Error: End vector {0} does not have a valid format", rawConsoleEndVector); + return false; + } + + return true; + } } } \ No newline at end of file -- cgit v1.1 From b768c35f6f69606d17fdd76d94b95428ac9d0029 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 11 Oct 2012 00:05:34 +0100 Subject: Assign endVector before control leaves ObjectCommandsModule.TryParseVectorRange() in order to fix mono 2.4.3 compile failure. This doesn't fail the compile on mono 2.10.8. --- .../Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 85779ec..7a35182 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -677,6 +677,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector)) { m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector); + endVector = Vector3.Zero; + return false; } -- cgit v1.1 From d469bde849f53a4c80b301051599390e916ce08a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 16 Oct 2012 01:20:41 +0100 Subject: minor: Add/correct some doc messages associated with entity teleport. I believe UseCircuitCode is sent on EnableSimulator EQ message, rather than EstablishAgentCommunication At least with LL 3.3.4, EstablishAgentCommunication appears unnecessary in the teleport context - viewer still requests it though possibly only after TeleportFinish(). However, we will continue to send it. --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 617a350..90fe430 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -486,6 +486,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (sp.ParentID != (uint)0) sp.StandUp(); + // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to + // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). sp.ControllingClient.SendTeleportStart(teleportFlags); // the avatar.Close below will clear the child region list. We need this below for (possibly) @@ -561,8 +563,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // So let's wait Thread.Sleep(200); + // At least on LL 3.3.4 for teleports between different regions on the same simulator this appears + // unnecessary - teleport will succeed and SEED caps will be requested without it (though possibly + // only on TeleportFinish). This is untested for region teleport between different simulators + // though this probably also works. m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); - } else { -- cgit v1.1 From a960273e91e43eedbab923539d817b81c0e50dbd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 18 Oct 2012 23:02:57 +0100 Subject: Add number of inventory items to information displayed via "show part" console command --- .../Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 7a35182..5d0163a 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -456,6 +456,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands sb.AppendFormat("Parent: {0}", sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID)); sb.AppendFormat("Link number: {0}\n", sop.LinkNum); + sb.AppendFormat("Items: {0}\n", sop.Inventory.Count); sb.AppendFormat("Flags: {0}\n", sop.Flags); return sb; -- cgit v1.1 From 1f3c9db2b9ba71a84438b53b2a8a6f398137deb0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 18 Oct 2012 23:41:18 +0100 Subject: Add --full option to "show object name/uuid/pos" to show info on all parts of an object, not just whole object summary information. --- .../World/Objects/Commands/ObjectCommandsModule.cs | 80 ++++++++++++++++------ 1 file changed, 60 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 5d0163a..7ceac7e 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -139,25 +139,29 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands "Objects", false, "show object uuid", - "show object uuid ", - "Show details of a scene object with the given UUID", HandleShowObjectByUuid); + "show object uuid [--full] ", + "Show details of a scene object with the given UUID", + "The --full option will print out information on all the parts of the object.", + HandleShowObjectByUuid); m_console.Commands.AddCommand( "Objects", false, "show object name", - "show object name [--regex] ", + "show object name [--full] [--regex] ", "Show details of scene objects with the given name.", - "If --regex is specified then the name is treatead as a regular expression", + "The --full option will print out information on all the parts of the object.\n" + + "If --regex is specified then the name is treatead as a regular expression.", HandleShowObjectByName); m_console.Commands.AddCommand( "Objects", false, "show object pos", - "show object pos to ", + "show object pos [--full] to ", "Show details of scene objects within the given area.", - "Each component of the coord is comma separated. There must be no spaces between the commas.\n" + "The --full option will print out information on all the parts of the object.\n" + + "Each component of the coord is comma separated. There must be no spaces between the commas.\n" + "If you don't care about the z component you can simply omit it.\n" + "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n" + "If you want to specify the maxmimum value of a component then you can use ~ instead of a number\n" @@ -216,7 +220,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands // m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); } - private void OutputSogsToConsole(Predicate searchPredicate) + /// + /// Outputs the sogs to console. + /// + /// + /// If true then output all part details. If false then output summary. + private void OutputSogsToConsole(Predicate searchPredicate, bool showFull) { List sceneObjects = m_scene.GetSceneObjectGroups().FindAll(searchPredicate); @@ -224,7 +233,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands foreach (SceneObjectGroup so in sceneObjects) { - AddSceneObjectReport(sb, so); + AddSceneObjectReport(sb, so, showFull); sb.Append("\n"); } @@ -253,21 +262,26 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands m_console.OutputFormat(sb.ToString()); } - private void HandleShowObjectByUuid(string module, string[] cmd) + private void HandleShowObjectByUuid(string module, string[] cmdparams) { if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) return; - if (cmd.Length < 4) + bool showFull = false; + OptionSet options = new OptionSet().Add("full", v => showFull = v != null ); + + List mainParams = options.Parse(cmdparams); + + if (mainParams.Count < 4) { m_console.OutputFormat("Usage: show object uuid "); return; } UUID objectUuid; - if (!UUID.TryParse(cmd[3], out objectUuid)) + if (!UUID.TryParse(mainParams[3], out objectUuid)) { - m_console.OutputFormat("{0} is not a valid uuid", cmd[3]); + m_console.OutputFormat("{0} is not a valid uuid", mainParams[3]); return; } @@ -280,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands } StringBuilder sb = new StringBuilder(); - AddSceneObjectReport(sb, so); + AddSceneObjectReport(sb, so, showFull); m_console.OutputFormat(sb.ToString()); } @@ -290,14 +304,17 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) return; + bool showFull = false; bool useRegex = false; - OptionSet options = new OptionSet().Add("regex", v=> useRegex = v != null ); + OptionSet options = new OptionSet(); + options.Add("full", v => showFull = v != null ); + options.Add("regex", v => useRegex = v != null ); List mainParams = options.Parse(cmdparams); if (mainParams.Count < 4) { - m_console.OutputFormat("Usage: show object name [--regex] "); + m_console.OutputFormat("Usage: show object name [--full] [--regex] "); return; } @@ -315,7 +332,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands searchPredicate = so => so.Name == name; } - OutputSogsToConsole(searchPredicate); + OutputSogsToConsole(searchPredicate, showFull); } private void HandleShowObjectByPos(string module, string[] cmdparams) @@ -323,9 +340,14 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) return; - if (cmdparams.Length < 5) + bool showFull = false; + OptionSet options = new OptionSet().Add("full", v => showFull = v != null ); + + List mainParams = options.Parse(cmdparams); + + if (mainParams.Count < 5) { - m_console.OutputFormat("Usage: show object pos to "); + m_console.OutputFormat("Usage: show object pos [--full] to "); return; } @@ -337,7 +359,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands Predicate searchPredicate = so => Util.IsInsideBox(so.AbsolutePosition, startVector, endVector); - OutputSogsToConsole(searchPredicate); + OutputSogsToConsole(searchPredicate, showFull); } private void HandleShowPartByUuid(string module, string[] cmd) @@ -437,7 +459,25 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands OutputSopsToConsole(searchPredicate); } - private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so) + private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so, bool showFull) + { + if (showFull) + { + foreach (SceneObjectPart sop in so.Parts) + { + AddScenePartReport(sb, sop); + sb.Append("\n"); + } + } + else + { + AddSummarySceneObjectReport(sb, so); + } + + return sb; + } + + private StringBuilder AddSummarySceneObjectReport(StringBuilder sb, SceneObjectGroup so) { sb.AppendFormat("Name: {0}\n", so.Name); sb.AppendFormat("Description: {0}\n", so.Description); -- cgit v1.1 From 75f5e66d1c17ad6507a13c89345f3e4d351c44d2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 18 Oct 2012 23:45:07 +0100 Subject: Add local and UUID to information output of "show object" and "show part" region console commands --- .../Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 7ceac7e..b90b71e 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -481,6 +481,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands { sb.AppendFormat("Name: {0}\n", so.Name); sb.AppendFormat("Description: {0}\n", so.Description); + sb.AppendFormat("Local ID {0}\n", so.LocalId); + sb.AppendFormat("UUID {0}\n", so.UUID); sb.AppendFormat("Location: {0} @ {1}\n", so.AbsolutePosition, so.Scene.RegionInfo.RegionName); sb.AppendFormat("Parts: {0}\n", so.PrimCount); sb.AppendFormat("Flags: {0}\n", so.RootPart.Flags); @@ -492,6 +494,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands { sb.AppendFormat("Name: {0}\n", sop.Name); sb.AppendFormat("Description: {0}\n", sop.Description); + sb.AppendFormat("Local ID {0}\n", sop.LocalId); + sb.AppendFormat("UUID {0}\n", sop.UUID); sb.AppendFormat("Location: {0} @ {1}\n", sop.AbsolutePosition, sop.ParentGroup.Scene.RegionInfo.RegionName); sb.AppendFormat("Parent: {0}", sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID)); -- cgit v1.1 From 845228b35e75dea4ec597ca394dd43196ff8bb48 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 18 Oct 2012 23:58:29 +0100 Subject: minor: Convert ad-hoc list building in ObjectCommandsModule to use ConsoleDisplayList --- .../World/Objects/Commands/ObjectCommandsModule.cs | 45 ++++++++++++---------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index b90b71e..6feba21 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -479,31 +479,34 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands private StringBuilder AddSummarySceneObjectReport(StringBuilder sb, SceneObjectGroup so) { - sb.AppendFormat("Name: {0}\n", so.Name); - sb.AppendFormat("Description: {0}\n", so.Description); - sb.AppendFormat("Local ID {0}\n", so.LocalId); - sb.AppendFormat("UUID {0}\n", so.UUID); - sb.AppendFormat("Location: {0} @ {1}\n", so.AbsolutePosition, so.Scene.RegionInfo.RegionName); - sb.AppendFormat("Parts: {0}\n", so.PrimCount); - sb.AppendFormat("Flags: {0}\n", so.RootPart.Flags); - - return sb; + ConsoleDisplayList cdl = new ConsoleDisplayList(); + cdl.AddRow("Name", so.Name); + cdl.AddRow("Descrition", so.Description); + cdl.AddRow("Local ID", so.LocalId); + cdl.AddRow("UUID", so.UUID); + cdl.AddRow("Location", string.Format("{0} @ {1}", so.AbsolutePosition, so.Scene.Name)); + cdl.AddRow("Parts", so.PrimCount); + cdl.AddRow("Flags", so.RootPart.Flags); + + return sb.Append(cdl.ToString()); } private StringBuilder AddScenePartReport(StringBuilder sb, SceneObjectPart sop) { - sb.AppendFormat("Name: {0}\n", sop.Name); - sb.AppendFormat("Description: {0}\n", sop.Description); - sb.AppendFormat("Local ID {0}\n", sop.LocalId); - sb.AppendFormat("UUID {0}\n", sop.UUID); - sb.AppendFormat("Location: {0} @ {1}\n", sop.AbsolutePosition, sop.ParentGroup.Scene.RegionInfo.RegionName); - sb.AppendFormat("Parent: {0}", - sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID)); - sb.AppendFormat("Link number: {0}\n", sop.LinkNum); - sb.AppendFormat("Items: {0}\n", sop.Inventory.Count); - sb.AppendFormat("Flags: {0}\n", sop.Flags); - - return sb; + ConsoleDisplayList cdl = new ConsoleDisplayList(); + cdl.AddRow("Name", sop.Name); + cdl.AddRow("Description", sop.Description); + cdl.AddRow("Local ID", sop.LocalId); + cdl.AddRow("UUID", sop.UUID); + cdl.AddRow("Location", string.Format("{0} @ {1}", sop.AbsolutePosition, sop.ParentGroup.Scene.Name)); + cdl.AddRow( + "Parent", + sop.IsRoot ? "Is Root" : string.Format("{0} {1}", sop.ParentGroup.Name, sop.ParentGroup.UUID)); + cdl.AddRow("Link number", sop.LinkNum); + cdl.AddRow("Flags", sop.Flags); + cdl.AddRow("Items", sop.Inventory.Count); + + return sb.Append(cdl.ToString()); } private void HandleDeleteObject(string module, string[] cmd) -- cgit v1.1 From 941717638991f093ae600cd0f1b1d646f0cd3c21 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 19 Oct 2012 00:37:25 +0100 Subject: Make "show part" console commands print out information about each item the part contains --- .../World/Objects/Commands/ObjectCommandsModule.cs | 113 +++++++++++++++++---- 1 file changed, 93 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 6feba21..87241e1 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -141,7 +141,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands "show object uuid", "show object uuid [--full] ", "Show details of a scene object with the given UUID", - "The --full option will print out information on all the parts of the object.", + "The --full option will print out information on all the parts of the object.\n" + + "For yet more detailed part information, use the \"show part\" commands.", HandleShowObjectByUuid); m_console.Commands.AddCommand( @@ -151,6 +152,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands "show object name [--full] [--regex] ", "Show details of scene objects with the given name.", "The --full option will print out information on all the parts of the object.\n" + + "For yet more detailed part information, use the \"show part\" commands.\n" + "If --regex is specified then the name is treatead as a regular expression.", HandleShowObjectByName); @@ -161,6 +163,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands "show object pos [--full] to ", "Show details of scene objects within the given area.", "The --full option will print out information on all the parts of the object.\n" + + "For yet more detailed part information, use the \"show part\" commands.\n" + "Each component of the coord is comma separated. There must be no spaces between the commas.\n" + "If you don't care about the z component you can simply omit it.\n" + "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n" @@ -242,7 +245,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands m_console.OutputFormat(sb.ToString()); } - private void OutputSopsToConsole(Predicate searchPredicate) + private void OutputSopsToConsole(Predicate searchPredicate, bool showFull) { List sceneObjects = m_scene.GetSceneObjectGroups(); List parts = new List(); @@ -253,7 +256,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands foreach (SceneObjectPart part in parts) { - AddScenePartReport(sb, part); + AddScenePartReport(sb, part, showFull); sb.Append("\n"); } @@ -362,21 +365,27 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands OutputSogsToConsole(searchPredicate, showFull); } - private void HandleShowPartByUuid(string module, string[] cmd) + private void HandleShowPartByUuid(string module, string[] cmdparams) { if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) return; - if (cmd.Length < 4) +// bool showFull = false; + OptionSet options = new OptionSet(); +// options.Add("full", v => showFull = v != null ); + + List mainParams = options.Parse(cmdparams); + + if (mainParams.Count < 4) { - m_console.OutputFormat("Usage: show part uuid "); + m_console.OutputFormat("Usage: show part uuid [--full] "); return; } UUID objectUuid; - if (!UUID.TryParse(cmd[3], out objectUuid)) + if (!UUID.TryParse(mainParams[3], out objectUuid)) { - m_console.OutputFormat("{0} is not a valid uuid", cmd[3]); + m_console.OutputFormat("{0} is not a valid uuid", mainParams[3]); return; } @@ -389,7 +398,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands } StringBuilder sb = new StringBuilder(); - AddScenePartReport(sb, sop); + AddScenePartReport(sb, sop, true); m_console.OutputFormat(sb.ToString()); } @@ -399,13 +408,19 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) return; - if (cmdparams.Length < 5) +// bool showFull = false; + OptionSet options = new OptionSet(); +// options.Add("full", v => showFull = v != null ); + + List mainParams = options.Parse(cmdparams); + + if (mainParams.Count < 5) { - m_console.OutputFormat("Usage: show part pos to "); + m_console.OutputFormat("Usage: show part pos [--full] to "); return; } - string rawConsoleStartVector = cmdparams[3]; + string rawConsoleStartVector = mainParams[3]; Vector3 startVector; if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector)) @@ -414,7 +429,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands return; } - string rawConsoleEndVector = cmdparams[5]; + string rawConsoleEndVector = mainParams[5]; Vector3 endVector; if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector)) @@ -423,7 +438,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands return; } - OutputSopsToConsole(sop => Util.IsInsideBox(sop.AbsolutePosition, startVector, endVector)); + OutputSopsToConsole(sop => Util.IsInsideBox(sop.AbsolutePosition, startVector, endVector), true); } private void HandleShowPartByName(string module, string[] cmdparams) @@ -431,14 +446,17 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) return; +// bool showFull = false; bool useRegex = false; - OptionSet options = new OptionSet().Add("regex", v=> useRegex = v != null ); + OptionSet options = new OptionSet(); +// options.Add("full", v => showFull = v != null ); + options.Add("regex", v => useRegex = v != null ); List mainParams = options.Parse(cmdparams); if (mainParams.Count < 4) { - m_console.OutputFormat("Usage: show part name [--regex] "); + m_console.OutputFormat("Usage: show part name [--full] [--regex] "); return; } @@ -456,16 +474,26 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands searchPredicate = sop => sop.Name == name; } - OutputSopsToConsole(searchPredicate); + OutputSopsToConsole(searchPredicate, true); } + /// + /// Append a scene object report to an input StringBuilder + /// + /// + /// + /// + /// + /// If true then information on all parts of an object is appended. + /// If false then only summary information about an object is appended. + /// private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so, bool showFull) { if (showFull) { foreach (SceneObjectPart sop in so.Parts) { - AddScenePartReport(sb, sop); + AddScenePartReport(sb, sop, false); sb.Append("\n"); } } @@ -491,7 +519,17 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands return sb.Append(cdl.ToString()); } - private StringBuilder AddScenePartReport(StringBuilder sb, SceneObjectPart sop) + /// + /// Append a scene object part report to an input StringBuilder + /// + /// + /// + /// + /// + /// If true then information on each inventory item will be shown. + /// If false then only summary inventory information is shown. + /// + private StringBuilder AddScenePartReport(StringBuilder sb, SceneObjectPart sop, bool showFull) { ConsoleDisplayList cdl = new ConsoleDisplayList(); cdl.AddRow("Name", sop.Name); @@ -504,11 +542,46 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands sop.IsRoot ? "Is Root" : string.Format("{0} {1}", sop.ParentGroup.Name, sop.ParentGroup.UUID)); cdl.AddRow("Link number", sop.LinkNum); cdl.AddRow("Flags", sop.Flags); - cdl.AddRow("Items", sop.Inventory.Count); + + object itemsOutput; + if (showFull) + { + StringBuilder itemsSb = new StringBuilder("\n"); + itemsOutput = AddScenePartItemsReport(itemsSb, sop.Inventory).ToString(); + } + else + { + itemsOutput = sop.Inventory.Count; + } + + + cdl.AddRow("Items", itemsOutput); return sb.Append(cdl.ToString()); } + private StringBuilder AddScenePartItemsReport(StringBuilder sb, IEntityInventory inv) + { + ConsoleDisplayTable cdt = new ConsoleDisplayTable(); + cdt.Indent = 2; + + cdt.AddColumn("Name", 50); + cdt.AddColumn("Type", 12); + cdt.AddColumn("Running", 7); + cdt.AddColumn("Item UUID", 36); + cdt.AddColumn("Asset UUID", 36); + + foreach (TaskInventoryItem item in inv.GetInventoryItems()) + cdt.AddRow( + item.Name, + ((InventoryType)item.InvType).ToString(), + (InventoryType)item.InvType == InventoryType.LSL ? item.ScriptRunning.ToString() : "n/a", + item.ItemID.ToString(), + item.AssetID.ToString()); + + return sb.Append(cdt.ToString()); + } + private void HandleDeleteObject(string module, string[] cmd) { if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) -- cgit v1.1 From 0f70460a320da5606f3bdf316d5d25611fb0b3fb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 19 Oct 2012 00:39:18 +0100 Subject: minor: comment out currently unused logger in DynamicTextureModule --- .../Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 1f340df..93a045e 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { public class DynamicTextureModule : IRegionModule, IDynamicTextureManager { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private const int ALL_SIDES = -1; -- cgit v1.1 From 6ba42e9e751477d5da3abf79eb1aaffc787dee30 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 19 Oct 2012 02:54:13 +0100 Subject: Fix a few minor issues in ArchiveReadRequest logging. --- OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index a6923ef..ea806ec 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -290,7 +290,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver foreach (DearchiveContext sceneContext in sceneContexts.Values) { - m_log.InfoFormat("[ARCHIVER:] Loading region {0}", sceneContext.Scene.RegionInfo.RegionName); + m_log.InfoFormat("[ARCHIVER]: Loading region {0}", sceneContext.Scene.RegionInfo.RegionName); if (!m_merge) { @@ -324,7 +324,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver Util.FireAndForget(delegate(object o) { Thread.Sleep(15000); - m_log.Info("Starting scripts in scene objects"); + m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); foreach (DearchiveContext sceneContext in sceneContexts.Values) { -- cgit v1.1 From da2b23f18d232230ac4d967f8d3b256aebd4741e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 20 Oct 2012 02:02:13 +0100 Subject: Improve efficiency of friends notification by only make one PresenceService call for all friends rather than one for each friend. However, large groups could still take a very long time since we still need to message each avatar on different simulators. --- .../CoreModules/Avatar/Friends/FriendsModule.cs | 53 ++++++++++------------ 1 file changed, 24 insertions(+), 29 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 11db18a..f1903c3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Reflection; using System.Threading; using log4net; @@ -495,42 +496,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends protected virtual void StatusNotify(List friendList, UUID userID, bool online) { - foreach (FriendInfo friend in friendList) + List friendStringIds = friendList.ConvertAll(friend => friend.Friend); + List remoteFriendStringIds = new List(); + foreach (string friendStringId in friendStringIds) { - UUID friendID; - if (UUID.TryParse(friend.Friend, out friendID)) + UUID friendUuid; + if (UUID.TryParse(friendStringId, out friendUuid)) { - // Try local - if (LocalStatusNotification(userID, friendID, online)) + if (LocalStatusNotification(userID, friendUuid, online)) continue; - // The friend is not here [as root]. Let's forward. - PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); - if (friendSessions != null && friendSessions.Length > 0) - { - PresenceInfo friendSession = null; - foreach (PresenceInfo pinfo in friendSessions) - { - if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad - { - friendSession = pinfo; - break; - } - } - - if (friendSession != null) - { - GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); - //m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName); - m_FriendsSimConnector.StatusNotify(region, userID, friendID, online); - } - } - - // Friend is not online. Ignore. + remoteFriendStringIds.Add(friendStringId); } else { - m_log.WarnFormat("[FRIENDS]: Error parsing friend ID {0}", friend.Friend); + m_log.WarnFormat("[FRIENDS]: Error parsing friend ID {0}", friendStringId); + } + } + + // We do this regrouping so that we can efficiently send a single request rather than one for each + // friend in what may be a very large friends list. + PresenceInfo[] friendSessions = PresenceService.GetAgents(remoteFriendStringIds.ToArray()); + + foreach (PresenceInfo friendSession in friendSessions) + { + // let's guard against sessions-gone-bad + if (friendSession.RegionID != UUID.Zero) + { + GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); + //m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName); + m_FriendsSimConnector.StatusNotify(region, userID, friendSession.UserID, online); } } } -- cgit v1.1 From d7fa4cacb3227cb432a13d4f27076e408e8c114f Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Fri, 19 Oct 2012 21:02:54 +0200 Subject: Fix: invinite loading for Viewer3 : parcelinfo request of traffic-value (implementation of dwell-value in LandData + eventhandler, return always 0); source-formatting of LandData Signed-off-by: BlueWall --- .../Region/CoreModules/World/Land/LandManagementModule.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 8b7406d..95edf62 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -207,6 +207,7 @@ namespace OpenSim.Region.CoreModules.World.Land client.OnParcelInfoRequest += ClientOnParcelInfoRequest; client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; client.OnPreAgentUpdate += ClientOnPreAgentUpdate; + client.OnParcelDwellRequest += ClientOnParcelDwellRequest; EntityBase presenceEntity; if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) @@ -798,6 +799,17 @@ namespace OpenSim.Region.CoreModules.World.Land } } + private void ClientOnParcelDwellRequest(int localID, IClientAPI client) + { + ILandObject parcel = null; + lock (m_landList) + { + if (!m_landList.TryGetValue(localID, out parcel)) + return; + } + client.SendParcelDwellReply(localID, parcel.LandData.GlobalID, parcel.LandData.Dwell); + } + #endregion #region Parcel Modification -- cgit v1.1