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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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 +++++++++++++++++++++ 5 files changed, 369 insertions(+), 15 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs (limited to 'OpenSim/Region') 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 -- 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(-) (limited to 'OpenSim/Region') 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(+) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(+) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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/Region/Framework/Scenes/SceneObjectPart.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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 + /// 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(+) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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(+) (limited to 'OpenSim/Region') 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 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(-) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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 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(+) (limited to 'OpenSim/Region') 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(-) (limited to 'OpenSim/Region') 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 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(-) (limited to 'OpenSim/Region') 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