From c5c1b7c61a07c33f672b038d50b861aff5f85fb5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 31 Jan 2015 00:17:36 +0000 Subject: Revert "Stop currently unsettable display names from appearing when [ClientStack.LindenCaps] Cap_GetDisplayNames = "localhost" is set by never passing the username." This reverts commit 2d574c3036964d95dbf914d5f5858a3c39f0c16e. --- OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs index 08faf2d..0353d9d 100644 --- a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs @@ -97,7 +97,7 @@ namespace OpenSim.Capabilities.Handlers osdname["display_name"] = OSD.FromString(name); osdname["legacy_first_name"] = parts[0]; osdname["legacy_last_name"] = parts[1]; - osdname["username"] = ""; + osdname["username"] = OSD.FromString(name); osdname["id"] = OSD.FromUUID(uuid); osdname["is_display_name_default"] = OSD.FromBoolean(false); -- cgit v1.1 From 87936947ab2e1610506c3127d38e52d59a49e59d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 31 Jan 2015 00:17:59 +0000 Subject: As per advice from Singularity devs, set is_display_name_default = true in GetDisplayName cap return data to make the single name appear. This is still always your avatar name - code to set a different display is not yet implemented. This works from my testing with current Firestorm and Singuarity releases. --- OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs index 0353d9d..589602d 100644 --- a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs @@ -99,7 +99,7 @@ namespace OpenSim.Capabilities.Handlers osdname["legacy_last_name"] = parts[1]; osdname["username"] = OSD.FromString(name); osdname["id"] = OSD.FromUUID(uuid); - osdname["is_display_name_default"] = OSD.FromBoolean(false); + osdname["is_display_name_default"] = OSD.FromBoolean(true); agents.Add(osdname); } -- cgit v1.1 From bee3933e5757d0673b3530db5887bf3a1b436689 Mon Sep 17 00:00:00 2001 From: AliciaRaven Date: Sun, 1 Feb 2015 15:05:56 +0000 Subject: Prevent null entries being treated as URI's when DataSnapshot service splits service string. The new config format for services to notify in the DataSnapshot module appends entries to the existing single string and always leaves a deliminator on the end of the string. This is causing it to split with a null string in the resulting array, which is treated as another service to notify and throws a URI format exception on start up. --- OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index f7b2338..600e826 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -395,7 +395,7 @@ namespace OpenSim.Region.DataSnapshot string delimStr = ";"; char [] delimiter = delimStr.ToCharArray(); - string[] services = servicesStr.Split(delimiter); + string[] services = servicesStr.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < services.Length; i++) { -- cgit v1.1 From 1eedc2b4af192973889341da5615139cfd65f152 Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 2 Feb 2015 02:47:47 -0800 Subject: Compute rotation for llLookAt() with local positive X axis pointing down --- .../Shared/Api/Implementation/LSL_Api.cs | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 97e3eeb..debc262 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3092,20 +3092,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Determine where we are looking from LSL_Vector from = llGetPos(); - // Work out the normalised vector from the source to the target - LSL_Vector delta = llVecNorm(target - from); - LSL_Vector angle = new LSL_Vector(0,0,0); - - // Calculate the yaw - // subtracting PI_BY_TWO is required to compensate for the odd SL co-ordinate system - angle.x = llAtan2(delta.z, delta.y) - ScriptBaseClass.PI_BY_TWO; - - // Calculate pitch - angle.y = llAtan2(delta.x, llSqrt((delta.y * delta.y) + (delta.z * delta.z))); - - // we need to convert from a vector describing - // the angles of rotation in radians into rotation value - LSL_Rotation rot = llEuler2Rot(angle); + // normalized direction to target + LSL_Vector dir = llVecNorm(target - from); + // use vertical to help compute left azis + LSL_Vector up = new LSL_Vector(0.0, 0.0, 1.0); + // find normalized left axis parallel to horizon + LSL_Vector left = llVecNorm(LSL_Vector.Cross(up, dir)); + // make up orthogonal to left and dir + up = LSL_Vector.Cross(dir, left); + + // compute rotation based on orthogonal azes + LSL_Rotation rot = new LSL_Rotation(0.0, 0.707107, 0.0, 0.707107) * llAxes2Rot(dir, left, up); // Per discussion with Melanie, for non-physical objects llLookAt appears to simply // set the rotation of the object, copy that behavior -- cgit v1.1 From 39754b2dca7229ed7ff7f92918d66a58c30e5977 Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 2 Feb 2015 04:03:04 -0800 Subject: correct some minor comment misspellings in last commit --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index debc262..4825556 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3094,14 +3094,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // normalized direction to target LSL_Vector dir = llVecNorm(target - from); - // use vertical to help compute left azis + // use vertical to help compute left axis LSL_Vector up = new LSL_Vector(0.0, 0.0, 1.0); // find normalized left axis parallel to horizon LSL_Vector left = llVecNorm(LSL_Vector.Cross(up, dir)); // make up orthogonal to left and dir up = LSL_Vector.Cross(dir, left); - // compute rotation based on orthogonal azes + // compute rotation based on orthogonal axes LSL_Rotation rot = new LSL_Rotation(0.0, 0.707107, 0.0, 0.707107) * llAxes2Rot(dir, left, up); // Per discussion with Melanie, for non-physical objects llLookAt appears to simply -- cgit v1.1 From 1d2616e7a24882b197de0db3d76c1e02a7cfcd90 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 3 Feb 2015 23:40:32 +0000 Subject: If the owner of an object is taking a copy from the scene (e.g. via the "take copy" option on a viewer) then only require owner copy perms, not copy and transfer. This matches Linden Lab behaviour and what was already possible via shift-copy. Transfer would not apply here as the owner and copier are the same. This is the only functional change, all other current take copy logic remains the same. Adds regression tests around relevant take copy cases. --- .../InventoryAccess/InventoryAccessModule.cs | 4 + .../World/Permissions/PermissionsModule.cs | 27 +- .../Framework/Scenes/SceneObjectGroup.Inventory.cs | 1 + .../Region/Framework/Scenes/SceneObjectGroup.cs | 5 + .../Framework/Scenes/Tests/SceneObjectCopyTests.cs | 347 +++++++++++++++++++++ .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 23 +- 7 files changed, 389 insertions(+), 20 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index f958510..a77bc63 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -614,6 +614,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess protected InventoryItemBase CreateItemForObject( DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID) { +// m_log.DebugFormat( +// "[BASIC INVENTORY ACCESS MODULE]: Creating item for object {0} {1} for folder {2}, action {3}", +// so.Name, so.UUID, folderID, action); +// // Get the user info of the item destination // UUID userID = UUID.Zero; diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index d8f9f8c..780ec69 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -801,8 +801,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions // Friends with benefits should be able to edit the objects too if (IsFriendWithPerms(currentUser, objectOwner)) + { // Return immediately, so that the administrator can share objects with friends return true; + } // Users should be able to edit what is over their land. ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); @@ -1522,6 +1524,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_bypassPermissions) return m_bypassPermissionsValue; bool permission = GenericObjectPermission(userID, objectID, false); + + SceneObjectGroup so = (SceneObjectGroup)m_scene.Entities[objectID]; + if (!permission) { if (!m_scene.Entities.ContainsKey(objectID)) @@ -1535,31 +1540,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; } - SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; // UUID taskOwner = null; // Added this because at this point in time it wouldn't be wise for // the administrator object permissions to take effect. // UUID objectOwner = task.OwnerID; - if ((task.RootPart.EveryoneMask & PERM_COPY) != 0) + if ((so.RootPart.EveryoneMask & PERM_COPY) != 0) permission = true; + } - if (task.OwnerID != userID) - { - if ((task.GetEffectivePermissions() & (PERM_COPY | PERM_TRANS)) != (PERM_COPY | PERM_TRANS)) - permission = false; - } - else - { - if ((task.GetEffectivePermissions() & PERM_COPY) != PERM_COPY) - permission = false; - } + if (so.OwnerID != userID) + { + if ((so.GetEffectivePermissions() & (PERM_COPY | PERM_TRANS)) != (PERM_COPY | PERM_TRANS)) + permission = false; } else { - SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; - - if ((task.GetEffectivePermissions() & (PERM_COPY | PERM_TRANS)) != (PERM_COPY | PERM_TRANS)) + if ((so.GetEffectivePermissions() & PERM_COPY) != PERM_COPY) permission = false; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 527ca35..81cef5b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -265,6 +265,7 @@ namespace OpenSim.Region.Framework.Scenes for (int i = 0; i < parts.Length; i++) { SceneObjectPart part = parts[i]; +// m_log.DebugFormat("[SCENE OBJECT GROUP INVENTORY]: Effective perms of {0} are {1}", part.Name, (OpenMetaverse.PermissionMask)part.OwnerMask); ownerMask &= part.OwnerMask; perms &= part.Inventory.MaskEffectivePermissions(); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 19e557f..20fe3ce 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2943,6 +2943,11 @@ namespace OpenSim.Region.Framework.Scenes uint lockMask = ~(uint)(PermissionMask.Move | PermissionMask.Modify); uint lockBit = RootPart.OwnerMask & (uint)(PermissionMask.Move | PermissionMask.Modify); RootPart.OwnerMask = (RootPart.OwnerMask & lockBit) | ((newOwnerMask | foldedPerms) & lockMask); + +// m_log.DebugFormat( +// "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}", +// (OpenMetaverse.PermissionMask)RootPart.OwnerMask, Name, Scene.Name); + RootPart.ScheduleFullUpdate(); } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs new file mode 100644 index 0000000..1d41d33 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs @@ -0,0 +1,347 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using Nini.Config; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.Framework.EntityTransfer; +using OpenSim.Region.CoreModules.Framework.InventoryAccess; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; +using OpenSim.Region.CoreModules.World.Permissions; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; +using OpenSim.Tests.Common; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + /// + /// Test copying of scene objects. + /// + /// + /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. + /// + [TestFixture] + public class SceneObjectCopyTests : OpenSimTestCase + { + [TestFixtureSetUp] + public void FixtureInit() + { + // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread. + // This facility was added after the original async delete tests were written, so it may be possible now + // to not bother explicitly disabling their async (since everything will be running sync). + Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest; + } + + [TestFixtureTearDown] + public void TearDown() + { + // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple + // threads. Possibly, later tests should be rewritten so none of them require async stuff (which regression + // tests really shouldn't). + Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod; + } + + [Test] + public void TestTakeCopyWhenCopierIsOwnerWithPerms() + { + TestHelpers.InMethod(); +// TestHelpers.EnableLogging(); + + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + + TestScene scene = new SceneHelpers().SetupScene("s1", TestHelpers.ParseTail(0x99), 1000, 1000, config); + SceneHelpers.SetupSceneModules(scene, config, new PermissionsModule(), new BasicInventoryAccessModule()); + UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(0x1)); + TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, ua.PrincipalID).ControllingClient; + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", ua.PrincipalID); + uint soLocalId = so.LocalId; +// so.UpdatePermissions( +// ua.PrincipalID, (byte)PermissionWho.Owner, so.LocalId, (uint)OpenMetaverse.PermissionMask.Copy, 1); +// so.UpdatePermissions( +// ua.PrincipalID, (byte)PermissionWho.Owner, so.LocalId, (uint)OpenMetaverse.PermissionMask.Transfer, 0); +// so.UpdatePermissions( +// ua.PrincipalID, (byte)PermissionWho.Base, so.LocalId, (uint)OpenMetaverse.PermissionMask.Transfer, 0); +// scene.HandleObjectPermissionsUpdate(client, client.AgentId, client.SessionId, (byte)PermissionWho.Owner, so.LocalId, (uint)OpenMetaverse.PermissionMask.Transfer, 0); + + // Ideally we might change these via client-focussed method calls as commented out above. However, this + // becomes very convoluted so we will set only the copy perm directly. + so.RootPart.BaseMask = (uint)OpenMetaverse.PermissionMask.Copy; +// so.RootPart.OwnerMask = (uint)OpenMetaverse.PermissionMask.Copy; + + List localIds = new List(); + localIds.Add(so.LocalId); + + // Specifying a UUID.Zero in this case will currently plop it in Lost and Found + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.TakeCopy, UUID.Zero); + + // Check that object isn't copied until we crank the sogd handle. + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart, Is.Not.Null); + Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); + + sogd.InventoryDeQueueAndDelete(); + + // Check that object is still there. + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); + + // Check that we have a copy in inventory + InventoryItemBase item + = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Lost And Found/so1"); + Assert.That(item, Is.Not.Null); + } + + [Test] + public void TestTakeCopyWhenCopierIsOwnerWithoutPerms() + { + TestHelpers.InMethod(); +// TestHelpers.EnableLogging(); + + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + + TestScene scene = new SceneHelpers().SetupScene("s1", TestHelpers.ParseTail(0x99), 1000, 1000, config); + SceneHelpers.SetupSceneModules(scene, config, new PermissionsModule(), new BasicInventoryAccessModule()); + UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(0x1)); + TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, ua.PrincipalID).ControllingClient; + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", ua.PrincipalID); + uint soLocalId = so.LocalId; + + so.RootPart.BaseMask = (uint)(OpenMetaverse.PermissionMask.All & ~OpenMetaverse.PermissionMask.Copy); + //so.RootPart.OwnerMask = (uint)(OpenMetaverse.PermissionMask.Copy & ~OpenMetaverse.PermissionMask.Copy); + + List localIds = new List(); + localIds.Add(so.LocalId); + + // Specifying a UUID.Zero in this case will currently plop it in Lost and Found + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.TakeCopy, UUID.Zero); + + // Check that object isn't copied until we crank the sogd handle. + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart, Is.Not.Null); + Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); + + sogd.InventoryDeQueueAndDelete(); + + // Check that object is still there. + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); + + // Check that we do not have a copy in inventory + InventoryItemBase item + = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Lost And Found/so1"); + Assert.That(item, Is.Null); + } + + [Test] + public void TestTakeCopyWhenCopierIsNotOwnerWithPerms() + { + TestHelpers.InMethod(); +// TestHelpers.EnableLogging(); + + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + + TestScene scene = new SceneHelpers().SetupScene("s1", TestHelpers.ParseTail(0x99), 1000, 1000, config); + SceneHelpers.SetupSceneModules(scene, config, new PermissionsModule(), new BasicInventoryAccessModule()); + UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(0x1)); + TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, ua.PrincipalID).ControllingClient; + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", TestHelpers.ParseTail(0x2)); + uint soLocalId = so.LocalId; + + // Base must allow transfer and copy + so.RootPart.BaseMask = (uint)(OpenMetaverse.PermissionMask.Copy | OpenMetaverse.PermissionMask.Transfer); + // Must be set so anyone can copy + so.RootPart.EveryoneMask = (uint)OpenMetaverse.PermissionMask.Copy; + + List localIds = new List(); + localIds.Add(so.LocalId); + + // Specifying a UUID.Zero in this case will plop it in the Objects folder + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.TakeCopy, UUID.Zero); + + // Check that object isn't copied until we crank the sogd handle. + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart, Is.Not.Null); + Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); + + sogd.InventoryDeQueueAndDelete(); + + // Check that object is still there. + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); + + // Check that we have a copy in inventory + InventoryItemBase item + = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); + Assert.That(item, Is.Not.Null); + } + + [Test] + public void TestTakeCopyWhenCopierIsNotOwnerWithoutPerms() + { + TestHelpers.InMethod(); +// TestHelpers.EnableLogging(); + + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + + TestScene scene = new SceneHelpers().SetupScene("s1", TestHelpers.ParseTail(0x99), 1000, 1000, config); + SceneHelpers.SetupSceneModules(scene, config, new PermissionsModule(), new BasicInventoryAccessModule()); + UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(0x1)); + TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, ua.PrincipalID).ControllingClient; + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", TestHelpers.ParseTail(0x2)); + uint soLocalId = so.LocalId; + + { + // Check that object is not copied if copy base perms is missing. + // Should not allow copy if base does not have this. + so.RootPart.BaseMask = (uint)OpenMetaverse.PermissionMask.Transfer; + // Must be set so anyone can copy + so.RootPart.EveryoneMask = (uint)OpenMetaverse.PermissionMask.Copy; + + // Check that object is not copied + List localIds = new List(); + localIds.Add(so.LocalId); + + // Specifying a UUID.Zero in this case will plop it in the Objects folder if we have perms + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.TakeCopy, UUID.Zero); + + // Check that object isn't copied until we crank the sogd handle. + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart, Is.Not.Null); + Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); + + sogd.InventoryDeQueueAndDelete(); + // Check that object is still there. + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); + + // Check that we have a copy in inventory + InventoryItemBase item + = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); + Assert.That(item, Is.Null); + } + + { + // Check that object is not copied if copy trans perms is missing. + // Should not allow copy if base does not have this. + so.RootPart.BaseMask = (uint)OpenMetaverse.PermissionMask.Copy; + // Must be set so anyone can copy + so.RootPart.EveryoneMask = (uint)OpenMetaverse.PermissionMask.Copy; + + // Check that object is not copied + List localIds = new List(); + localIds.Add(so.LocalId); + + // Specifying a UUID.Zero in this case will plop it in the Objects folder if we have perms + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.TakeCopy, UUID.Zero); + + // Check that object isn't copied until we crank the sogd handle. + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart, Is.Not.Null); + Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); + + sogd.InventoryDeQueueAndDelete(); + // Check that object is still there. + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); + + // Check that we have a copy in inventory + InventoryItemBase item + = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); + Assert.That(item, Is.Null); + } + + { + // Check that object is not copied if everyone copy perms is missing. + // Should not allow copy if base does not have this. + so.RootPart.BaseMask = (uint)(OpenMetaverse.PermissionMask.Copy | OpenMetaverse.PermissionMask.Transfer); + // Make sure everyone perm does not allow copy + so.RootPart.EveryoneMask = (uint)(OpenMetaverse.PermissionMask.All & ~OpenMetaverse.PermissionMask.Copy); + + // Check that object is not copied + List localIds = new List(); + localIds.Add(so.LocalId); + + // Specifying a UUID.Zero in this case will plop it in the Objects folder if we have perms + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.TakeCopy, UUID.Zero); + + // Check that object isn't copied until we crank the sogd handle. + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart, Is.Not.Null); + Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); + + sogd.InventoryDeQueueAndDelete(); + // Check that object is still there. + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart2, Is.Not.Null); + Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); + + // Check that we have a copy in inventory + InventoryItemBase item + = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); + Assert.That(item, Is.Null); + } + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index a8883b8..c97a765 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -185,7 +185,7 @@ namespace OpenSim.Tests.Common public void addInventoryItem(InventoryItemBase item) { -// InventoryFolderBase folder = m_folders[item.Folder]; + InventoryFolderBase folder = m_folders[item.Folder]; // m_log.DebugFormat( // "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index be3a0cb..2b272e6 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -46,20 +46,33 @@ namespace OpenSim.Tests.Common public XInventoryItem[] GetItems(string[] fields, string[] vals) { +// Console.WriteLine( +// "Requesting items, fields {0}, vals {1}", string.Join(", ", fields), string.Join(", ", vals)); + List origItems = Get(fields, vals, m_allItems.Values.ToList()); - return origItems.Select(i => i.Clone()).ToArray(); + XInventoryItem[] items = origItems.Select(i => i.Clone()).ToArray(); + +// Console.WriteLine("Found {0} items", items.Length); +// Array.ForEach(items, i => Console.WriteLine("Found item {0} {1}", i.inventoryName, i.inventoryID)); + + return items; } public XInventoryFolder[] GetFolders(string[] fields, string[] vals) { // Console.WriteLine( -// "Requesting folders, fields {0}, vals {1}", string.Join(",", fields), string.Join(",", vals)); +// "Requesting folders, fields {0}, vals {1}", string.Join(", ", fields), string.Join(", ", vals)); List origFolders = Get(fields, vals, m_allFolders.Values.ToList()); - return origFolders.Select(f => f.Clone()).ToArray(); + XInventoryFolder[] folders = origFolders.Select(f => f.Clone()).ToArray(); + +// Console.WriteLine("Found {0} folders", folders.Length); +// Array.ForEach(folders, f => Console.WriteLine("Found folder {0} {1}", f.folderName, f.folderID)); + + return folders; } public bool StoreFolder(XInventoryFolder folder) @@ -75,7 +88,9 @@ namespace OpenSim.Tests.Common { m_allItems[item.inventoryID] = item.Clone(); -// Console.WriteLine("Added item {0} {1}, creator {2}, owner {3}", item.inventoryName, item.inventoryID, item.creatorID, item.avatarID); +// Console.WriteLine( +// "Added item {0} {1}, folder {2}, creator {3}, owner {4}", +// item.inventoryName, item.inventoryID, item.parentFolderID, item.creatorID, item.avatarID); return true; } -- cgit v1.1 From 68343938215a438cd446a7db819a4f7d93ccacd4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 4 Feb 2015 00:10:13 +0000 Subject: Fix bug in JobEngine where an attempt to restart after stop would trigger an exception because the cancellation source was not recreated. --- OpenSim/Framework/Monitoring/JobEngine.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs index 44f5d9a..a32e4aa 100644 --- a/OpenSim/Framework/Monitoring/JobEngine.cs +++ b/OpenSim/Framework/Monitoring/JobEngine.cs @@ -78,7 +78,7 @@ namespace OpenSim.Framework.Monitoring private BlockingCollection m_jobQueue; - private CancellationTokenSource m_cancelSource = new CancellationTokenSource(); + private CancellationTokenSource m_cancelSource; /// /// Used to signal that we are ready to complete stop. @@ -105,6 +105,7 @@ namespace OpenSim.Framework.Monitoring m_finishedProcessingAfterStop.Reset(); m_jobQueue = new BlockingCollection(new ConcurrentQueue(), 5000); + m_cancelSource = new CancellationTokenSource(); WorkManager.StartThread( ProcessRequests, -- cgit v1.1 From 765fd024183aa855b50ce9c9707abebba55ca63a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 4 Feb 2015 17:04:59 +0000 Subject: For built-in groups, if a delegate throws an exception (e.g. due to network failure), always remove its request from the m_ActiveRequests list. If this is not done, all subsequent calls for the same data see that a request is apparantly already in progress and so wait for the result indefinitely. --- .../Addons/Groups/RemoteConnectorCacheWrapper.cs | 181 ++++++++++++++------- 1 file changed, 120 insertions(+), 61 deletions(-) diff --git a/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs b/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs index f121737..813f796 100644 --- a/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs +++ b/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs @@ -145,14 +145,20 @@ namespace OpenSim.Groups if (firstCall) { - //group = m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID, GroupName); - group = d(); + try + { + //group = m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID, GroupName); + group = d(); - lock (m_Cache) + lock (m_Cache) + { + m_Cache.AddOrUpdate(cacheKey, group, GROUPS_CACHE_TIMEOUT); + return (ExtendedGroupRecord)group; + } + } + finally { - m_Cache.AddOrUpdate(cacheKey, group, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - return (ExtendedGroupRecord)group; } } else @@ -244,13 +250,19 @@ namespace OpenSim.Groups if (firstCall) { - membership = d(); + try + { + membership = d(); - lock (m_Cache) + lock (m_Cache) + { + m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT); + return (ExtendedGroupMembershipData)membership; + } + } + finally { - m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - return (ExtendedGroupMembershipData)membership; } } else @@ -287,12 +299,18 @@ namespace OpenSim.Groups if (firstCall) { - membership = d(); - lock (m_Cache) + try + { + membership = d(); + lock (m_Cache) + { + m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT); + return (ExtendedGroupMembershipData)membership; + } + } + finally { - m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - return (ExtendedGroupMembershipData)membership; } } else @@ -328,12 +346,18 @@ namespace OpenSim.Groups if (firstCall) { - memberships = d(); - lock (m_Cache) + try + { + memberships = d(); + lock (m_Cache) + { + m_Cache.AddOrUpdate(cacheKey, memberships, GROUPS_CACHE_TIMEOUT); + return (List)memberships; + } + } + finally { - m_Cache.AddOrUpdate(cacheKey, memberships, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - return (List)memberships; } } else @@ -370,20 +394,26 @@ namespace OpenSim.Groups if (firstCall) { - List _members = d(); + try + { + List _members = d(); - if (_members != null && _members.Count > 0) - members = _members.ConvertAll(new Converter(m_ForeignImporter.ConvertGroupMembersData)); - else - members = new List(); + if (_members != null && _members.Count > 0) + members = _members.ConvertAll(new Converter(m_ForeignImporter.ConvertGroupMembersData)); + else + members = new List(); - lock (m_Cache) + lock (m_Cache) + { + //m_Cache.AddOrUpdate(cacheKey, members, GROUPS_CACHE_TIMEOUT); + m_Cache.AddOrUpdate(cacheKey, _members, GROUPS_CACHE_TIMEOUT); + + return (List)members; + } + } + finally { - //m_Cache.AddOrUpdate(cacheKey, members, GROUPS_CACHE_TIMEOUT); - m_Cache.AddOrUpdate(cacheKey, _members, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - - return (List)members; } } else @@ -498,16 +528,22 @@ namespace OpenSim.Groups if (firstCall) { - roles = d(); - if (roles != null) + try { - lock (m_Cache) + roles = d(); + if (roles != null) { - m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT); - m_ActiveRequests.Remove(cacheKey); - return (List)roles; + lock (m_Cache) + { + m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT); + return (List)roles; + } } } + finally + { + m_ActiveRequests.Remove(cacheKey); + } } else Thread.Sleep(50); @@ -542,23 +578,29 @@ namespace OpenSim.Groups if (firstCall) { - List _rmembers = d(); + try + { + List _rmembers = d(); - if (_rmembers != null && _rmembers.Count > 0) - rmembers = _rmembers.ConvertAll(new Converter(m_ForeignImporter.ConvertGroupRoleMembersData)); - else - rmembers = new List(); + if (_rmembers != null && _rmembers.Count > 0) + rmembers = _rmembers.ConvertAll(new Converter(m_ForeignImporter.ConvertGroupRoleMembersData)); + else + rmembers = new List(); - lock (m_Cache) + lock (m_Cache) + { + // For some strange reason, when I cache the list of GroupRoleMembersData, + // it gets emptied out. The TryGet gets an empty list... + //m_Cache.AddOrUpdate(cacheKey, rmembers, GROUPS_CACHE_TIMEOUT); + // Caching the list of ExtendedGroupRoleMembersData doesn't show that issue + // I don't get it. + m_Cache.AddOrUpdate(cacheKey, _rmembers, GROUPS_CACHE_TIMEOUT); + return (List)rmembers; + } + } + finally { - // For some strange reason, when I cache the list of GroupRoleMembersData, - // it gets emptied out. The TryGet gets an empty list... - //m_Cache.AddOrUpdate(cacheKey, rmembers, GROUPS_CACHE_TIMEOUT); - // Caching the list of ExtendedGroupRoleMembersData doesn't show that issue - // I don't get it. - m_Cache.AddOrUpdate(cacheKey, _rmembers, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - return (List)rmembers; } } else @@ -667,12 +709,19 @@ namespace OpenSim.Groups if (firstCall) { - roles = d(); - lock (m_Cache) + try + { + roles = d(); + lock (m_Cache) + { + m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT); + m_ActiveRequests.Remove(cacheKey); + return (List)roles; + } + } + finally { - m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - return (List)roles; } } else @@ -768,13 +817,19 @@ namespace OpenSim.Groups if (firstCall) { - GroupNoticeInfo _notice = d(); + try + { + GroupNoticeInfo _notice = d(); - lock (m_Cache) + lock (m_Cache) + { + m_Cache.AddOrUpdate(cacheKey, _notice, GROUPS_CACHE_TIMEOUT); + return _notice; + } + } + finally { - m_Cache.AddOrUpdate(cacheKey, _notice, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - return _notice; } } else @@ -810,20 +865,24 @@ namespace OpenSim.Groups if (firstCall) { - notices = d(); + try + { + notices = d(); - lock (m_Cache) + lock (m_Cache) + { + m_Cache.AddOrUpdate(cacheKey, notices, GROUPS_CACHE_TIMEOUT); + return (List)notices; + } + } + finally { - m_Cache.AddOrUpdate(cacheKey, notices, GROUPS_CACHE_TIMEOUT); m_ActiveRequests.Remove(cacheKey); - return (List)notices; } } else Thread.Sleep(50); } } - - } -} +} \ No newline at end of file -- cgit v1.1 From bde7b2a7b5d164994a0174f923f04efa6f00c4f4 Mon Sep 17 00:00:00 2001 From: dahlia Date: Thu, 5 Feb 2015 13:17:31 -0800 Subject: Allow MaterialsModule to be enabled by default if [Materials] is absent from OpenSim.ini --- .../Region/OptionalModules/Materials/MaterialsModule.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index ea582fa..739eb2c 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs @@ -66,19 +66,16 @@ namespace OpenSim.Region.OptionalModules.Materials private Scene m_scene = null; private bool m_enabled = false; - public Dictionary m_regionMaterials = new Dictionary(); - public void Initialise(IConfigSource source) { - IConfig config = source.Configs["Materials"]; - if (config == null) - return; + m_enabled = true; // default is enabled - m_enabled = config.GetBoolean("enable_materials", true); - if (!m_enabled) - return; + IConfig config = source.Configs["Materials"]; + if (config != null) + m_enabled = config.GetBoolean("enable_materials", m_enabled); - m_log.DebugFormat("[Materials]: Initialized"); + if (m_enabled) + m_log.DebugFormat("[Materials]: Initialized"); } public void Close() -- cgit v1.1 From 95a0f0d47b1e4150be21779ae5bad1a6b7a1d469 Mon Sep 17 00:00:00 2001 From: dahlia Date: Thu, 5 Feb 2015 13:44:39 -0800 Subject: replace accidently deleted line from last commit --- OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index 739eb2c..3ce6178 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs @@ -66,6 +66,8 @@ namespace OpenSim.Region.OptionalModules.Materials private Scene m_scene = null; private bool m_enabled = false; + public Dictionary m_regionMaterials = new Dictionary(); + public void Initialise(IConfigSource source) { m_enabled = true; // default is enabled -- cgit v1.1 From ee810a2cb526f49deefd307cbc0a84ecb52c9053 Mon Sep 17 00:00:00 2001 From: dahlia Date: Thu, 5 Feb 2015 14:29:51 -0800 Subject: Set angular velocity in physics actor in SceneObjectPart.AngularVelocity setter. Enables llSetAngularVelocity() --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 1ca250a..6f8d07c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -957,7 +957,13 @@ namespace OpenSim.Region.Framework.Scenes } return m_angularVelocity; } - set { m_angularVelocity = value; } + set + { + m_angularVelocity = value; + PhysicsActor actor = PhysActor; + if ((actor != null) && actor.IsPhysical) + actor.RotationalVelocity = m_angularVelocity; + } } /// -- cgit v1.1 From 3b7c3378f159f31a87fe71d3ae295f2816e1be11 Mon Sep 17 00:00:00 2001 From: dahlia Date: Thu, 5 Feb 2015 23:13:06 -0800 Subject: Manage Angular Velocity during llLookAt() rotation of physical objects --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6f8d07c..887c7fc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4881,8 +4881,10 @@ namespace OpenSim.Region.Framework.Scenes { if (APIDTarget != Quaternion.Identity) { + if (m_APIDIterations <= 1) { + AngularVelocity = Vector3.Zero; UpdateRotation(APIDTarget); APIDTarget = Quaternion.Identity; return; @@ -4890,7 +4892,15 @@ namespace OpenSim.Region.Framework.Scenes Quaternion rot = Quaternion.Slerp(RotationOffset,APIDTarget,1.0f/(float)m_APIDIterations); rot.Normalize(); - UpdateRotation(rot); + + Quaternion dR = rot / RotationOffset; + Vector3 axis; + float angle; + dR.GetAxisAngle(out axis, out angle); + axis *= RotationOffset; + axis.Normalize(); + axis *= angle / 11; // simulator update frequency is 10-11 Hz + AngularVelocity = axis; m_APIDIterations--; -- cgit v1.1 From 506e62f81548200899b5b4f844f91582ad358962 Mon Sep 17 00:00:00 2001 From: dahlia Date: Fri, 6 Feb 2015 22:36:26 -0800 Subject: llLookAt() and llRotLookAt(): all orientation updates now done via angular velocity manipulation. Also correct some orientation glitches during interpolation. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 45 ++++++++++++++-------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 887c7fc..ea0245c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4881,28 +4881,39 @@ namespace OpenSim.Region.Framework.Scenes { if (APIDTarget != Quaternion.Identity) { - - if (m_APIDIterations <= 1) + PhysicsActor pa = ParentGroup.RootPart.PhysActor; + if (pa == null || !pa.IsPhysical) { - AngularVelocity = Vector3.Zero; - UpdateRotation(APIDTarget); - APIDTarget = Quaternion.Identity; + StopLookAt(); return; } - Quaternion rot = Quaternion.Slerp(RotationOffset,APIDTarget,1.0f/(float)m_APIDIterations); - rot.Normalize(); + Quaternion currRot = GetWorldRotation(); + currRot.Normalize(); + + // difference between current orientation and desired orientation + Quaternion dR = new Quaternion(currRot.X, currRot.Y, currRot.Z, -currRot.W) * APIDTarget; + + // find axis of rotation to rotate to desired orientation + Vector3 axis = Vector3.UnitX; + float s = (float)Math.Sqrt(1.0f - dR.W * dR.W); + if (s >= 0.001) + { + float invS = 1.0f / s; + if (dR.W < 0) invS = -invS; + axis = new Vector3(dR.X * invS, dR.Y * invS, dR.Z * invS) * currRot; + axis.Normalize(); + } - Quaternion dR = rot / RotationOffset; - Vector3 axis; - float angle; - dR.GetAxisAngle(out axis, out angle); - axis *= RotationOffset; - axis.Normalize(); - axis *= angle / 11; // simulator update frequency is 10-11 Hz - AngularVelocity = axis; - - m_APIDIterations--; + // angle between current and desired orientation + float angle = 2.0f * (float)Math.Acos(dR.W); + if (angle > Math.PI) + angle = 2.0f * (float)Math.PI - angle; + + // set angular velocity to rotate to desired orientation + // with velocity proportional to strength and angle + // the factor of 10 seems to make rotation speed closer to LL implementation + AngularVelocity = axis * angle * APIDStrength * (float)Math.PI * 10.0f; // This ensures that we'll check this object on the next iteration ParentGroup.QueueForUpdateCheck(); -- cgit v1.1 From 2ed1afd32b1d7573dec664d61538475523b10edc Mon Sep 17 00:00:00 2001 From: dahlia Date: Sat, 7 Feb 2015 14:17:37 -0800 Subject: llLookAt(): reduce and clamp strengh to reduce probability of overshoot --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ea0245c..8d28915 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4910,10 +4910,13 @@ namespace OpenSim.Region.Framework.Scenes if (angle > Math.PI) angle = 2.0f * (float)Math.PI - angle; + // clamp strength to avoid overshoot + float strength = APIDStrength; + if (strength > 1.0) strength = 1.0f; + // set angular velocity to rotate to desired orientation // with velocity proportional to strength and angle - // the factor of 10 seems to make rotation speed closer to LL implementation - AngularVelocity = axis * angle * APIDStrength * (float)Math.PI * 10.0f; + AngularVelocity = axis * angle * strength * (float)Math.PI; // This ensures that we'll check this object on the next iteration ParentGroup.QueueForUpdateCheck(); -- cgit v1.1 From 12119a9d7dd16126c80284892412dc5253420fa4 Mon Sep 17 00:00:00 2001 From: dahlia Date: Sat, 7 Feb 2015 17:39:46 -0800 Subject: llLookAt() strength parameter should slow rotation as it is increased. Thanks Vegaslan for pointing this out. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8d28915..af7121d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4882,7 +4882,7 @@ namespace OpenSim.Region.Framework.Scenes if (APIDTarget != Quaternion.Identity) { PhysicsActor pa = ParentGroup.RootPart.PhysActor; - if (pa == null || !pa.IsPhysical) + if (pa == null || !pa.IsPhysical || APIDStrength < 0.04) { StopLookAt(); return; @@ -4911,7 +4911,7 @@ namespace OpenSim.Region.Framework.Scenes angle = 2.0f * (float)Math.PI - angle; // clamp strength to avoid overshoot - float strength = APIDStrength; + float strength = 1.0f / APIDStrength; if (strength > 1.0) strength = 1.0f; // set angular velocity to rotate to desired orientation -- cgit v1.1 From 53b23a9adccbef9951ba9b9422d18dc6ce59227c Mon Sep 17 00:00:00 2001 From: dahlia Date: Sat, 7 Feb 2015 22:52:12 -0800 Subject: Somewhat naive implementation of RotationalVelocity setter for ODE. Enables llSetRotationalVelocity(), llTargetOmega(), llLookAt(), and probably a few more LSL features for physical objects in ODE. --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index f5a25d6..f934b8a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -785,6 +785,14 @@ namespace OpenSim.Region.Physics.OdePlugin } } + private void setAngularVelocity(float x, float y, float z) + { + if (Body != (IntPtr)0) + { + d.BodySetAngularVel(Body, x, y, z); + } + } + /// /// Stop a prim from being subject to physics. /// @@ -2645,6 +2653,7 @@ Console.WriteLine(" JointCreateFixed"); if (value.IsFinite()) { m_rotationalVelocity = value; + setAngularVelocity(value.X, value.Y, value.Z); } else { -- cgit v1.1 From dd6f560c05caafed740de037eb2b76fcf3924a4a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 11 Feb 2015 00:53:56 +0000 Subject: If serialized scene object XML has a SavedScriptState with no UUID, then read past the innerXML instead of wrongly continously looping on the same element. Addresses http://opensimulator.org/mantis/view.php?id=7437 --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 20fe3ce..0a1a226 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -924,13 +924,17 @@ namespace OpenSim.Region.Framework.Scenes string uuid = reader.GetAttribute("UUID"); + // Even if there is no UUID attribute for some strange reason, we must always read the inner XML + // so we don't continually keep checking the same SavedScriptedState element. + string innerXml = reader.ReadInnerXml(); + if (uuid != null) { // m_log.DebugFormat("[SCENE OBJECT GROUP]: Found state for item ID {0} in object {1}", uuid, Name); UUID itemid = new UUID(uuid); if (itemid != UUID.Zero) - m_savedScriptState[itemid] = reader.ReadInnerXml(); + m_savedScriptState[itemid] = innerXml; } else { -- cgit v1.1 From 85f3380480d1ce7708485dc7f298d09266579950 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Feb 2015 21:00:10 +0000 Subject: Add missing BSD headers to files in OpenSim/Framework/ServiceAuth --- .../ServiceAuth/BasicHttpAuthentication.cs | 29 +++++++++++++++++++++- OpenSim/Framework/ServiceAuth/IServiceAuth.cs | 29 +++++++++++++++++++++- OpenSim/Framework/ServiceAuth/ServiceAuth.cs | 29 +++++++++++++++++++++- 3 files changed, 84 insertions(+), 3 deletions(-) diff --git a/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs b/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs index d182a71..b3d64e1 100644 --- a/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs +++ b/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Reflection; diff --git a/OpenSim/Framework/ServiceAuth/IServiceAuth.cs b/OpenSim/Framework/ServiceAuth/IServiceAuth.cs index 415dc12..fdd97b2 100644 --- a/OpenSim/Framework/ServiceAuth/IServiceAuth.cs +++ b/OpenSim/Framework/ServiceAuth/IServiceAuth.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using System.Collections.Specialized; diff --git a/OpenSim/Framework/ServiceAuth/ServiceAuth.cs b/OpenSim/Framework/ServiceAuth/ServiceAuth.cs index bc32d90..5ab613b 100644 --- a/OpenSim/Framework/ServiceAuth/ServiceAuth.cs +++ b/OpenSim/Framework/ServiceAuth/ServiceAuth.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using Nini.Config; -- cgit v1.1 From f62008f728047e9cfe2ba2edaef18e186c36260e Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 13 Feb 2015 20:59:13 -0800 Subject: BulletSim: bring the BulletSim dll's and so's up to date with the sources in the 'libs' source repository. No functional changes. --- bin/lib32/BulletSim.dll | Bin 1337856 -> 1338880 bytes bin/lib32/libBulletSim.so | Bin 2311537 -> 2312132 bytes bin/lib64/BulletSim.dll | Bin 1546752 -> 1547264 bytes bin/lib64/libBulletSim.so | Bin 2474914 -> 2475617 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll index ddc2f48..6d006bf 100755 Binary files a/bin/lib32/BulletSim.dll and b/bin/lib32/BulletSim.dll differ diff --git a/bin/lib32/libBulletSim.so b/bin/lib32/libBulletSim.so index 8637528..ec29f58 100755 Binary files a/bin/lib32/libBulletSim.so and b/bin/lib32/libBulletSim.so differ diff --git a/bin/lib64/BulletSim.dll b/bin/lib64/BulletSim.dll index 60fa59e..82774a2 100755 Binary files a/bin/lib64/BulletSim.dll and b/bin/lib64/BulletSim.dll differ diff --git a/bin/lib64/libBulletSim.so b/bin/lib64/libBulletSim.so index e3df064..8b09275 100755 Binary files a/bin/lib64/libBulletSim.so and b/bin/lib64/libBulletSim.so differ -- cgit v1.1 From 2700b096bc5d78ffd94a907475112a4babd3a489 Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 16 Feb 2015 19:06:01 -0800 Subject: Filter NaN and Infinity values at SOP AngularVelocity setter --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index af7121d..6e56f60 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -959,7 +959,12 @@ namespace OpenSim.Region.Framework.Scenes } set { - m_angularVelocity = value; + if (float.IsNaN(value.X) || float.IsNaN(value.Y) || float.IsNaN(value.Z) + || float.IsInfinity(value.X) || float.IsInfinity(value.Y) || float.IsInfinity(value.Z)) + m_angularVelocity = Vector3.Zero; + else + m_angularVelocity = value; + PhysicsActor actor = PhysActor; if ((actor != null) && actor.IsPhysical) actor.RotationalVelocity = m_angularVelocity; -- cgit v1.1 From 78814a1533cbb545d40582351237505fcfbd0efe Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 16 Feb 2015 19:42:36 -0800 Subject: Use a boolean flag to signal lookat is running instead of Quaternion.Identity so it can be a valid target orientation --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6e56f60..4a8be42 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -266,7 +266,7 @@ namespace OpenSim.Region.Framework.Scenes public Quaternion SpinOldOrientation = Quaternion.Identity; - protected int m_APIDIterations = 0; + protected bool m_APIDActive = false; protected Quaternion m_APIDTarget = Quaternion.Identity; protected float m_APIDDamp = 0; protected float m_APIDStrength = 0; @@ -642,6 +642,12 @@ namespace OpenSim.Region.Framework.Scenes } } + protected bool APIDActive + { + get { return m_APIDActive; } + set { m_APIDActive = value; } + } + protected Quaternion APIDTarget { get { return m_APIDTarget; } @@ -2621,7 +2627,7 @@ namespace OpenSim.Region.Framework.Scenes return; } - m_APIDIterations = 1 + (int)(Math.PI * APIDStrength); + APIDActive = true; } // Necessary to get the lookat deltas applied @@ -2635,7 +2641,7 @@ namespace OpenSim.Region.Framework.Scenes public void StopLookAt() { - APIDTarget = Quaternion.Identity; + APIDActive = false; } @@ -4884,7 +4890,7 @@ namespace OpenSim.Region.Framework.Scenes { try { - if (APIDTarget != Quaternion.Identity) + if (APIDActive) { PhysicsActor pa = ParentGroup.RootPart.PhysActor; if (pa == null || !pa.IsPhysical || APIDStrength < 0.04) -- cgit v1.1 From 8b2af1071f37e45dc330524a4731581867616b21 Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 16 Feb 2015 23:51:37 -0800 Subject: Add NaN and Infinity tests for SOP Velocity and Acceleration setters. --- OpenSim/Framework/Util.cs | 16 ++++++++++++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 18 +++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 836fa5f..56a90b1 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -420,6 +420,22 @@ namespace OpenSim.Framework return x; } + /// + /// Check if any of the values in a Vector3 are NaN or Infinity + /// + /// Vector3 to check + /// + public static bool IsNanOrInfinity(Vector3 v) + { + if (float.IsNaN(v.X) || float.IsNaN(v.Y) || float.IsNaN(v.Z)) + return true; + + if (float.IsInfinity(v.X) || float.IsInfinity(v.Y) || float.IsNaN(v.Z)) + return true; + + return false; + } + // Inclusive, within range test (true if equal to the endpoints) public static bool InRange(T x, T min, T max) where T : IComparable diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4a8be42..57ec1ae 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -929,14 +929,17 @@ namespace OpenSim.Region.Framework.Scenes set { - m_velocity = value; + if (Util.IsNanOrInfinity(value)) + m_velocity = Vector3.Zero; + else + m_velocity = value; PhysicsActor actor = PhysActor; if (actor != null) { if (actor.IsPhysical) { - actor.Velocity = value; + actor.Velocity = m_velocity; ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); } } @@ -965,8 +968,7 @@ namespace OpenSim.Region.Framework.Scenes } set { - if (float.IsNaN(value.X) || float.IsNaN(value.Y) || float.IsNaN(value.Z) - || float.IsInfinity(value.X) || float.IsInfinity(value.Y) || float.IsInfinity(value.Z)) + if (Util.IsNanOrInfinity(value)) m_angularVelocity = Vector3.Zero; else m_angularVelocity = value; @@ -981,7 +983,13 @@ namespace OpenSim.Region.Framework.Scenes public Vector3 Acceleration { get { return m_acceleration; } - set { m_acceleration = value; } + set + { + if (Util.IsNanOrInfinity(value)) + m_acceleration = Vector3.Zero; + else + m_acceleration = value; + } } public string Description { get; set; } -- cgit v1.1 From e4f0cdd2636bbe817d2b105728902a112f82db2f Mon Sep 17 00:00:00 2001 From: dahlia Date: Wed, 18 Feb 2015 12:52:16 -0800 Subject: Comment out unnecessary "Region Found!" alert message when searching map --- OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index c1a398d..d862f18 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -217,8 +217,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { if (regionInfos.Count == 0) remoteClient.SendAlertMessage("No regions found with that name."); - else if (regionInfos.Count == 1) - remoteClient.SendAlertMessage("Region found!"); + // this seems unnecessary because found regions will show up in the search results + //else if (regionInfos.Count == 1) + // remoteClient.SendAlertMessage("Region found!"); } } -- cgit v1.1 From 85133daae05118021dba3b00dc0475142c1de565 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Feb 2015 21:45:19 +0000 Subject: minor: Add explanation that [Startup] CombineContiguousRegions should be false for varregions. --- bin/OpenSim.ini.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index d352c33..1b5a4af 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -187,12 +187,13 @@ ;; YOU HAVE BEEN WARNED!!! ; TrustBinaries = false - ;# {CombineContiguousRegions} {} {Create megaregions where possible? (Do not use with existing content!)} {true false} false + ;# {CombineContiguousRegions} {} {Create megaregions where possible? (Do not use with existing content or varregions!)} {true false} false ;; Combine all contiguous regions into one large megaregion ;; Order your regions from South to North, West to East in your regions.ini ;; and then set this to true ;; Warning! Don't use this with regions that have existing content!, ;; This will likely break them + ;; Also, this setting should be set to false for varregions as they are proper larger single regions rather than combined smaller regions. ; CombineContiguousRegions = false ;# {InworldRestartShutsDown} {} {Shutdown instance on region restart?} {true false} false -- cgit v1.1 From 264047dba004e13b8c2f6843945ec91ed3deb058 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Feb 2015 22:39:02 +0000 Subject: Add the type of the unrecognized node to the HG asset mapping error message in TransformXml() --- OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 6abdc6f..2be3117 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -319,7 +319,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess break; default: - m_log.WarnFormat("[HG ASSET MAPPER]: Unrecognized node in asset XML transform in {0}", m_scene.Name); + m_log.WarnFormat( + "[HG ASSET MAPPER]: Unrecognized node {0} in asset XML transform in {1}", + reader.NodeType, m_scene.Name); break; } } -- cgit v1.1 From 7a86b01226199ec061f5723c79d190f729fc9a31 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Feb 2015 23:09:43 +0000 Subject: Make any exception that gets to LLClientView.ProcessSpecificPacketAsync() tells us the exception type as well as the message and stacktrace details. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index bb4f8a7..ee0f790 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -772,9 +772,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP catch (Exception e) { // Make sure that we see any exception caused by the asynchronous operation. - m_log.ErrorFormat( - "[LLCLIENTVIEW]: Caught exception while processing {0} for {1}, {2} {3}", - packetObject.Pack, Name, e.Message, e.StackTrace); + m_log.Error( + string.Format( + "[LLCLIENTVIEW]: Caught exception while processing {0} for {1} ", packetObject.Pack, Name), + e); } } -- cgit v1.1 From c90c22ed2804a3cc2b73ece42db5306782986bf4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Feb 2015 23:50:25 +0000 Subject: If HGAssetMapper.PostAsset fails then be more explicit about the uuid, type, size and base asset uuid of the failure for debugging purposes. --- .../Framework/InventoryAccess/HGAssetMapper.cs | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 2be3117..0ed8403 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -480,12 +480,37 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { asset = m_scene.AssetService.Get(uuid.ToString()); if (asset == null) + { m_log.DebugFormat("[HG ASSET MAPPER]: Could not find asset {0}", uuid); + } else - success &= PostAsset(userAssetURL, asset); + { + try + { + success &= PostAsset(userAssetURL, asset); + } + catch (Exception e) + { + m_log.Error( + string.Format( + "[HG ASSET MAPPER]: Failed to post asset {0} (type {1}, length {2}) referenced from {3} to {4} with exception ", + asset.ID, asset.Type, asset.Data.Length, assetID, userAssetURL), + e); + + // For debugging purposes for now we will continue to throw the exception up the stack as was already happening. However, after + // debugging we may want to simply report the failure if we can tell this is due to a failure + // with a particular asset and not a destination network failure where all asset posts will fail (and + // generate large amounts of log spam). + throw e; + } + } } else - m_log.DebugFormat("[HG ASSET MAPPER]: Didn't post asset {0} because it already exists in asset server {1}", uuid, userAssetURL); + { + m_log.DebugFormat( + "[HG ASSET MAPPER]: Didn't post asset {0} referenced from {1} because it already exists in asset server {2}", + uuid, assetID, userAssetURL); + } } if (!success) -- cgit v1.1 From c67b3407d4860f393c086201e6a0f0e0f0bba5aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 21 Feb 2015 00:08:49 +0000 Subject: In HGAssetMapper.RewriteSOP(), don't explicitly end the document. The document here has no 1439996 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/libBulletSim.dylib b/bin/lib32/libBulletSim.dylib index 3c2de2d..b7a42e3 100755 Binary files a/bin/lib32/libBulletSim.dylib and b/bin/lib32/libBulletSim.dylib differ -- cgit v1.1 From 8333dcf388150902e34537275bdfd0bcb902913e Mon Sep 17 00:00:00 2001 From: dahlia Date: Tue, 24 Feb 2015 17:16:30 -0800 Subject: llLookAt(): use non-physical rotation if host prim is a physical attachment --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 4825556..ebdd9da 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3108,7 +3108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // set the rotation of the object, copy that behavior PhysicsActor pa = m_host.PhysActor; - if (strength == 0 || pa == null || !pa.IsPhysical) + if (m_host.ParentGroup.IsAttachment || strength == 0 || pa == null || !pa.IsPhysical) { llSetRot(rot); } -- cgit v1.1 From 686b22da6e460c7869586e88332c981d7fbaf627 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Feb 2015 20:01:34 +0000 Subject: On shutdown (job engine stop), don't allow the ObjectDisposedException on BlockingCollection.Take() to propogate if the running thread checked IsRunning before the stop thread set it and disposed of the canellation source. Looks to address http://opensimulator.org/mantis/view.php?id=7453 --- OpenSim/Framework/Monitoring/JobEngine.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs index a32e4aa..6db9a67 100644 --- a/OpenSim/Framework/Monitoring/JobEngine.cs +++ b/OpenSim/Framework/Monitoring/JobEngine.cs @@ -161,7 +161,6 @@ namespace OpenSim.Framework.Monitoring finally { m_cancelSource.Dispose(); - m_jobQueue = null; } } } @@ -250,7 +249,19 @@ namespace OpenSim.Framework.Monitoring { while (IsRunning || m_jobQueue.Count > 0) { - CurrentJob = m_jobQueue.Take(m_cancelSource.Token); + try + { + CurrentJob = m_jobQueue.Take(m_cancelSource.Token); + } + catch (ObjectDisposedException e) + { + // If we see this whilst not running then it may be due to a race where this thread checks + // IsRunning after the stopping thread sets it to false and disposes of the cancellation source. + if (IsRunning) + throw e; + else + break; + } if (LogLevel >= 1) m_log.DebugFormat("[{0}]: Processing job {1}", LoggingName, CurrentJob.Name); -- cgit v1.1 From b1b72d7c2f16e7d1e239a0579dc0b28ea9812ed7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Feb 2015 20:30:03 +0000 Subject: Reduce coupling in regression test task inventory creation methods to make them usable in tests with no scene present --- .../Attachments/Tests/AttachmentsModuleTests.cs | 4 +-- .../Framework/Scenes/Tests/TaskInventoryTests.cs | 8 ++--- .../Framework/Scenes/Tests/UuidGathererTests.cs | 39 +++++++++++++++++++++- .../ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs | 2 +- .../Shared/Tests/LSL_ApiInventoryTests.cs | 10 +++--- .../Shared/Tests/LSL_ApiLinkingTests.cs | 6 ++-- .../Shared/Tests/LSL_ApiNotecardTests.cs | 6 ++-- .../ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs | 2 +- .../Shared/Tests/OSSL_ApiAttachmentTests.cs | 12 +++---- .../XEngine/Tests/XEnginePersistenceTests.cs | 2 +- .../Tests/Common/Helpers/TaskInventoryHelpers.cs | 36 ++++++++++---------- 11 files changed, 82 insertions(+), 45 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 5fb995b..f0dc238 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs @@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10); TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript( - scene, + scene.AssetService, so.RootPart, "scriptItem", "default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }"); @@ -659,7 +659,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10); TaskInventoryItem scriptTaskItem = TaskInventoryHelpers.AddScript( - scene, + scene.AssetService, so.RootPart, "scriptItem", "default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }"); diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 9655d19..8ec6974 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Tests // Create an object embedded inside the first UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); - TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); + TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId); Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId)); @@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Tests // Create an object embedded inside the first UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); TaskInventoryItem taskSceneObjectItem - = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); + = TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); scene.AddSceneObject(sog1); @@ -129,7 +129,7 @@ namespace OpenSim.Region.Framework.Tests SceneObjectPart sop1 = sog1.RootPart; TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard( - scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); + scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); InventoryFolderBase folder = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; @@ -162,7 +162,7 @@ namespace OpenSim.Region.Framework.Tests SceneObjectPart sop1 = sog1.RootPart; TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard( - scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); + scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); // Perform test string message; diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 4ae27d7..0b41039 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -89,7 +89,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); - + UUID ownerId = TestHelpers.ParseTail(0x10); UUID embeddedId = TestHelpers.ParseTail(0x20); UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); @@ -120,5 +120,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId)); Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId)); } + + [Test] + public void TestTaskItem() + { + TestHelpers.InMethod(); + TestHelpers.EnableLogging(); + + UUID ownerId = TestHelpers.ParseTail(0x10); + UUID embeddedId = TestHelpers.ParseTail(0x20); + UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); + UUID missingEmbeddedId = TestHelpers.ParseTail(0x22); + UUID ncAssetId = TestHelpers.ParseTail(0x30); + + AssetBase ncAsset + = AssetHelpers.CreateNotecardAsset( + ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId)); + m_assetService.Store(ncAsset); + + AssetBase embeddedAsset + = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId)); + m_assetService.Store(embeddedAsset); + + AssetBase secondLevelEmbeddedAsset + = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when."); + m_assetService.Store(secondLevelEmbeddedAsset); + + m_uuidGatherer.AddForInspection(ncAssetId); + m_uuidGatherer.GatherAll(); + + // foreach (UUID key in m_uuidGatherer.GatheredUuids.Keys) + // System.Console.WriteLine("key : {0}", key); + + Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(3)); + Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(ncAssetId)); + Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId)); + Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId)); + } } } \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs index 14e45ff..e35de9c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs @@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine, m_urlModule); SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene); - m_scriptItem = TaskInventoryHelpers.AddScript(m_scene, so.RootPart); + m_scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, so.RootPart); // This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm. // Possibly this could be done and we could obtain it directly from the MockScriptEngine. diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs index 9fd8532..3ff4c6b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs @@ -91,7 +91,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // Create an object embedded inside the first UUID itemId = TestHelpers.ParseTail(0x20); - TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, userId); + TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, userId); LSL_Api api = new LSL_Api(); api.Initialize(m_engine, so1.RootPart, null, null); @@ -131,7 +131,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // Create an object embedded inside the first UUID itemId = TestHelpers.ParseTail(0x20); - TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, user1Id); + TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, user1Id); // Create a second object SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100); @@ -188,7 +188,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // Create an object embedded inside the first UUID itemId = TestHelpers.ParseTail(0x20); - TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, user1Id); + TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, user1Id); UserAccountHelpers.CreateUserWithInventory(m_scene, user2Id); @@ -223,7 +223,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // Create an object embedded inside the first UUID itemId = TestHelpers.ParseTail(0x20); TaskInventoryItem tii - = TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, user1Id); + = TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, user1Id); tii.NextPermissions &= ~((uint)PermissionMask.Modify); UserAccountHelpers.CreateUserWithInventory(m_scene, user2Id); @@ -251,7 +251,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests m_scene.AddSceneObject(sourceSo); LSL_Api api = new LSL_Api(); api.Initialize(m_engine, sourceSo.RootPart, null, null); - TaskInventoryHelpers.AddScript(m_scene, sourceSo.RootPart, "script", "Hello World"); + TaskInventoryHelpers.AddScript(m_scene.AssetService, sourceSo.RootPart, "script", "Hello World"); SceneObjectGroup targetSo = SceneHelpers.AddSceneObject(m_scene, "targetSo", user1Id); SceneObjectGroup otherOwnedTargetSo = SceneHelpers.AddSceneObject(m_scene, "otherOwnedTargetSo", user2Id); diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs index f347869..b6f5e09 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // FIXME: This should really be a script item (with accompanying script) TaskInventoryItem grp1Item = TaskInventoryHelpers.AddNotecard( - m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); + m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId, "grp2-", 0x20); @@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // FIXME: This should really be a script item (with accompanying script) TaskInventoryItem grp1Item = TaskInventoryHelpers.AddNotecard( - m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); + m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; @@ -155,7 +155,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // FIXME: This should really be a script item (with accompanying script) TaskInventoryItem grp1Item = TaskInventoryHelpers.AddNotecard( - m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); + m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs index b9028ab..2ac12cb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine); m_so = SceneHelpers.AddSceneObject(m_scene); - m_scriptItem = TaskInventoryHelpers.AddScript(m_scene, m_so.RootPart); + m_scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, m_so.RootPart); // This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm. // Possibly this could be done and we could obtain it directly from the MockScriptEngine. @@ -77,7 +77,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests string[] ncLines = { "One", "Twoè", "Three" }; TaskInventoryItem ncItem - = TaskInventoryHelpers.AddNotecard(m_scene, m_so.RootPart, "nc", "1", "10", string.Join("\n", ncLines)); + = TaskInventoryHelpers.AddNotecard(m_scene.AssetService, m_so.RootPart, "nc", "1", "10", string.Join("\n", ncLines)); AssertValidNotecardLine(ncItem.Name, 0, ncLines[0]); AssertValidNotecardLine(ncItem.Name, 2, ncLines[2]); @@ -102,7 +102,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests { TestHelpers.InMethod(); - TaskInventoryItem ncItem = TaskInventoryHelpers.AddScript(m_scene, m_so.RootPart, "nc1", "Not important"); + TaskInventoryItem ncItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, m_so.RootPart, "nc1", "Not important"); AssertInValidNotecardLine(ncItem.Name, 0); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs index 6424ea1..40082b5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, userId); SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; - TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene, part); + TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, part); LSL_Api apiGrp1 = new LSL_Api(); apiGrp1.Initialize(m_engine, part, scriptItem, null); diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs index caba4a4..2fe558a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs @@ -96,7 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, 0x1); ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1.PrincipalID); SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID); - TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene, inWorldObj.RootPart); + TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart); new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null); OSSL_Api osslApi = new OSSL_Api(); @@ -105,7 +105,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, ua1.PrincipalID); // Create an object embedded inside the first - TaskInventoryHelpers.AddSceneObject(m_scene, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, ua1.PrincipalID); + TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, ua1.PrincipalID); osslApi.osForceAttachToAvatarFromInventory(taskInvObjItemName, (int)attachPoint); @@ -142,7 +142,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, 0x1); ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1.PrincipalID); SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID); - TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene, inWorldObj.RootPart); + TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart); new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null); OSSL_Api osslApi = new OSSL_Api(); @@ -150,7 +150,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // Create an object embedded inside the first TaskInventoryHelpers.AddNotecard( - m_scene, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, TestHelpers.ParseTail(0x900), "Hello World!"); + m_scene.AssetService, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, TestHelpers.ParseTail(0x900), "Hello World!"); bool exceptionCaught = false; @@ -190,7 +190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1); SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID); - TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene, inWorldObj.RootPart); + TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart); new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null); OSSL_Api osslApi = new OSSL_Api(); @@ -198,7 +198,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests // Create an object embedded inside the first TaskInventoryHelpers.AddSceneObject( - m_scene, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, ua1.PrincipalID); + m_scene.AssetService, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, ua1.PrincipalID); ScenePresence sp2 = SceneHelpers.AddScenePresence(m_scene, ua2); diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEnginePersistenceTests.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEnginePersistenceTests.cs index 5b7e5f7..2ef4058 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEnginePersistenceTests.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEnginePersistenceTests.cs @@ -114,7 +114,7 @@ namespace OpenSim.Region.ScriptEngine.Tests SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10); TaskInventoryHelpers.AddScript( - scene, + scene.AssetService, so.RootPart, "scriptItem", "default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }"); diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs index b4bd50b..a15127e 100644 --- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs @@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common /// /// Add a notecard item to the given part. /// - /// + /// /// /// /// UUID or UUID stem @@ -51,16 +51,16 @@ namespace OpenSim.Tests.Common /// The tex to put in the notecard. /// The item that was added public static TaskInventoryItem AddNotecard( - Scene scene, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text) + IAssetService assetService, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text) { return AddNotecard( - scene, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text); + assetService, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text); } /// /// Add a notecard item to the given part. /// - /// + /// /// /// /// @@ -68,7 +68,7 @@ namespace OpenSim.Tests.Common /// The tex to put in the notecard. /// The item that was added public static TaskInventoryItem AddNotecard( - Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text) + IAssetService assetService, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text) { AssetNotecard nc = new AssetNotecard(); nc.BodyText = text; @@ -76,7 +76,7 @@ namespace OpenSim.Tests.Common AssetBase ncAsset = AssetHelpers.CreateAsset(assetID, AssetType.Notecard, nc.AssetData, UUID.Zero); - scene.AssetService.Store(ncAsset); + assetService.Store(ncAsset); TaskInventoryItem ncItem = new TaskInventoryItem @@ -94,12 +94,12 @@ namespace OpenSim.Tests.Common /// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these /// functions more than once in a test. /// - /// + /// /// /// The item that was added - public static TaskInventoryItem AddScript(Scene scene, SceneObjectPart part) + public static TaskInventoryItem AddScript(IAssetService assetService, SceneObjectPart part) { - return AddScript(scene, part, "scriptItem", "default { state_entry() { llSay(0, \"Hello World\"); } }"); + return AddScript(assetService, part, "scriptItem", "default { state_entry() { llSay(0, \"Hello World\"); } }"); } /// @@ -109,15 +109,15 @@ namespace OpenSim.Tests.Common /// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather /// than a random component. /// - /// + /// /// /// Name of the script to add /// LSL script source /// The item that was added public static TaskInventoryItem AddScript( - Scene scene, SceneObjectPart part, string scriptName, string scriptSource) + IAssetService assetService, SceneObjectPart part, string scriptName, string scriptSource) { - return AddScript(scene, part, UUID.Random(), UUID.Random(), scriptName, scriptSource); + return AddScript(assetService, part, UUID.Random(), UUID.Random(), scriptName, scriptSource); } /// @@ -127,7 +127,7 @@ namespace OpenSim.Tests.Common /// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather /// than a random component. /// - /// + /// /// /// Item UUID for the script /// Asset UUID for the script @@ -135,7 +135,7 @@ namespace OpenSim.Tests.Common /// LSL script source /// The item that was added public static TaskInventoryItem AddScript( - Scene scene, SceneObjectPart part, UUID itemId, UUID assetId, string scriptName, string scriptSource) + IAssetService assetService, SceneObjectPart part, UUID itemId, UUID assetId, string scriptName, string scriptSource) { AssetScriptText ast = new AssetScriptText(); ast.Source = scriptSource; @@ -143,7 +143,7 @@ namespace OpenSim.Tests.Common AssetBase asset = AssetHelpers.CreateAsset(assetId, AssetType.LSLText, ast.AssetData, UUID.Zero); - scene.AssetService.Store(asset); + assetService.Store(asset); TaskInventoryItem item = new TaskInventoryItem { Name = scriptName, AssetID = assetId, ItemID = itemId, @@ -162,17 +162,17 @@ namespace OpenSim.Tests.Common /// functions more than once in a test. /// /// - /// + /// /// /// /// /// public static TaskInventoryItem AddSceneObject( - Scene scene, SceneObjectPart sop, string itemName, UUID id, UUID userId) + IAssetService assetService, SceneObjectPart sop, string itemName, UUID id, UUID userId) { SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero); AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject); - scene.AssetService.Store(taskSceneObjectAsset); + assetService.Store(taskSceneObjectAsset); TaskInventoryItem taskSceneObjectItem = new TaskInventoryItem { Name = itemName, -- cgit v1.1 From a03d893f2c431c220f44a6f7c1b94de7568bd6f8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Feb 2015 21:12:46 +0000 Subject: Fix bug where the uuid gatherer was not inspecting UUIDs for items in an embedded object's inventory. Added regression test for this case. Likely a regression since 08606ae4 (Thu Jan 8 2015) Relates to Mantises 7439, 7450 and possibly others. --- .../Framework/Scenes/Tests/UuidGathererTests.cs | 43 ++++++++++----------- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 16 ++++++-- .../Tests/Common/Helpers/TaskInventoryHelpers.cs | 45 ++++++++++++++++------ 3 files changed, 65 insertions(+), 39 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 0b41039..937c414 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -122,40 +122,37 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] - public void TestTaskItem() + public void TestTaskItems() { TestHelpers.InMethod(); - TestHelpers.EnableLogging(); +// TestHelpers.EnableLogging(); UUID ownerId = TestHelpers.ParseTail(0x10); - UUID embeddedId = TestHelpers.ParseTail(0x20); - UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); - UUID missingEmbeddedId = TestHelpers.ParseTail(0x22); - UUID ncAssetId = TestHelpers.ParseTail(0x30); - AssetBase ncAsset - = AssetHelpers.CreateNotecardAsset( - ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId)); - m_assetService.Store(ncAsset); + SceneObjectGroup soL0 = SceneHelpers.CreateSceneObject(1, ownerId, "l0", 0x20); + SceneObjectGroup soL1 = SceneHelpers.CreateSceneObject(1, ownerId, "l1", 0x21); + SceneObjectGroup soL2 = SceneHelpers.CreateSceneObject(1, ownerId, "l2", 0x22); - AssetBase embeddedAsset - = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId)); - m_assetService.Store(embeddedAsset); + TaskInventoryHelpers.AddScript( + m_assetService, soL2.RootPart, TestHelpers.ParseTail(0x33), TestHelpers.ParseTail(0x43), "l3-script", "gibberish"); - AssetBase secondLevelEmbeddedAsset - = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when."); - m_assetService.Store(secondLevelEmbeddedAsset); + TaskInventoryHelpers.AddSceneObject( + m_assetService, soL1.RootPart, "l2-item", TestHelpers.ParseTail(0x32), soL2, TestHelpers.ParseTail(0x42)); + TaskInventoryHelpers.AddSceneObject( + m_assetService, soL0.RootPart, "l1-item", TestHelpers.ParseTail(0x31), soL1, TestHelpers.ParseTail(0x41)); - m_uuidGatherer.AddForInspection(ncAssetId); + m_uuidGatherer.AddForInspection(soL0); m_uuidGatherer.GatherAll(); - // foreach (UUID key in m_uuidGatherer.GatheredUuids.Keys) - // System.Console.WriteLine("key : {0}", key); +// foreach (UUID key in m_uuidGatherer.GatheredUuids.Keys) +// System.Console.WriteLine("key : {0}", key); - Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(3)); - Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(ncAssetId)); - Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId)); - Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId)); + // We expect to see the default prim texture and the assets of the contained task items + Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(4)); + Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(new UUID(Constants.DefaultTexture))); + Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(TestHelpers.ParseTail(0x41))); + Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(TestHelpers.ParseTail(0x42))); + Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(TestHelpers.ParseTail(0x43))); } } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 69dc133..9ec4e1d 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -123,6 +123,8 @@ namespace OpenSim.Region.Framework.Scenes if (m_assetUuidsToInspect.Contains(uuid)) return false; +// m_log.DebugFormat("[UUID GATHERER]: Adding asset {0} for inspection", uuid); + m_assetUuidsToInspect.Enqueue(uuid); return true; @@ -238,7 +240,11 @@ namespace OpenSim.Region.Framework.Scenes if (Complete) return false; - GetAssetUuids(m_assetUuidsToInspect.Dequeue()); + UUID nextToInspect = m_assetUuidsToInspect.Dequeue(); + +// m_log.DebugFormat("[UUID GATHERER]: Inspecting asset {0}", nextToInspect); + + GetAssetUuids(nextToInspect); return true; } @@ -322,8 +328,6 @@ namespace OpenSim.Region.Framework.Scenes // Here, we want to collect uuids which require further asset fetches but mark the others as gathered try { - GatheredUuids[assetUuid] = assetType; - if ((sbyte)AssetType.Bodypart == assetType || (sbyte)AssetType.Clothing == assetType || (sbyte)AssetType.Gesture == assetType @@ -334,11 +338,15 @@ namespace OpenSim.Region.Framework.Scenes { AddForInspection(assetUuid); } + else + { + GatheredUuids[assetUuid] = assetType; + } } catch (Exception) { m_log.ErrorFormat( - "[ITERATABLE UUID GATHERER]: Failed to gather uuids for asset id {0}, type {1}", + "[UUID GATHERER]: Failed to gather uuids for asset id {0}, type {1}", assetUuid, assetType); throw; } diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs index a15127e..3a3b33a 100644 --- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs @@ -153,7 +153,6 @@ namespace OpenSim.Tests.Common return item; } - /// /// Add a scene object item to the given part. /// @@ -165,25 +164,47 @@ namespace OpenSim.Tests.Common /// /// /// - /// - /// + /// + /// + /// public static TaskInventoryItem AddSceneObject( - IAssetService assetService, SceneObjectPart sop, string itemName, UUID id, UUID userId) + IAssetService assetService, SceneObjectPart sop, string itemName, UUID itemId, SceneObjectGroup soToAdd, UUID soAssetId) { - SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero); - AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject); + AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(soAssetId, soToAdd); assetService.Store(taskSceneObjectAsset); TaskInventoryItem taskSceneObjectItem = new TaskInventoryItem - { Name = itemName, - AssetID = taskSceneObjectAsset.FullID, - ItemID = id, - OwnerID = userId, - Type = (int)AssetType.Object, - InvType = (int)InventoryType.Object }; + { Name = itemName, + AssetID = taskSceneObjectAsset.FullID, + ItemID = itemId, + OwnerID = soToAdd.OwnerID, + Type = (int)AssetType.Object, + InvType = (int)InventoryType.Object }; sop.Inventory.AddInventoryItem(taskSceneObjectItem, true); return taskSceneObjectItem; } + + /// + /// Add a scene object item to the given part. + /// + /// + /// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these + /// functions more than once in a test. + /// + /// + /// + /// + /// + /// + /// + public static TaskInventoryItem AddSceneObject( + IAssetService assetService, SceneObjectPart sop, string itemName, UUID itemId, UUID userId) + { + SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, userId); + + return TaskInventoryHelpers.AddSceneObject( + assetService, sop, itemName, itemId, taskSceneObject, TestHelpers.ParseTail(0x10)); + } } } \ No newline at end of file -- cgit v1.1 From 5fa651c529b0c4fac3467c0fd93234eb37359de7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Feb 2015 21:42:07 +0000 Subject: minor: In HGAssetMapper, don't complain on seeing an XmlDeclaration as we know that we not using those in transformation. Relates to http://opensimulator.org/mantis/view.php?id=7447 --- .../Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 9c801be..8b09b3e 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -318,6 +318,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess writer.WriteString(reader.Value); break; + case XmlNodeType.XmlDeclaration: + // For various reasons, not all serializations have xml declarations (or consistent ones) + // and as it's embedded inside a byte stream we don't need it anyway, so ignore. + break; + default: m_log.WarnFormat( "[HG ASSET MAPPER]: Unrecognized node {0} in asset XML transform in {1}", -- cgit v1.1 From 412dd7dfc56a10f590a42d0e6d014da9f4551bbf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 26 Feb 2015 00:48:51 +0000 Subject: When an avatar is walking across a region border, force the first AgentUpdate received on the new root agent to update movement parameters. This prevents the avatar from drifting in its last direction of travel if a movement key was released at certain moments in the cross. Relates to http://opensimulator.org/mantis/view.php?id=7435 --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 0414f89..973f2cf 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -379,6 +379,11 @@ namespace OpenSim.Region.Framework.Scenes public uint MovementFlag { get; private set; } /// + /// Set this if we need to force a movement update on the next received AgentUpdate from the viewer. + /// + private const uint ForceUpdateMovementFlagValue = uint.MaxValue; + + /// /// Is the agent stop control flag currently active? /// public bool AgentControlStopActive { get; private set; } @@ -1267,7 +1272,7 @@ namespace OpenSim.Region.Framework.Scenes // If we don't reset the movement flag here, an avatar that crosses to a neighbouring sim and returns will // stall on the border crossing since the existing child agent will still have the last movement // recorded, which stops the input from being processed. - MovementFlag = 0; + MovementFlag = ForceUpdateMovementFlagValue; m_scene.EventManager.TriggerOnMakeRootAgent(this); @@ -1925,13 +1930,13 @@ namespace OpenSim.Region.Framework.Scenes /// public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) { - //m_log.DebugFormat( - // "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}", - // Scene.RegionInfo.RegionName, remoteClient.Name, (AgentManager.ControlFlags)agentData.ControlFlags); +// m_log.DebugFormat( +// "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}", +// Scene.Name, remoteClient.Name, (AgentManager.ControlFlags)agentData.ControlFlags); if (IsChildAgent) { - // // m_log.Debug("DEBUG: HandleAgentUpdate: child agent"); +// m_log.DebugFormat("DEBUG: HandleAgentUpdate: child agent in {0}", Scene.Name); return; } @@ -2066,6 +2071,14 @@ namespace OpenSim.Region.Framework.Scenes bool update_movementflag = false; + // If we were just made root agent then we must perform movement updates for the first AgentUpdate that + // we get + if (MovementFlag == ForceUpdateMovementFlagValue) + { + MovementFlag = 0; + update_movementflag = true; + } + if (agentData.UseClientAgentPosition) { MovingToTarget = (agentData.ClientAgentPosition - AbsolutePosition).Length() > 0.2f; -- cgit v1.1 From a3681f3052fb5e98e31e7051329a5b748a8bdd8d Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 27 Feb 2015 11:05:15 -0500 Subject: Adding dynamic ossl permission control Add permission by identifying uuid (owner/creator/group) and function. Revoke permission in the same manner. Permission adjustments immediately effect running scripts ability to call os functions. osGrantScriptPermissions(UUID key,string function) Threat Level Severe osRevokeScriptPermissions(UUID key,string function) Threat Level Severe work sponsored by: Rage --- OpenSim/Region/Framework/Scenes/Scene.cs | 61 ++++++++++++++++++++++ .../Shared/Api/Implementation/OSSL_Api.cs | 44 ++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 4 ++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 10 ++++ 4 files changed, 119 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 21d47aa..018e837 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -170,6 +170,9 @@ namespace OpenSim.Region.Framework.Scenes } private bool m_scripts_enabled; + // Dynamic ossl function permissions + private Dictionary> m_DynaPerms = new Dictionary>(); + public SynchronizeSceneHandler SynchronizeScene; /// @@ -5893,5 +5896,63 @@ namespace OpenSim.Region.Framework.Scenes m_eventManager.TriggerExtraSettingChanged(this, name, String.Empty); } + + public bool AddOsslPerm (UUID key, string function) + { + StackTrace calls = new StackTrace (); + string caller = calls.GetFrame (1).GetMethod ().Name; + if (caller != "osGrantScriptPermissions") + { + m_log.ErrorFormat("[SCENE]: {0} cannot adjust script perms!",caller); + return false; + } + + if (string.IsNullOrEmpty(function)) + return false; + + if (!m_DynaPerms.ContainsKey(function)) + { + List keys = new List (); + keys.Add (key); + m_DynaPerms[function] = keys; + return true; + } + + if (!m_DynaPerms[function].Contains(key)) + m_DynaPerms[function].Add(key); + + return true; + } + + public bool GetOsslPerms(UUID avatar, string function) + { + if (m_DynaPerms.ContainsKey(function)) + if(m_DynaPerms[function].Contains(avatar)) + return true; + + return false; + } + + public bool RemoveOsslPerm(UUID key, string function) + { + StackTrace calls = new StackTrace (); + string caller = calls.GetFrame (1).GetMethod ().Name; + if (caller != "osRevokeScriptPermissions") + { + m_log.ErrorFormat("[SCENE]: {0} cannot adjust script perms!",caller); + return false; + } + + if (m_DynaPerms.ContainsKey (function)) + { + if (m_DynaPerms [function].Contains (key)) + { + m_DynaPerms [function].Remove (key); + if (m_DynaPerms [function].Count == 0) + m_DynaPerms.Remove (function); + } + } + return true; + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 10ddf14..f4bc45f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -264,6 +264,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // or a string explaining why this function can't be used. private string CheckThreatLevelTest(ThreatLevel level, string function) { + if(GetDynaPerms(m_item.CreatorID, m_item.OwnerID, m_item.GroupID, function)) + return string.Empty; + if (!m_FunctionPerms.ContainsKey(function)) { FunctionPerms perms = new FunctionPerms(); @@ -431,6 +434,47 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api System.Threading.Thread.Sleep(delay); } + private bool GetDynaPerms(UUID owner, UUID creator, UUID group, string function) + { + if (World.GetOsslPerms(owner, function)) + return true; + if (World.GetOsslPerms(creator, function)) + return true; + if (World.GetOsslPerms(creator, function)) + return true; + + return false; + + } + + public void osGrantScriptPermissions(LSL_Key avatar, LSL_List osfunctions) + { + CheckThreatLevel(ThreatLevel.Severe, "osGrantScriptPermissions"); + m_host.AddScriptLPS(1); + UUID key; + UUID.TryParse(avatar.m_string, out key); + + for (int item = 0; item <= osfunctions.Length - 1; item++) + { + string function = osfunctions.GetLSLStringItem(item); + World.AddOsslPerm(key, function); + } + } + + public void osRevokeScriptPermissions (LSL_Key avatar, LSL_List osfunctions) + { + CheckThreatLevel(ThreatLevel.Severe, "osRevokeScriptPermissions"); + m_host.AddScriptLPS(1); + UUID key; + UUID.TryParse(avatar.m_string, out key); + + for (int item = 0; item <= osfunctions.Length - 1; item++) + { + string function = osfunctions.GetLSLStringItem(item); + World.RemoveOsslPerm(key, function); + } + } + public LSL_Integer osSetTerrainHeight(int x, int y, double val) { CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 38d4574..2cbaf5a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -116,6 +116,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces { void CheckThreatLevel(ThreatLevel level, string function); + // Scripted Script Permissions + void osGrantScriptPermissions(LSL_Key avatar, LSL_List functions); + void osRevokeScriptPermissions(LSL_Key avatar, LSL_List functions); + //OpenSim functions string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 352a35d..a98f6ac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -61,6 +61,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase Prim = new OSSLPrim(this); } + public void osGrantScriptPermissions (LSL_Key avatar, LSL_List osfunctions) + { + m_OSSL_Functions.osGrantScriptPermissions(avatar, osfunctions); + } + + public void osRevokeScriptPermissions (LSL_Key avatar, LSL_List osfunctions) + { + m_OSSL_Functions.osRevokeScriptPermissions(avatar, osfunctions); + } + public void osSetRegionWaterHeight(double height) { m_OSSL_Functions.osSetRegionWaterHeight(height); -- cgit v1.1 From aeb8a4bf85816595c9c2ba82413e309e7aa69062 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 27 Feb 2015 12:27:10 -0500 Subject: Revert "Adding dynamic ossl permission control" This reverts commit a3681f3052fb5e98e31e7051329a5b748a8bdd8d until further testing. Jenkins now fails ossl tests. --- OpenSim/Region/Framework/Scenes/Scene.cs | 61 ---------------------- .../Shared/Api/Implementation/OSSL_Api.cs | 44 ---------------- .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 4 -- .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 10 ---- 4 files changed, 119 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 018e837..21d47aa 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -170,9 +170,6 @@ namespace OpenSim.Region.Framework.Scenes } private bool m_scripts_enabled; - // Dynamic ossl function permissions - private Dictionary> m_DynaPerms = new Dictionary>(); - public SynchronizeSceneHandler SynchronizeScene; /// @@ -5896,63 +5893,5 @@ namespace OpenSim.Region.Framework.Scenes m_eventManager.TriggerExtraSettingChanged(this, name, String.Empty); } - - public bool AddOsslPerm (UUID key, string function) - { - StackTrace calls = new StackTrace (); - string caller = calls.GetFrame (1).GetMethod ().Name; - if (caller != "osGrantScriptPermissions") - { - m_log.ErrorFormat("[SCENE]: {0} cannot adjust script perms!",caller); - return false; - } - - if (string.IsNullOrEmpty(function)) - return false; - - if (!m_DynaPerms.ContainsKey(function)) - { - List keys = new List (); - keys.Add (key); - m_DynaPerms[function] = keys; - return true; - } - - if (!m_DynaPerms[function].Contains(key)) - m_DynaPerms[function].Add(key); - - return true; - } - - public bool GetOsslPerms(UUID avatar, string function) - { - if (m_DynaPerms.ContainsKey(function)) - if(m_DynaPerms[function].Contains(avatar)) - return true; - - return false; - } - - public bool RemoveOsslPerm(UUID key, string function) - { - StackTrace calls = new StackTrace (); - string caller = calls.GetFrame (1).GetMethod ().Name; - if (caller != "osRevokeScriptPermissions") - { - m_log.ErrorFormat("[SCENE]: {0} cannot adjust script perms!",caller); - return false; - } - - if (m_DynaPerms.ContainsKey (function)) - { - if (m_DynaPerms [function].Contains (key)) - { - m_DynaPerms [function].Remove (key); - if (m_DynaPerms [function].Count == 0) - m_DynaPerms.Remove (function); - } - } - return true; - } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f4bc45f..10ddf14 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -264,9 +264,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // or a string explaining why this function can't be used. private string CheckThreatLevelTest(ThreatLevel level, string function) { - if(GetDynaPerms(m_item.CreatorID, m_item.OwnerID, m_item.GroupID, function)) - return string.Empty; - if (!m_FunctionPerms.ContainsKey(function)) { FunctionPerms perms = new FunctionPerms(); @@ -434,47 +431,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api System.Threading.Thread.Sleep(delay); } - private bool GetDynaPerms(UUID owner, UUID creator, UUID group, string function) - { - if (World.GetOsslPerms(owner, function)) - return true; - if (World.GetOsslPerms(creator, function)) - return true; - if (World.GetOsslPerms(creator, function)) - return true; - - return false; - - } - - public void osGrantScriptPermissions(LSL_Key avatar, LSL_List osfunctions) - { - CheckThreatLevel(ThreatLevel.Severe, "osGrantScriptPermissions"); - m_host.AddScriptLPS(1); - UUID key; - UUID.TryParse(avatar.m_string, out key); - - for (int item = 0; item <= osfunctions.Length - 1; item++) - { - string function = osfunctions.GetLSLStringItem(item); - World.AddOsslPerm(key, function); - } - } - - public void osRevokeScriptPermissions (LSL_Key avatar, LSL_List osfunctions) - { - CheckThreatLevel(ThreatLevel.Severe, "osRevokeScriptPermissions"); - m_host.AddScriptLPS(1); - UUID key; - UUID.TryParse(avatar.m_string, out key); - - for (int item = 0; item <= osfunctions.Length - 1; item++) - { - string function = osfunctions.GetLSLStringItem(item); - World.RemoveOsslPerm(key, function); - } - } - public LSL_Integer osSetTerrainHeight(int x, int y, double val) { CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 2cbaf5a..38d4574 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -116,10 +116,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces { void CheckThreatLevel(ThreatLevel level, string function); - // Scripted Script Permissions - void osGrantScriptPermissions(LSL_Key avatar, LSL_List functions); - void osRevokeScriptPermissions(LSL_Key avatar, LSL_List functions); - //OpenSim functions string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index a98f6ac..352a35d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -61,16 +61,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase Prim = new OSSLPrim(this); } - public void osGrantScriptPermissions (LSL_Key avatar, LSL_List osfunctions) - { - m_OSSL_Functions.osGrantScriptPermissions(avatar, osfunctions); - } - - public void osRevokeScriptPermissions (LSL_Key avatar, LSL_List osfunctions) - { - m_OSSL_Functions.osRevokeScriptPermissions(avatar, osfunctions); - } - public void osSetRegionWaterHeight(double height) { m_OSSL_Functions.osSetRegionWaterHeight(height); -- cgit v1.1 From ca7cc9b2e29777cb3be4bb5cb147010819de3602 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Feb 2015 19:43:31 +0000 Subject: Don't slide crouching avatar when camera is panned around them with left mouse button This matches linden lab grid behaviour --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 973f2cf..a03593e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2128,7 +2128,9 @@ namespace OpenSim.Region.Framework.Scenes try { - agent_control_v3 += dirVectors[i]; + // Don't slide against ground when crouching if camera is panned around avatar + if (Flying || DCF != Dir_ControlFlags.DIR_CONTROL_FLAG_DOWN) + agent_control_v3 += dirVectors[i]; //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); } catch (IndexOutOfRangeException) -- cgit v1.1 From 30b786351ea46cf6640dc45fa84bb4a4da1ab6d8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Feb 2015 23:41:04 +0000 Subject: Don't slow down avatar walk speed if camera is changed (e.g. by holding down lmb on an avatar and moving the mouse). Does this by not applying unwanted direction components to the avatar self movement calculation (exception is flying in mouse look). Matches behaviuor on linden lab grid Addresses http://opensimulator.org/mantis/view.php?id=6835 --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 40 +++++++----------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a03593e..acd57a3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1010,23 +1010,6 @@ namespace OpenSim.Region.Framework.Scenes Dir_Vectors[10] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge } - private Vector3[] GetWalkDirectionVectors() - { - Vector3[] vector = new Vector3[11]; - vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD - vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK - vector[2] = Vector3.UnitY; //LEFT - vector[3] = -Vector3.UnitY; //RIGHT - vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP - vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN - vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE - vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE - vector[8] = Vector3.UnitY; //LEFT_NUDGE - vector[9] = -Vector3.UnitY; //RIGHT_NUDGE - vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE - return vector; - } - #endregion #region Status Methods @@ -2110,15 +2093,6 @@ namespace OpenSim.Region.Framework.Scenes { bool bAllowUpdateMoveToPosition = false; - Vector3[] dirVectors; - - // use camera up angle when in mouselook and not flying or when holding the left mouse button down and not flying - // this prevents 'jumping' in inappropriate situations. - if (!Flying && (m_mouseLook || m_leftButtonDown)) - dirVectors = GetWalkDirectionVectors(); - else - dirVectors = Dir_Vectors; - // A DIR_CONTROL_FLAG occurs when the user is trying to move in a particular direction. foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) { @@ -2130,7 +2104,7 @@ namespace OpenSim.Region.Framework.Scenes { // Don't slide against ground when crouching if camera is panned around avatar if (Flying || DCF != Dir_ControlFlags.DIR_CONTROL_FLAG_DOWN) - agent_control_v3 += dirVectors[i]; + agent_control_v3 += Dir_Vectors[i]; //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); } catch (IndexOutOfRangeException) @@ -3164,7 +3138,17 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE PRESENCE]: Adding new movement {0} with rotation {1}, thisAddSpeedModifier {2} for {3}", // vec, Rotation, thisAddSpeedModifier, Name); - Vector3 direc = vec * Rotation; + Quaternion rot = Rotation; + if (!(Flying && m_mouseLook)) + { + // The only situation in which we care about X and Y is in mouselook flying. The rest of the time + // these parameters are not relevant for determining avatar movement direction and cause issues such + // as wrong walk speed if the camera is rotated. + rot.X = 0; + rot.Y = 0; + } + + Vector3 direc = vec * rot; direc.Normalize(); if (Flying != FlyingOld) // add for fly velocity control -- cgit v1.1 From 59d6d03909b89dedb41e3dd23d1e67f198191947 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Feb 2015 23:48:05 +0000 Subject: Comment out now unused and not properly working private SP.m_leftButtonDown with a comment on how probably to implement it properly if it is needed in the future --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index acd57a3..35eaea0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -827,7 +827,7 @@ namespace OpenSim.Region.Framework.Scenes } private bool m_mouseLook; - private bool m_leftButtonDown; +// private bool m_leftButtonDown; private bool m_inTransit; @@ -1961,7 +1961,12 @@ namespace OpenSim.Region.Framework.Scenes // DrawDistance = Scene.DefaultDrawDistance; m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; - m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0; + + // FIXME: This does not work as intended because the viewer only sends the lbutton down when the button + // is first pressed, not whilst it is held down. If this is required in the future then need to look + // for an AGENT_CONTROL_LBUTTON_UP event and make sure to handle cases where an initial DOWN is not + // received (e.g. on holding LMB down on the avatar in a viewer). +// m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0; #endregion Inputs -- cgit v1.1 From fad4d4dc5525133032116eebc62dbe423fb22b57 Mon Sep 17 00:00:00 2001 From: Magnuz Binder Date: Wed, 28 Jan 2015 11:32:43 +0100 Subject: Permit loading of LLRAW files bigger than 256x256 by calculating size based on file size rather than assuming 256x256, same as for RAW32. --- OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs index 62d232e..ce93a180 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs @@ -147,7 +147,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders public ITerrainChannel LoadStream(Stream s) { - TerrainChannel retval = new TerrainChannel(); + // The raw format doesn't contain any dimension information. + // Guess the square dimensions by using the length of the raw file. + double dimension = Math.Sqrt((double)(s.Length / 13)); + // Regions are always multiples of 256. + int trimmedDimension = (int)dimension - ((int)dimension % (int)Constants.RegionSize); + if (trimmedDimension < Constants.RegionSize) + trimmedDimension = (int)Constants.RegionSize; + + TerrainChannel retval = new TerrainChannel(trimmedDimension, trimmedDimension); BinaryReader bs = new BinaryReader(s); int y; -- cgit v1.1 From 3c92a8e7655a9bb279231fd63b6f9c833fd4f5a7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 28 Feb 2015 00:34:07 +0000 Subject: Add OpenSim.Framework using statement necessary to get previous fad4d4dc to compile. --- OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs index ce93a180..959ac5a 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs @@ -27,6 +27,7 @@ using System; using System.IO; +using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -- cgit v1.1 From 06a52b43df07b3dccc4a35d167d698a071c2d686 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 28 Feb 2015 00:36:29 +0000 Subject: Add Magnuz Binder to CONTRIBUTORS --- CONTRIBUTORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index e3f9d89..ce54cf8 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -128,6 +128,7 @@ what it is today. * LuciusSirnah * lulurun * M.Igarashi +* Magnuz Binder * maimedleech * Mana Janus * MarcelEdward -- cgit v1.1 From 4717132b827aeed7a6e423749c5a7157aa3cc268 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 28 Feb 2015 00:41:11 +0000 Subject: Use using constructs on disposable io objects in LLRaw to ensure they are always closed even if an exception is thrown. --- .../CoreModules/World/Terrain/FileLoaders/LLRAW.cs | 224 ++++++++++----------- 1 file changed, 111 insertions(+), 113 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs index 959ac5a..be1fb24 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs @@ -74,12 +74,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders public ITerrainChannel LoadFile(string filename) { FileInfo file = new FileInfo(filename); - FileStream s = file.Open(FileMode.Open, FileAccess.Read); - ITerrainChannel retval = LoadStream(s); - s.Close(); + ITerrainChannel channel; - return retval; + using (FileStream s = file.Open(FileMode.Open, FileAccess.Read)) + channel = LoadStream(s); + + return channel; } public ITerrainChannel LoadFile(string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int sectionWidth, int sectionHeight) @@ -87,62 +88,62 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders TerrainChannel retval = new TerrainChannel(sectionWidth, sectionHeight); FileInfo file = new FileInfo(filename); - FileStream s = file.Open(FileMode.Open, FileAccess.Read); - BinaryReader bs = new BinaryReader(s); - int currFileYOffset = fileHeight - 1; - - // if our region isn't on the first Y section of the areas to be landscaped, then - // advance to our section of the file - while (currFileYOffset > offsetY) + using (FileStream s = file.Open(FileMode.Open, FileAccess.Read)) + using (BinaryReader bs = new BinaryReader(s)) { - // read a whole strip of regions - int heightsToRead = sectionHeight * (fileWidth * sectionWidth); - bs.ReadBytes(heightsToRead * 13); // because there are 13 fun channels - currFileYOffset--; - } + int currFileYOffset = fileHeight - 1; - // got to the Y start offset within the file of our region - // so read the file bits associated with our region - int y; - // for each Y within our Y offset - for (y = sectionHeight - 1; y >= 0; y--) - { - int currFileXOffset = 0; - - // if our region isn't the first X section of the areas to be landscaped, then - // advance the stream to the X start pos of our section in the file - // i.e. eat X upto where we start - while (currFileXOffset < offsetX) + // if our region isn't on the first Y section of the areas to be landscaped, then + // advance to our section of the file + while (currFileYOffset > offsetY) { - bs.ReadBytes(sectionWidth * 13); - currFileXOffset++; + // read a whole strip of regions + int heightsToRead = sectionHeight * (fileWidth * sectionWidth); + bs.ReadBytes(heightsToRead * 13); // because there are 13 fun channels + currFileYOffset--; } - // got to our X offset, so write our regions X line - int x; - for (x = 0; x < sectionWidth; x++) - { - // Read a strip and continue - retval[x, y] = bs.ReadByte() * (bs.ReadByte() / 128.0); - bs.ReadBytes(11); - } - // record that we wrote it - currFileXOffset++; + // got to the Y start offset within the file of our region + // so read the file bits associated with our region + int y; - // if our region isn't the last X section of the areas to be landscaped, then - // advance the stream to the end of this Y column - while (currFileXOffset < fileWidth) + // for each Y within our Y offset + for (y = sectionHeight - 1; y >= 0; y--) { - // eat the next regions x line - bs.ReadBytes(sectionWidth * 13); //The 13 channels again + int currFileXOffset = 0; + + // if our region isn't the first X section of the areas to be landscaped, then + // advance the stream to the X start pos of our section in the file + // i.e. eat X upto where we start + while (currFileXOffset < offsetX) + { + bs.ReadBytes(sectionWidth * 13); + currFileXOffset++; + } + + // got to our X offset, so write our regions X line + int x; + for (x = 0; x < sectionWidth; x++) + { + // Read a strip and continue + retval[x, y] = bs.ReadByte() * (bs.ReadByte() / 128.0); + bs.ReadBytes(11); + } + // record that we wrote it currFileXOffset++; + + // if our region isn't the last X section of the areas to be landscaped, then + // advance the stream to the end of this Y column + while (currFileXOffset < fileWidth) + { + // eat the next regions x line + bs.ReadBytes(sectionWidth * 13); //The 13 channels again + currFileXOffset++; + } } } - bs.Close(); - s.Close(); - return retval; } @@ -158,90 +159,88 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders TerrainChannel retval = new TerrainChannel(trimmedDimension, trimmedDimension); - BinaryReader bs = new BinaryReader(s); - int y; - for (y = 0; y < retval.Height; y++) + using (BinaryReader bs = new BinaryReader(s)) { - int x; - for (x = 0; x < retval.Width; x++) + int y; + for (y = 0; y < retval.Height; y++) { - retval[x, (retval.Height - 1) - y] = bs.ReadByte() * (bs.ReadByte() / 128.0); - bs.ReadBytes(11); // Advance the stream to next bytes. + int x; + for (x = 0; x < retval.Width; x++) + { + retval[x, (retval.Height - 1) - y] = bs.ReadByte() * (bs.ReadByte() / 128.0); + bs.ReadBytes(11); // Advance the stream to next bytes. + } } } - bs.Close(); - return retval; } public void SaveFile(string filename, ITerrainChannel map) { FileInfo file = new FileInfo(filename); - FileStream s = file.Open(FileMode.CreateNew, FileAccess.Write); - SaveStream(s, map); - s.Close(); + using (FileStream s = file.Open(FileMode.CreateNew, FileAccess.Write)) + SaveStream(s, map); } public void SaveStream(Stream s, ITerrainChannel map) { - BinaryWriter binStream = new BinaryWriter(s); - - // Output the calculated raw - for (int y = 0; y < map.Height; y++) + using (BinaryWriter binStream = new BinaryWriter(s)) { - for (int x = 0; x < map.Width; x++) + // Output the calculated raw + for (int y = 0; y < map.Height; y++) { - double t = map[x, (map.Height - 1) - y]; - //if height is less than 0, set it to 0 as - //can't save -ve values in a LLRAW file - if (t < 0d) + for (int x = 0; x < map.Width; x++) { - t = 0d; + double t = map[x, (map.Height - 1) - y]; + //if height is less than 0, set it to 0 as + //can't save -ve values in a LLRAW file + if (t < 0d) + { + t = 0d; + } + + int index = 0; + + // The lookup table is pre-sorted, so we either find an exact match or + // the next closest (smaller) match with a binary search + index = Array.BinarySearch(LookupHeightTable, new HeightmapLookupValue(0, (float)t)); + if (index < 0) + index = ~index - 1; + + index = LookupHeightTable[index].Index; + + byte red = (byte) (index & 0xFF); + byte green = (byte) ((index >> 8) & 0xFF); + const byte blue = 20; + const byte alpha1 = 0; + const byte alpha2 = 0; + const byte alpha3 = 0; + const byte alpha4 = 0; + const byte alpha5 = 255; + const byte alpha6 = 255; + const byte alpha7 = 255; + const byte alpha8 = 255; + byte alpha9 = red; + byte alpha10 = green; + + binStream.Write(red); + binStream.Write(green); + binStream.Write(blue); + binStream.Write(alpha1); + binStream.Write(alpha2); + binStream.Write(alpha3); + binStream.Write(alpha4); + binStream.Write(alpha5); + binStream.Write(alpha6); + binStream.Write(alpha7); + binStream.Write(alpha8); + binStream.Write(alpha9); + binStream.Write(alpha10); } - - int index = 0; - - // The lookup table is pre-sorted, so we either find an exact match or - // the next closest (smaller) match with a binary search - index = Array.BinarySearch(LookupHeightTable, new HeightmapLookupValue(0, (float)t)); - if (index < 0) - index = ~index - 1; - - index = LookupHeightTable[index].Index; - - byte red = (byte) (index & 0xFF); - byte green = (byte) ((index >> 8) & 0xFF); - const byte blue = 20; - const byte alpha1 = 0; - const byte alpha2 = 0; - const byte alpha3 = 0; - const byte alpha4 = 0; - const byte alpha5 = 255; - const byte alpha6 = 255; - const byte alpha7 = 255; - const byte alpha8 = 255; - byte alpha9 = red; - byte alpha10 = green; - - binStream.Write(red); - binStream.Write(green); - binStream.Write(blue); - binStream.Write(alpha1); - binStream.Write(alpha2); - binStream.Write(alpha3); - binStream.Write(alpha4); - binStream.Write(alpha5); - binStream.Write(alpha6); - binStream.Write(alpha7); - binStream.Write(alpha8); - binStream.Write(alpha9); - binStream.Write(alpha10); } } - - binStream.Close(); } public string FileExtension @@ -268,7 +267,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders public bool SupportsTileSave() { return false; - } - + } } -} +} \ No newline at end of file -- cgit v1.1 From 158c3f82f14e4d2bb2df0c57c8c3e34cef4d76e9 Mon Sep 17 00:00:00 2001 From: Magnuz Binder Date: Tue, 10 Feb 2015 23:01:31 +0100 Subject: Correct PRIM_TEXT return value from trans to alpha. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ebdd9da..23b74ce 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9009,7 +9009,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api res.Add(new LSL_Vector(textColor.R, textColor.G, textColor.B)); - res.Add(new LSL_Float(textColor.A)); + res.Add(new LSL_Float(1.0 - textColor.A)); break; case (int)ScriptBaseClass.PRIM_NAME: res.Add(new LSL_String(part.Name)); -- cgit v1.1 From 6da356a7e4cfa546ae2915d4c803682091672d0b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 28 Feb 2015 00:54:23 +0000 Subject: minor: Remove mono compiler warnings from EstateDataConnector --- OpenSim/Services/Connectors/Estate/EstateDataConnector.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs index 9d01b47..37f9374 100644 --- a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs +++ b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs @@ -248,7 +248,6 @@ namespace OpenSim.Service.Connectors public void StoreEstateSettings(EstateSettings es) { - string reply = string.Empty; // /estates/estate/ string uri = m_ServerURI + ("/estates/estate"); @@ -260,7 +259,6 @@ namespace OpenSim.Service.Connectors public bool LinkRegion(UUID regionID, int estateID) { - string reply = string.Empty; // /estates/estate/?eid=int®ion=uuid string uri = m_ServerURI + String.Format("/estates/estate/?eid={0}®ion={1}", estateID, regionID); -- cgit v1.1 From cfa4e6642eabe8b277052c8295127d1bf4e97c7f Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 1 Mar 2015 20:48:51 -0500 Subject: Handle kick user from estate management tools --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index ee0f790..311dd31 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -9904,6 +9904,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; + case "kickestate": + + if(((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) + { + UUID invoice = messagePacket.MethodData.Invoice; + UUID SenderID = messagePacket.AgentData.AgentID; + UUID Prey; + + UUID.TryParse(Utils.BytesToString(messagePacket.ParamList[0].Parameter), out Prey); + + OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey); + } + return true; + default: m_log.WarnFormat( "[LLCLIENTVIEW]: EstateOwnerMessage: Unknown method {0} requested for {1} in {2}", -- cgit v1.1 From 2482d567cf6bb9242ee8f3fe89a0b59ee6808a35 Mon Sep 17 00:00:00 2001 From: Freaky Tech Date: Mon, 2 Mar 2015 20:44:56 +0100 Subject: added missing senderId in GiveInventoryFolder this little mistake prevented passing on folders for HG visitors Signed-off-by: BlueWall --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 55db968..4961309 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -807,7 +807,7 @@ namespace OpenSim.Region.Framework.Scenes UUID recipientId, UUID senderId, UUID folderId, UUID recipientParentFolderId) { //// Retrieve the folder from the sender - InventoryFolderBase folder = InventoryService.GetFolder(new InventoryFolderBase(folderId)); + InventoryFolderBase folder = InventoryService.GetFolder(new InventoryFolderBase(folderId, senderId)); if (null == folder) { m_log.ErrorFormat( -- cgit v1.1 From 1a56f42d0a09e150908741ecd391e5d74481c7f4 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 2 Mar 2015 17:16:58 -0500 Subject: Add FreakyTech to CONTRIBUTORS.txt --- CONTRIBUTORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index ce54cf8..1933756 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -92,6 +92,7 @@ what it is today. * dslake * eeyore * FredoChaplin +* FreakyTech * Garmin Kawaguichi * Gerhard * Godfrey -- cgit v1.1 From 7e8bad05ec6150e082fb634e3210b83c33dbcfe7 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 2 Mar 2015 20:09:22 -0500 Subject: Fix erratic Npc movement --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 35eaea0..b0aa434 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3144,7 +3144,7 @@ namespace OpenSim.Region.Framework.Scenes // vec, Rotation, thisAddSpeedModifier, Name); Quaternion rot = Rotation; - if (!(Flying && m_mouseLook)) + if (!(Flying && m_mouseLook) && (PresenceType != PresenceType.Npc)) { // The only situation in which we care about X and Y is in mouselook flying. The rest of the time // these parameters are not relevant for determining avatar movement direction and cause issues such -- cgit v1.1