From 2b842958cc172fbf9ee79b495a268f012fb47cdc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 16 Feb 2012 02:58:00 +0000 Subject: If shape properties fail SOP parsing (e.g. due to commas instead of decimal points) print out one short message listing the failing node names rather than lots of exceptions. Adds skeleton bad float values deserialization test --- .../World/Serialiser/Tests/SerialiserTests.cs | 133 +++++++++++++++++++++ 1 file changed, 133 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index d5b585a..9c8c4d5 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs @@ -148,6 +148,113 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests "; + private string badFloatsXml = @" + + + + false + a6dacf01-4636-4bb9-8a97-30609438af9d + e6a5a05e-e8cc-4816-8701-04165e335790 + 1 + + 0 + e6a5a05e-e8cc-4816-8701-04165e335790 + 2698615125 + NaughtyPrim + 0 + false + 1099511628032000 + 0 + 147.2392.69822.78084 + 000 + -4.371139E-08-1-4.371139E-080 + 000 + 000 + 000 + 000 + + + + + + 0 + 0 + + 1 + AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA== + AA== + 0 + 16 + 0 + 0 + 0 + 100 + 100 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 9 + 0 + 0 + 0 + 10100.5 + 0 + Square + Same + 00000000-0000-0000-0000-000000000000 + 0 + 0 + 0,5 + yo mamma + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 + false + false + false + + 10100.5 + 0 + 0001 + 000 + 000 + 0001 + 0 + 1211330445 + 0 + 0 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + a6dacf01-4636-4bb9-8a97-30609438af9d + a6dacf01-4636-4bb9-8a97-30609438af9d + 2147483647 + 2147483647 + 0 + 0 + 2147483647 + None + 00000000-0000-0000-0000-000000000000 + 0 + + + + "; + private string xml2 = @" @@ -257,6 +364,32 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests } [Test] + public void TestDeserializeBadFloatsXml() + { + TestHelpers.InMethod(); + log4net.Config.XmlConfigurator.Configure(); + + SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml); + SceneObjectPart rootPart = so.RootPart; + + Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); + Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); + Assert.That(rootPart.Name, Is.EqualTo("NaughtyPrim")); + + // This terminates the deserialization earlier if couldn't be parsed. + // TODO: Need to address this + Assert.That(rootPart.GroupPosition.X, Is.EqualTo(147.23f)); + + Assert.That(rootPart.Shape.PathCurve, Is.EqualTo(16)); + + // Defaults for bad parses + Assert.That(rootPart.Shape.FlexiTension, Is.EqualTo(0)); + Assert.That(rootPart.Shape.FlexiDrag, Is.EqualTo(0)); + + // TODO: Check other properties + } + + [Test] public void TestSerializeXml() { TestHelpers.InMethod(); -- cgit v1.1 From 1267094a5123f5874351d82a3fdf6e257e93d283 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 16 Feb 2012 03:02:11 +0000 Subject: Turn off logging on test in last commit (2b84295). --- OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index 9c8c4d5..d1d2020 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs @@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests public void TestDeserializeBadFloatsXml() { TestHelpers.InMethod(); - log4net.Config.XmlConfigurator.Configure(); +// log4net.Config.XmlConfigurator.Configure(); SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml); SceneObjectPart rootPart = so.RootPart; -- cgit v1.1 From 4486b7d8e8aaa7f98e0003ce06fc0e145903f6b9 Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Thu, 16 Feb 2012 00:07:12 +0100 Subject: Fix: Object owned by the group does not return to the last owner http://opensimulator.org/mantis/view.php?id=5404 --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 63ba3d3..5da15ff 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -552,6 +552,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // action, remoteClient.Name, userID); } else + if (so.RootPart.OwnerID == so.RootPart.GroupID) + { + // Group owned objects go to the last owner + userID = so.RootPart.LastOwnerID; + } + else { // All returns / deletes go to the object owner // -- cgit v1.1 From 912aac34476a3d66c2dfa8d31352d614bd477286 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 16 Feb 2012 03:37:40 +0000 Subject: minor formatting changes from last commit (4486n7d) --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 5da15ff..d320af4 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -551,15 +551,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}", // action, remoteClient.Name, userID); } - else - if (so.RootPart.OwnerID == so.RootPart.GroupID) + else if (so.RootPart.OwnerID == so.RootPart.GroupID) { - // Group owned objects go to the last owner + // Group owned objects go to the last owner before the object was transferred. userID = so.RootPart.LastOwnerID; } else { - // All returns / deletes go to the object owner + // Other returns / deletes go to the object owner // userID = so.RootPart.OwnerID; -- cgit v1.1