From b058ba5859b1012a23e58c9b9e0d91f77ac19ba3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 19 Oct 2012 00:36:32 +0100
Subject: [UNTESTED] core Ode: stop trying to load a broken asset. Make broken
assets behave like phantom by Nebadon request
---
OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 118 +++++++++++++++++++++++-----
1 file changed, 97 insertions(+), 21 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index c86084c..a6c657f 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -341,8 +341,17 @@ namespace OpenSim.Region.Physics.OdePlugin
prim_geom = geom;
//Console.WriteLine("SetGeom to " + prim_geom + " for " + Name);
- d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
- d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ if (m_assetFailed)
+ {
+ d.GeomSetCategoryBits(prim_geom, 0);
+ d.GeomSetCollideBits(prim_geom, 0);
+ }
+ else
+ {
+
+ d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
+ d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ }
_parent_scene.geom_name_map[prim_geom] = Name;
_parent_scene.actor_name_map[prim_geom] = this;
@@ -405,8 +414,17 @@ namespace OpenSim.Region.Physics.OdePlugin
myrot.W = _orientation.W;
d.BodySetQuaternion(Body, ref myrot);
d.GeomSetBody(prim_geom, Body);
- m_collisionCategories |= CollisionCategories.Body;
- m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
+
+ if (m_assetFailed)
+ {
+ d.GeomSetCategoryBits(prim_geom, 0);
+ d.GeomSetCollideBits(prim_geom, 0);
+ }
+ else
+ {
+ m_collisionCategories |= CollisionCategories.Body;
+ m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
+ }
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
@@ -778,8 +796,16 @@ namespace OpenSim.Region.Physics.OdePlugin
m_collisionCategories &= ~CollisionCategories.Body;
m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land);
- d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
- d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ if (m_assetFailed)
+ {
+ d.GeomSetCategoryBits(prim_geom, 0);
+ d.GeomSetCollideBits(prim_geom, 0);
+ }
+ else
+ {
+ d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
+ d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ }
d.BodyDestroy(Body);
lock (childrenPrim)
@@ -803,8 +829,17 @@ namespace OpenSim.Region.Physics.OdePlugin
m_collisionCategories &= ~CollisionCategories.Body;
m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land);
- d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
- d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ if (m_assetFailed)
+ {
+ d.GeomSetCategoryBits(prim_geom, 0);
+ d.GeomSetCollideBits(prim_geom, 0);
+ }
+ else
+ {
+
+ d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
+ d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ }
Body = IntPtr.Zero;
}
@@ -1094,8 +1129,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name);
- d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories);
- d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags);
+ if (prm.m_assetFailed)
+ {
+ d.GeomSetCategoryBits(prm.prim_geom, 0);
+ d.GeomSetCollideBits(prm.prim_geom, 0);
+ }
+ else
+ {
+ d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories);
+ d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags);
+ }
d.Quaternion quat = new d.Quaternion();
quat.W = prm._orientation.W;
@@ -1140,10 +1183,18 @@ Console.WriteLine("ZProcessTaints for " + Name);
m_collisionCategories |= CollisionCategories.Body;
m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
-//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name);
- d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
-//Console.WriteLine(" Post GeomSetCategoryBits 2");
- d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ if (m_assetFailed)
+ {
+ d.GeomSetCategoryBits(prim_geom, 0);
+ d.GeomSetCollideBits(prim_geom, 0);
+ }
+ else
+ {
+ //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name);
+ d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
+ //Console.WriteLine(" Post GeomSetCategoryBits 2");
+ d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ }
d.Quaternion quat2 = new d.Quaternion();
quat2.W = _orientation.W;
@@ -1304,8 +1355,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
disableBodySoft();
}
- d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
- d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ if (m_assetFailed)
+ {
+ d.GeomSetCategoryBits(prim_geom, 0);
+ d.GeomSetCollideBits(prim_geom, 0);
+ }
+ else
+ {
+ d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
+ d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ }
if (IsPhysical)
{
@@ -1326,8 +1385,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
if (m_collidesWater)
m_collisionFlags |= CollisionCategories.Water;
- d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
- d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ if (m_assetFailed)
+ {
+ d.GeomSetCategoryBits(prim_geom, 0);
+ d.GeomSetCollideBits(prim_geom, 0);
+ }
+ else
+ {
+ d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
+ d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ }
if (IsPhysical)
{
@@ -1504,6 +1571,8 @@ Console.WriteLine("CreateGeom:");
// m_log.Debug(m_localID);
if (mesh == null)
CheckMeshAsset();
+ else
+ m_assetFailed = false;
}
#if SPAM
@@ -2007,6 +2076,8 @@ Console.WriteLine(" JointCreateFixed");
mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
if (mesh == null)
CheckMeshAsset();
+ else
+ m_assetFailed = false;
}
}
@@ -2060,9 +2131,12 @@ Console.WriteLine(" JointCreateFixed");
m_collisionFlags &= ~CollisionCategories.Water;
}
- d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
- }
+ if (m_assetFailed)
+ d.GeomSetCollideBits(prim_geom, 0);
+ else
+ d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
+ }
///
/// Change prim in response to a shape taint.
///
@@ -2110,6 +2184,8 @@ Console.WriteLine(" JointCreateFixed");
mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
if (mesh == null)
CheckMeshAsset();
+ else
+ m_assetFailed = false;
}
CreateGeom(m_targetSpace, mesh);
@@ -3278,7 +3354,7 @@ Console.WriteLine(" JointCreateFixed");
_pbs.SculptData = new byte[asset.Data.Length];
asset.Data.CopyTo(_pbs.SculptData, 0);
- m_assetFailed = false;
+// m_assetFailed = false;
m_taintshape = true;
_parent_scene.AddPhysicsActorTaint(this);
}
--
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')
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