From 1f336579c87b6b9e3152175c8b6724bff2777b65 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 23 Nov 2012 04:06:48 +0000 Subject: minor: Make note in log if scene was restarted due to an unrecoverable physics error --- OpenSim/Region/Framework/Scenes/Scene.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 8ef22bd..1ad5edd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -740,7 +740,12 @@ namespace OpenSim.Region.Framework.Scenes // // Out of memory // Operating system has killed the plugin - m_sceneGraph.UnRecoverableError += RestartNow; + m_sceneGraph.UnRecoverableError + += () => + { + m_log.ErrorFormat("[SCENE]: Restarting region {0} due to unrecoverable physics crash", Name); + RestartNow(); + }; RegisterDefaultSceneEvents(); -- cgit v1.1 From 22d4c52ffc374e167cb674e0e20815615d8a6927 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 24 Nov 2012 03:15:24 +0000 Subject: Consistenly make NUnit test cases inherit from OpenSimTestCase which automatically turns off any logging enabled between tests --- OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs b/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs index 4a21dc9..e209221 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs @@ -37,7 +37,7 @@ using OpenSim.Tests.Common; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] - public class BorderTests + public class BorderTests : OpenSimTestCase { [Test] public void TestCross() diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs index ea9fc93..766ce83 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs @@ -41,7 +41,7 @@ using OpenSim.Tests.Common; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture, LongRunning] - public class EntityManagerTests + public class EntityManagerTests : OpenSimTestCase { static public Random random; SceneObjectGroup found; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index d23c965..575a081 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -40,7 +40,7 @@ using OpenSim.Tests.Common.Mock; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] - public class SceneGraphTests + public class SceneGraphTests : OpenSimTestCase { [Test] public void TestDuplicateObject() diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs index ab56f4e..2d831fa 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs @@ -41,7 +41,7 @@ using OpenSim.Tests.Common.Mock; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] - public class SceneManagerTests + public class SceneManagerTests : OpenSimTestCase { [Test] public void TestClose() diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index 0076f41..4f15791 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// TODO: These tests are very incomplete - they only test for a few conditions. /// [TestFixture] - public class SceneObjectDeRezTests + public class SceneObjectDeRezTests : OpenSimTestCase { /// /// Test deleting an object from a scene. diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 0e525c9..9378e20 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -40,7 +40,7 @@ using log4net; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] - public class SceneObjectLinkingTests + public class SceneObjectLinkingTests : OpenSimTestCase { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs index 89647d6..c264433 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Basic scene object resize tests /// [TestFixture] - public class SceneObjectResizeTests + public class SceneObjectResizeTests : OpenSimTestCase { /// /// Test resizing an object diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs index d2361f8..a58e735 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs @@ -40,7 +40,7 @@ using OpenSim.Tests.Common.Mock; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] - public class SceneObjectScriptTests + public class SceneObjectScriptTests : OpenSimTestCase { [Test] public void TestAddScript() diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 6d255aa..5cf62c2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Spatial scene object tests (will eventually cover root and child part position, rotation properties, etc.) /// [TestFixture] - public class SceneObjectSpatialTests + public class SceneObjectSpatialTests : OpenSimTestCase { TestScene m_scene; UUID m_ownerId = TestHelpers.ParseTail(0x1); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index 742c769..093cbd2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Basic scene object status tests /// [TestFixture] - public class SceneObjectStatusTests + public class SceneObjectStatusTests : OpenSimTestCase { private TestScene m_scene; private UUID m_ownerId = TestHelpers.ParseTail(0x1); diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs index 646e5fa..1cd8ae9 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Scene presence animation tests /// [TestFixture] - public class ScenePresenceAnimationTests + public class ScenePresenceAnimationTests : OpenSimTestCase { [Test] public void TestFlyingAnimation() diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs index 1d1ff88..d80afd3 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs @@ -42,7 +42,7 @@ using OpenSim.Tests.Common.Mock; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] - public class ScenePresenceAutopilotTests + public class ScenePresenceAutopilotTests : OpenSimTestCase { private TestScene m_scene; diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs index 493ab70..acaeb90 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs @@ -43,7 +43,7 @@ using System.Threading; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] - public class ScenePresenceSitTests + public class ScenePresenceSitTests : OpenSimTestCase { private TestScene m_scene; private ScenePresence m_sp; diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index 37b5184..8dd1f3d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Teleport tests in a standalone OpenSim /// [TestFixture] - public class ScenePresenceTeleportTests + public class ScenePresenceTeleportTests : OpenSimTestCase { [TestFixtureSetUp] public void FixtureInit() diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index ac3da1e..9d8eb0b 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Scene presence tests /// [TestFixture] - public class SceneTests + public class SceneTests : OpenSimTestCase { /// /// Very basic scene update test. Should become more elaborate with time. diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index a51e4e3..0b461f5 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -50,7 +50,7 @@ using OpenSim.Tests.Common.Mock; namespace OpenSim.Region.Framework.Tests { [TestFixture] - public class TaskInventoryTests + public class TaskInventoryTests : OpenSimTestCase { [Test] public void TestAddTaskInventoryItem() diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 198e487..dd27294 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -38,7 +38,7 @@ using OpenSim.Tests.Common.Mock; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] - public class UuidGathererTests + public class UuidGathererTests : OpenSimTestCase { protected IAssetService m_assetService; protected UuidGatherer m_uuidGatherer; -- cgit v1.1 From a4ce63d0cd5dacdd33c6563bbc1af29ef5d36755 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 24 Nov 2012 03:38:15 +0000 Subject: Fix regression TestDeleteSceneObjectAsyncToUserInventory by adding a BasicInventoryAccessModule() and re-enable in test suite. --- .../Framework/Scenes/Tests/SceneObjectBasicTests.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 5b334c6..373094b 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -29,10 +29,12 @@ using System; using System.Collections.Generic; using System.Reflection; using System.Threading; +using Nini.Config; using NUnit.Framework; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.Framework.InventoryAccess; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using OpenSim.Tests.Common; @@ -239,28 +241,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// /// Test deleting an object asynchronously to user inventory. /// -// [Test] + [Test] public void TestDeleteSceneObjectAsyncToUserInventory() { TestHelpers.InMethod(); - TestHelpers.EnableLogging(); +// TestHelpers.EnableLogging(); UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); string myObjectName = "Fred"; TestScene scene = new SceneHelpers().SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Modules"); + config.Set("InventoryAccessModule", "BasicInventoryAccessModule"); + SceneHelpers.SetupSceneModules( + scene, configSource, new object[] { new BasicInventoryAccessModule() }); + + SceneHelpers.SetupSceneModules(scene, new object[] { }); + // 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, myObjectName, agentId); -// Assert.That( -// scene.CommsManager.UserAdminService.AddUser( -// "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId), -// Is.EqualTo(agentId)); - UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, agentId); InventoryFolderBase folder1 = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, ua.PrincipalID, "folder1"); -- cgit v1.1 From 02db8b9adbfd69d117bc54288473f5240de46918 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 24 Nov 2012 03:49:23 +0000 Subject: Combine TestDeleteSceneObjectAsync() with TestDeRezSceneObject() as they are functionally identical. Move TestDeleteSceneObjectAsync() and TestDeleteSceneObjectAsyncToUserInventory() from SceneObjectBasicTests -> SceneObjectDeRezTests --- .../Scenes/Tests/SceneObjectBasicTests.cs | 104 +-------------------- .../Scenes/Tests/SceneObjectDeRezTests.cs | 81 ++++++++++++++-- .../Scenes/Tests/SceneObjectSpatialTests.cs | 4 +- 3 files changed, 83 insertions(+), 106 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 373094b..a07d64c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -34,7 +34,6 @@ using NUnit.Framework; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; -using OpenSim.Region.CoreModules.Framework.InventoryAccess; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using OpenSim.Tests.Common; @@ -184,6 +183,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// /// Test deleting an object from a scene. /// + /// + /// This is the most basic form of delete. For all more sophisticated forms of derez (done asynchrnously + /// and where object can be taken to user inventory, etc.), see SceneObjectDeRezTests. + /// [Test] public void TestDeleteSceneObject() { @@ -203,103 +206,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests } /// - /// Test deleting an object asynchronously - /// - [Test] - public void TestDeleteSceneObjectAsync() - { - TestHelpers.InMethod(); - //log4net.Config.XmlConfigurator.Configure(); - - UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); - - TestScene scene = new SceneHelpers().SetupScene(); - - // 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); - - IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient; - scene.DeRezObjects(client, new System.Collections.Generic.List() { so.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero); - - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); - - Assert.That(retrievedPart, Is.Not.Null); - - Assert.That(so.IsDeleted, Is.False); - - sogd.InventoryDeQueueAndDelete(); - - Assert.That(so.IsDeleted, Is.True); - - SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart2, Is.Null); - } - - /// - /// Test deleting an object asynchronously to user inventory. - /// - [Test] - public void TestDeleteSceneObjectAsyncToUserInventory() - { - TestHelpers.InMethod(); -// TestHelpers.EnableLogging(); - - UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); - string myObjectName = "Fred"; - - TestScene scene = new SceneHelpers().SetupScene(); - - IConfigSource configSource = new IniConfigSource(); - IConfig config = configSource.AddConfig("Modules"); - config.Set("InventoryAccessModule", "BasicInventoryAccessModule"); - SceneHelpers.SetupSceneModules( - scene, configSource, new object[] { new BasicInventoryAccessModule() }); - - SceneHelpers.SetupSceneModules(scene, new object[] { }); - - // 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, myObjectName, agentId); - - UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, agentId); - InventoryFolderBase folder1 - = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, ua.PrincipalID, "folder1"); - - IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient; - scene.DeRezObjects(client, new List() { so.LocalId }, UUID.Zero, DeRezAction.Take, folder1.ID); - - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); - - Assert.That(retrievedPart, Is.Not.Null); - Assert.That(so.IsDeleted, Is.False); - - sogd.InventoryDeQueueAndDelete(); - - Assert.That(so.IsDeleted, Is.True); - - SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); - Assert.That(retrievedPart2, Is.Null); - -// SceneSetupHelpers.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client); - - InventoryItemBase retrievedItem - = UserInventoryHelpers.GetInventoryItem( - scene.InventoryService, ua.PrincipalID, "folder1/" + myObjectName); - - // Check that we now have the taken part in our inventory - Assert.That(retrievedItem, Is.Not.Null); - - // Check that the taken part has actually disappeared -// SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); -// Assert.That(retrievedPart, Is.Null); - } - - /// /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by /// OpenSim. @@ -334,4 +240,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(sog.Parts.Length, Is.EqualTo(2)); } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index 4f15791..c1522e7 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -33,19 +33,21 @@ using NUnit.Framework; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.Framework.InventoryAccess; using OpenSim.Region.CoreModules.World.Permissions; using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; using OpenSim.Tests.Common; using OpenSim.Tests.Common.Mock; namespace OpenSim.Region.Framework.Scenes.Tests { /// - /// Tests derez of scene objects by users. + /// Tests derez of scene objects. /// /// /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. - /// TODO: These tests are very incomplete - they only test for a few conditions. + /// TODO: These tests are incomplete - need to test more kinds of derez (e.g. return object). /// [TestFixture] public class SceneObjectDeRezTests : OpenSimTestCase @@ -76,14 +78,20 @@ namespace OpenSim.Region.Framework.Scenes.Tests = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); part.Name = "obj1"; scene.AddNewSceneObject(new SceneObjectGroup(part), false); + List localIds = new List(); localIds.Add(part.LocalId); - scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); + + // Check that object isn't deleted until we crank the sogd handle. + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart, Is.Not.Null); + Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); + sogd.InventoryDeQueueAndDelete(); - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); - Assert.That(retrievedPart, Is.Null); + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart2, Is.Null); } /// @@ -124,6 +132,67 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Object should still be in the scene. SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); - } + } + + /// + /// Test deleting an object asynchronously to user inventory. + /// + [Test] + public void TestDeleteSceneObjectAsyncToUserInventory() + { + TestHelpers.InMethod(); +// TestHelpers.EnableLogging(); + + UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); + string myObjectName = "Fred"; + + TestScene scene = new SceneHelpers().SetupScene(); + + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Modules"); + config.Set("InventoryAccessModule", "BasicInventoryAccessModule"); + SceneHelpers.SetupSceneModules( + scene, configSource, new object[] { new BasicInventoryAccessModule() }); + + SceneHelpers.SetupSceneModules(scene, new object[] { }); + + // 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, myObjectName, agentId); + + UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, agentId); + InventoryFolderBase folder1 + = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, ua.PrincipalID, "folder1"); + + IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient; + scene.DeRezObjects(client, new List() { so.LocalId }, UUID.Zero, DeRezAction.Take, folder1.ID); + + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); + + Assert.That(retrievedPart, Is.Not.Null); + Assert.That(so.IsDeleted, Is.False); + + sogd.InventoryDeQueueAndDelete(); + + Assert.That(so.IsDeleted, Is.True); + + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); + Assert.That(retrievedPart2, Is.Null); + +// SceneSetupHelpers.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client); + + InventoryItemBase retrievedItem + = UserInventoryHelpers.GetInventoryItem( + scene.InventoryService, ua.PrincipalID, "folder1/" + myObjectName); + + // Check that we now have the taken part in our inventory + Assert.That(retrievedItem, Is.Not.Null); + + // Check that the taken part has actually disappeared +// SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); +// Assert.That(retrievedPart, Is.Null); + } } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 5cf62c2..abaa1d1 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -48,8 +48,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests UUID m_ownerId = TestHelpers.ParseTail(0x1); [SetUp] - public void SetUp() + public override void SetUp() { + base.SetUp(); + m_scene = new SceneHelpers().SetupScene(); } -- cgit v1.1 From ac65085cc36bb4820482bf769b4be44e1c8d58ce Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 3 Dec 2012 20:09:54 -0500 Subject: XmlRpcGridRouter Flesh out XmlRpcGridRouter to reap unused channels from gateway when scripts or objects are removed, or when the llCloseRemoteDataChannel is called. See: http://http://forge.opensimulator.org/gf/project/xmlrpcrouter/ or https://github.com/BlueWall/XmlRpcRouter for php gateway and test code. --- OpenSim/Region/Framework/Interfaces/IXmlRpcRouter.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IXmlRpcRouter.cs b/OpenSim/Region/Framework/Interfaces/IXmlRpcRouter.cs index 6db6674..093d3f0 100644 --- a/OpenSim/Region/Framework/Interfaces/IXmlRpcRouter.cs +++ b/OpenSim/Region/Framework/Interfaces/IXmlRpcRouter.cs @@ -34,5 +34,6 @@ namespace OpenSim.Region.Framework.Interfaces void RegisterNewReceiver(IScriptModule scriptEngine, UUID channelID, UUID objectID, UUID itemID, string url); void ScriptRemoved(UUID itemID); void ObjectRemoved(UUID objectID); + void UnRegisterReceiver(string channelID, UUID itemID); } } -- cgit v1.1 From fb26d32a5c1320e97c9288326ebe402658a0a1c7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 4 Dec 2012 22:33:25 +0000 Subject: minor: Put Scene.PhysicsRequestAsset() into standard C# xml format. --- OpenSim/Region/Framework/Scenes/Scene.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 1ad5edd..cca295c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5638,10 +5638,17 @@ namespace OpenSim.Region.Framework.Scenes return m_SpawnPoint - 1; } - // Wrappers to get physics modules retrieve assets. Has to be done this way - // because we can't assign the asset service to physics directly - at the - // time physics are instantiated it's not registered but it will be by - // the time the first prim exists. + /// + /// Wrappers to get physics modules retrieve assets. + /// + /// + /// Has to be done this way + /// because we can't assign the asset service to physics directly - at the + /// time physics are instantiated it's not registered but it will be by + /// the time the first prim exists. + /// + /// + /// public void PhysicsRequestAsset(UUID assetID, AssetReceivedDelegate callback) { AssetService.Get(assetID.ToString(), callback, PhysicsAssetReceived); -- cgit v1.1 From 0568c76a8801408665730702c97717d3c05cfe4d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 7 Dec 2012 00:47:04 +0000 Subject: Use a thread abort safe version of OpenMetaverse.DoubleDictionary with the aim of avoiding OpenSimulator problems due to script thread aborts. When an object is removed, its scripts are stopped and then the thread running them is aborted if stop takes too long. However, it appears that aborting a thread at just the wrong moment when it is obtaining a ReaderWriterLockSlim lock can leave this lock in an inconsistent state. One symptom of this is that mono leaps to 100% cpu and a vm thread dump reveals lots of threads waiting for a ReaderWriterLockSlim lock without any thread actually holding it. This is probably the same problem as encountered originally in commit 12cebb12 This commit looks to plaster this problem by putting lock obtaining methods inside finally blocks which should be uninterruptible by thread aborts. --- OpenSim/Region/Framework/Scenes/EntityManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/EntityManager.cs b/OpenSim/Region/Framework/Scenes/EntityManager.cs index b788a3c..7181313 100644 --- a/OpenSim/Region/Framework/Scenes/EntityManager.cs +++ b/OpenSim/Region/Framework/Scenes/EntityManager.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Reflection; using log4net; using OpenMetaverse; +using OpenSim.Framework; namespace OpenSim.Region.Framework.Scenes { @@ -38,7 +39,8 @@ namespace OpenSim.Region.Framework.Scenes { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private readonly DoubleDictionary m_entities = new DoubleDictionary(); + private readonly DoubleDictionaryThreadAbortSafe m_entities + = new DoubleDictionaryThreadAbortSafe(); public int Count { -- cgit v1.1 From cb80d8a29c0af24421a51087ddb56ad35a5c49b8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 9 Dec 2012 15:31:11 -0800 Subject: UserManagementModule: search the local cache for names too. Inventory transfers: don't do async on asset transfers or now. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index ad40d6b..e0f3c99 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -692,7 +692,7 @@ namespace OpenSim.Region.Framework.Scenes { IInventoryAccessModule invAccess = RequestModuleInterface(); if (invAccess != null) - Util.FireAndForget(delegate { invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); }); + invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); } if (!Permissions.BypassPermissions()) -- cgit v1.1 From b8178f5a509caf897dac0660db47ea9a5224194a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 9 Dec 2012 22:03:21 -0800 Subject: Switched the order by which foreign inventory and foreign assets are brought in, to avoid race conditions on the client. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e0f3c99..5c8b097 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -688,12 +688,10 @@ namespace OpenSim.Region.Framework.Scenes itemCopy.SalePrice = item.SalePrice; itemCopy.SaleType = item.SaleType; - if (AddInventoryItem(itemCopy)) - { - IInventoryAccessModule invAccess = RequestModuleInterface(); - if (invAccess != null) - invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); - } + IInventoryAccessModule invAccess = RequestModuleInterface(); + if (invAccess != null) + invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); + AddInventoryItem(itemCopy); if (!Permissions.BypassPermissions()) { -- cgit v1.1 From 88b094cbf76e9775163ebfdfa23ddb052b62b460 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 13 Dec 2012 13:05:28 -0800 Subject: Simplify sit code a bit by determining correct animation in HandleSit instead of HandleSitRequest. This eliminates m_nextSitAnimation, an unneeded state-saving variable in ScenePresence --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 36 ++++-------------------- 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f36c0b..58721b0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -212,8 +212,6 @@ namespace OpenSim.Region.Framework.Scenes private Quaternion m_headrotation = Quaternion.Identity; - private string m_nextSitAnimation = String.Empty; - //PauPaw:Proper PID Controler for autopilot************ public bool MovingToTarget { get; private set; } public Vector3 MoveToPositionTarget { get; private set; } @@ -1955,25 +1953,10 @@ namespace OpenSim.Region.Framework.Scenes StandUp(); } -// if (!String.IsNullOrEmpty(sitAnimation)) -// { -// m_nextSitAnimation = sitAnimation; -// } -// else -// { - m_nextSitAnimation = "SIT"; -// } - - //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); SceneObjectPart part = FindNextAvailableSitTarget(targetID); if (part != null) { - if (!String.IsNullOrEmpty(part.SitAnimation)) - { - m_nextSitAnimation = part.SitAnimation; - } - m_requestedSitTargetID = part.LocalId; m_requestedSitTargetUUID = targetID; @@ -2188,18 +2171,6 @@ namespace OpenSim.Region.Framework.Scenes public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) { - if (!String.IsNullOrEmpty(m_nextSitAnimation)) - { - HandleAgentSit(remoteClient, agentID, m_nextSitAnimation); - } - else - { - HandleAgentSit(remoteClient, agentID, "SIT"); - } - } - - public void HandleAgentSit(IClientAPI remoteClient, UUID agentID, string sitAnimation) - { SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); if (part != null) @@ -2246,7 +2217,12 @@ namespace OpenSim.Region.Framework.Scenes Velocity = Vector3.Zero; RemoveFromPhysicalScene(); - + + String sitAnimation = "SIT"; + if (!String.IsNullOrEmpty(part.SitAnimation)) + { + sitAnimation = part.SitAnimation; + } Animator.TrySetMovementAnimation(sitAnimation); SendAvatarDataToAllAgents(); } -- cgit v1.1 From 750ad2d3afd6fcf32a9e04794d860e117559a78f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Dec 2012 22:15:40 +0000 Subject: Fix issue where calling llVolumeDetect(FALSE) would not remove phantom flag, causing subsequent issues if physics was re-enabled. Added regression tests Addresses http://opensimulator.org/mantis/view.php?id=6365 --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 3 +- .../Scenes/Tests/SceneObjectStatusTests.cs | 41 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f79ac96..ff67d6d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3993,13 +3993,14 @@ namespace OpenSim.Region.Framework.Scenes VolumeDetectActive = true; } } - else + else if (SetVD != wasVD) { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like // (mumbles, well, at least if you have infinte CPU powers :-)) if (pa != null) pa.SetVolumeDetect(0); + RemFlag(PrimFlags.Phantom); VolumeDetectActive = false; } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index 093cbd2..8eb3191 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs @@ -78,6 +78,26 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] + public void TestSetNonPhysicsVolumeDetectSinglePrim() + { + TestHelpers.InMethod(); + + m_scene.AddSceneObject(m_so1); + + SceneObjectPart rootPart = m_so1.RootPart; + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); + + m_so1.ScriptSetVolumeDetect(true); + +// Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags); + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom)); + + m_so1.ScriptSetVolumeDetect(false); + + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); + } + + [Test] public void TestSetPhysicsSinglePrim() { TestHelpers.InMethod(); @@ -89,13 +109,32 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_so1.ScriptSetPhysicsStatus(true); -// Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags); Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); m_so1.ScriptSetPhysicsStatus(false); Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); } + + [Test] + public void TestSetPhysicsVolumeDetectSinglePrim() + { + TestHelpers.InMethod(); + + m_scene.AddSceneObject(m_so1); + + SceneObjectPart rootPart = m_so1.RootPart; + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); + + m_so1.ScriptSetPhysicsStatus(true); + m_so1.ScriptSetVolumeDetect(true); + + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom | PrimFlags.Physics)); + + m_so1.ScriptSetVolumeDetect(false); + + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); + } [Test] public void TestSetPhysicsLinkset() -- cgit v1.1 From 56ec177b3b5b8f5b30d1024cfe6fbf8c59e36c6f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Dec 2012 23:42:23 +0000 Subject: minor: Add commented out log lines to ScenePresenceAnimator for future debug use (such as logging anim pack contents sent to clients) --- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index bb33f07..5b16b67 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -26,9 +26,10 @@ */ using System; -using System.Threading; using System.Collections.Generic; +using System.Linq; using System.Reflection; +using System.Threading; using log4net; using OpenMetaverse; using OpenSim.Framework; @@ -113,6 +114,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_scenePresence.IsChildAgent) return; +// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name); + if (m_animations.Remove(animID)) SendAnimPack(); } @@ -503,6 +506,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_scenePresence.IsChildAgent) return; +// m_log.DebugFormat( +// "[SCENE PRESENCE ANIMATOR]: Sending anim pack with animations '{0}', sequence '{1}', uuids '{2}'", +// string.Join(",", Array.ConvertAll(animations, a => a.ToString())), +// string.Join(",", Array.ConvertAll(seqs, s => s.ToString())), +// string.Join(",", Array.ConvertAll(objectIDs, o => o.ToString()))); + m_scenePresence.Scene.ForEachClient( delegate(IClientAPI client) { -- cgit v1.1 From 494e6a5f114372ca417607ff6af3c6d5a3aaae9e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 15 Dec 2012 00:30:17 +0000 Subject: minor: If the physics module tells us that an object has gone out of bounds, more helpfully log the name, id, position and region of that object. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ff67d6d..af7fae3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2266,11 +2266,14 @@ namespace OpenSim.Region.Framework.Scenes public void PhysicsOutOfBounds(Vector3 pos) { - m_log.Error("[PHYSICS]: Physical Object went out of bounds."); + // Note: This is only being called on the root prim at this time. + + m_log.ErrorFormat( + "[SCENE OBJECT PART]: Physical object {0}, localID {1} went out of bounds at {2} in {3}. Stopping at {4} and making non-physical.", + Name, LocalId, pos, ParentGroup.Scene.Name, AbsolutePosition); RemFlag(PrimFlags.Physics); DoPhysicsPropertyUpdate(false, true); - //ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); } public void PhysicsRequestingTerseUpdate() -- cgit v1.1 From 8a95953bb7c35ec1f2b6d97520c56178778ef729 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 16 Dec 2012 21:12:01 -0800 Subject: BulletSim: experimentally remove unit displacement from prim border crossing test. This seems to cause border crossing to be sensed either a little early or a little late depending on which directin the object is moving. If border crossings become totally borked or someone remembers why this was displacement was done, revert this change. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 1fa6a75..64a5811 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -430,8 +430,19 @@ namespace OpenSim.Region.Framework.Scenes if (Scene != null) { - if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) - || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) + if ( + // (Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) + // || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) + // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) + // || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) + // Experimental change for better border crossings. + // The commented out original lines above would, it seems, trigger + // a border crossing a little early or late depending on which + // direction the object was moving. + (Scene.TestBorderCross(val, Cardinals.E) + || Scene.TestBorderCross(val, Cardinals.W) + || Scene.TestBorderCross(val, Cardinals.N) + || Scene.TestBorderCross(val, Cardinals.S)) && !IsAttachmentCheckFull() && (!Scene.LoadingPrims)) { m_scene.CrossPrimGroupIntoNewRegion(val, this, true); -- cgit v1.1 From d15bfcf61404914c3d64c965db9e66295655bea5 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 18 Dec 2012 14:59:41 -0800 Subject: Replace axis rotation numeric constants (STATUS_ROTATE_XYZ) with symbols. Also made it so llSetStatus() can individually enable disable rotation axi using the bitmask of flags. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 +++++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 64a5811..35e7c45 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -99,6 +99,15 @@ namespace OpenSim.Region.Framework.Scenes /// public partial class SceneObjectGroup : EntityBase, ISceneObject { + // Axis selection bitmask used by SetAxisRotation() + // Just happen to be the same bits used by llSetStatus() and defined in ScriptBaseClass. + public enum axisSelect : int + { + STATUS_ROTATE_X = 0x002, + STATUS_ROTATE_Y = 0x004, + STATUS_ROTATE_Z = 0x008, + } + // private PrimCountTaintedDelegate handlerPrimCountTainted = null; /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index af7fae3..7a97e5f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1918,11 +1918,11 @@ namespace OpenSim.Region.Framework.Scenes public int GetAxisRotation(int axis) { //Cannot use ScriptBaseClass constants as no referance to it currently. - if (axis == 2)//STATUS_ROTATE_X + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) return STATUS_ROTATE_X; - if (axis == 4)//STATUS_ROTATE_Y + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) return STATUS_ROTATE_Y; - if (axis == 8)//STATUS_ROTATE_Z + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) return STATUS_ROTATE_Z; return 0; @@ -2671,13 +2671,13 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.SetAxisRotation(axis, rotate); //Cannot use ScriptBaseClass constants as no referance to it currently. - if (axis == 2)//STATUS_ROTATE_X + if ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) != 0) STATUS_ROTATE_X = rotate; - if (axis == 4)//STATUS_ROTATE_Y + if ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) != 0) STATUS_ROTATE_Y = rotate; - if (axis == 8)//STATUS_ROTATE_Z + if ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) != 0) STATUS_ROTATE_Z = rotate; } -- cgit v1.1 From 5afab9bcfe9e163219cf6b4317a8914860e3f969 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 27 Dec 2012 16:03:14 -0800 Subject: Add check to always push terse updates for presences that have new velocities of zero. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 58721b0..a60c551 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2335,9 +2335,14 @@ namespace OpenSim.Region.Framework.Scenes // storing a requested force instead of an actual traveling velocity // Throw away duplicate or insignificant updates - if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || - !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || - !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) + if ( + // If the velocity has become zero, send it no matter what. + (Velocity != m_lastVelocity && Velocity == Vector3.Zero) + // otherwise, if things have changed reasonably, send the update + || (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) + || !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) + || !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE))) + { SendTerseUpdateToAllClients(); -- cgit v1.1 From fdf8732cd712d8a5799a817e61d4c68e204ba9a2 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 28 Dec 2012 16:29:16 -0800 Subject: ScenePresence passes the avatar rotation down to the physics engine. This will be a no-op for ODE but enables asymmetrical avatars for BulletSim. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a60c551..0219540 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -560,6 +560,10 @@ namespace OpenSim.Region.Framework.Scenes set { m_bodyRot = value; + if (PhysicsActor != null) + { + PhysicsActor.Orientation = m_bodyRot; + } // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, m_bodyRot); } } -- cgit v1.1 From 1a6694b26487e4b9bd33e1c6c4415fb7d36f0d1d Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 25 Dec 2012 10:47:45 +0200 Subject: Fixed several problems with the Sun: some settings didn't work, or were inconsistently used. - The sun position is always calculated by combining the sun settings in the Region and Estate. This fixes the problem that 'UseEstateSun' didn't work. - To remove ambiguity, the EstateToolsSunUpdate event no longer accepts the sun's position as parameters. That's because the position is always calculated from the Region and Estate settings. - Use only the 'FixedSun' flag to determine whether the sun is fixed; not the 'UseGlobalTime' flag. - Don't change the region's 'SunPosition' field according to the sun's position: this field is used only to set the position when using a FixedSun. (The 'SunVector' field does get updated according to the sun's position in the sky) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 13 +++++------- OpenSim/Region/Framework/Scenes/Scene.cs | 28 +------------------------ 2 files changed, 6 insertions(+), 35 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 4c49b71..6b08e0f 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -751,7 +751,7 @@ namespace OpenSim.Region.Framework.Scenes public event ScriptTimerEvent OnScriptTimerEvent; */ - public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); + public delegate void EstateToolsSunUpdate(ulong regionHandle); public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); public event EstateToolsSunUpdate OnEstateToolsSunUpdate; @@ -2507,13 +2507,10 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Updates the system as to how the position of the sun should be handled. + /// Called when the sun's position parameters have changed in the Region and/or Estate /// - /// - /// True if the Sun Position is fixed - /// True if the Estate Settings should be used instead of region - /// The hour 0.0 <= FixedSunHour <= 24.0 at which the sun is fixed at. Sun Hour 0 is sun-rise, when Day/Night ratio is 1:1 - public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour) + /// The region that changed + public void TriggerEstateToolsSunUpdate(ulong regionHandle) { EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; if (handlerEstateToolsSunUpdate != null) @@ -2522,7 +2519,7 @@ namespace OpenSim.Region.Framework.Scenes { try { - d(regionHandle, FixedTime, useEstateTime, FixedSunHour); + d(regionHandle); } catch (Exception e) { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index cca295c..11b63b7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5345,33 +5345,7 @@ namespace OpenSim.Region.Framework.Scenes public void TriggerEstateSunUpdate() { - float sun; - if (RegionInfo.RegionSettings.UseEstateSun) - { - sun = (float)RegionInfo.EstateSettings.SunPosition; - if (RegionInfo.EstateSettings.UseGlobalTime) - { - sun = EventManager.GetCurrentTimeAsSunLindenHour() - 6.0f; - } - - // - EventManager.TriggerEstateToolsSunUpdate( - RegionInfo.RegionHandle, - RegionInfo.EstateSettings.FixedSun, - RegionInfo.RegionSettings.UseEstateSun, - sun); - } - else - { - // Use the Sun Position from the Region Settings - sun = (float)RegionInfo.RegionSettings.SunPosition - 6.0f; - - EventManager.TriggerEstateToolsSunUpdate( - RegionInfo.RegionHandle, - RegionInfo.RegionSettings.FixedSun, - RegionInfo.RegionSettings.UseEstateSun, - sun); - } + EventManager.TriggerEstateToolsSunUpdate(RegionInfo.RegionHandle); } private void HandleReloadEstate(string module, string[] cmd) -- cgit v1.1 From 9503383887d6af871e843cbcbb141a50df56f551 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 4 Jan 2013 20:34:39 +0000 Subject: Fix llGetLinkKey() to return the last sat avatar as the last link number. As per http://wiki.secondlife.com/wiki/LlGetLinkKey This is done by keeping a scene-object wide list of sitters. This also fixes bugs in this function where linknums 0 and 1 weren't treated properly if there were sitting avatars on a single prim. This also fixes a minor race condition for multiple concurrent sitters on a prim with no current sitters by locking on the object-wide list rather than individual sop lists Addresses http://opensimulator.org/mantis/view.php?id=6477 --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 35 ++++++++-- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 79 +++++++++++----------- 2 files changed, 68 insertions(+), 46 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 35e7c45..15795e5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -647,6 +647,18 @@ namespace OpenSim.Region.Framework.Scenes /// public UUID FromFolderID { get; set; } + /// + /// IDs of all avatars sat on this scene object. + /// + /// + /// We need this so that we can maintain a linkset wide ordering of avatars sat on different parts. + /// This must be locked before it is read or written. + /// SceneObjectPart sitting avatar add/remove code also locks on this object to avoid race conditions. + /// No avatar should appear more than once in this list. + /// Do not manipulate this list directly - use the Add/Remove sitting avatar methods on SceneObjectPart. + /// + protected internal List m_sittingAvatars = new List(); + #endregion // ~SceneObjectGroup() @@ -3564,17 +3576,28 @@ namespace OpenSim.Region.Framework.Scenes } /// + /// Get a copy of the list of sitting avatars on all prims of this object. + /// + /// + /// This is sorted by the order in which avatars sat down. If an avatar stands up then all avatars that sat + /// down after it move one place down the list. + /// + /// A list of the sitting avatars. Returns an empty list if there are no sitting avatars. + public List GetSittingAvatars() + { + lock (m_sittingAvatars) + return new List(m_sittingAvatars); + } + + /// /// Gets the number of sitting avatars. /// /// This applies to all sitting avatars whether there is a sit target set or not. /// public int GetSittingAvatarsCount() { - int count = 0; - - Array.ForEach(m_parts.GetArray(), p => count += p.GetSittingAvatarsCount()); - - return count; + lock (m_sittingAvatars) + return m_sittingAvatars.Count; } public override string ToString() @@ -3583,7 +3606,7 @@ namespace OpenSim.Region.Framework.Scenes } #region ISceneObject - + public virtual ISceneObject CloneForNewScene() { SceneObjectGroup sog = Copy(false); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 7a97e5f..232861e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1256,7 +1256,7 @@ namespace OpenSim.Region.Framework.Scenes public UUID SitTargetAvatar { get; set; } /// - /// IDs of all avatars start on this object part. + /// IDs of all avatars sat on this part. /// /// /// We need to track this so that we can stop sat upon prims from being attached. @@ -4504,18 +4504,22 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal bool AddSittingAvatar(UUID avatarId) { - if (IsSitTargetSet && SitTargetAvatar == UUID.Zero) - SitTargetAvatar = avatarId; + lock (ParentGroup.m_sittingAvatars) + { + if (IsSitTargetSet && SitTargetAvatar == UUID.Zero) + SitTargetAvatar = avatarId; - HashSet sittingAvatars = m_sittingAvatars; + if (m_sittingAvatars == null) + m_sittingAvatars = new HashSet(); - if (sittingAvatars == null) - sittingAvatars = new HashSet(); + if (m_sittingAvatars.Add(avatarId)) + { + ParentGroup.m_sittingAvatars.Add(avatarId); - lock (sittingAvatars) - { - m_sittingAvatars = sittingAvatars; - return m_sittingAvatars.Add(avatarId); + return true; + } + + return false; } } @@ -4529,27 +4533,26 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal bool RemoveSittingAvatar(UUID avatarId) { - if (SitTargetAvatar == avatarId) - SitTargetAvatar = UUID.Zero; - - HashSet sittingAvatars = m_sittingAvatars; + lock (ParentGroup.m_sittingAvatars) + { + if (SitTargetAvatar == avatarId) + SitTargetAvatar = UUID.Zero; - // This can occur under a race condition where another thread - if (sittingAvatars == null) - return false; + if (m_sittingAvatars == null) + return false; - lock (sittingAvatars) - { - if (sittingAvatars.Remove(avatarId)) + if (m_sittingAvatars.Remove(avatarId)) { - if (sittingAvatars.Count == 0) + if (m_sittingAvatars.Count == 0) m_sittingAvatars = null; + ParentGroup.m_sittingAvatars.Remove(avatarId); + return true; } - } - return false; + return false; + } } /// @@ -4559,16 +4562,12 @@ namespace OpenSim.Region.Framework.Scenes /// A hashset of the sitting avatars. Returns null if there are no sitting avatars. public HashSet GetSittingAvatars() { - HashSet sittingAvatars = m_sittingAvatars; - - if (sittingAvatars == null) - { - return null; - } - else + lock (ParentGroup.m_sittingAvatars) { - lock (sittingAvatars) - return new HashSet(sittingAvatars); + if (m_sittingAvatars == null) + return null; + else + return new HashSet(m_sittingAvatars); } } @@ -4579,13 +4578,13 @@ namespace OpenSim.Region.Framework.Scenes /// public int GetSittingAvatarsCount() { - HashSet sittingAvatars = m_sittingAvatars; - - if (sittingAvatars == null) - return 0; - - lock (sittingAvatars) - return sittingAvatars.Count; + lock (ParentGroup.m_sittingAvatars) + { + if (m_sittingAvatars == null) + return 0; + else + return m_sittingAvatars.Count; + } } } -} +} \ No newline at end of file -- cgit v1.1 From 5561333668f61f043cdfc0733a4eb50a1bcfb14e Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 8 Jan 2013 23:01:09 +0100 Subject: Prevent empty Anim Packs --- OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 65ae445..d2fc7f1 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -164,7 +164,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation { int defaultSize = 0; if (m_defaultAnimation.AnimID != UUID.Zero) + { + defaultSize++; + } + else if (m_animations.Count == 0) + { defaultSize++; + } animIDs = new UUID[m_animations.Count + defaultSize]; sequenceNums = new int[m_animations.Count + defaultSize]; @@ -176,6 +182,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation sequenceNums[0] = m_defaultAnimation.SequenceNum; objectIDs[0] = m_defaultAnimation.ObjectID; } + else if (m_animations.Count == 0) + { + animIDs[0] = m_implicitDefaultAnimation.AnimID; + sequenceNums[0] = m_defaultAnimation.SequenceNum; + objectIDs[0] = m_implicitDefaultAnimation.ObjectID; + } for (int i = 0; i < m_animations.Count; ++i) { -- cgit v1.1 From a775931a0cec9f65748c6e20dd2695edcbe21b7f Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 8 Jan 2013 23:24:34 +0100 Subject: Fix sequence id fr default anim --- OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index d2fc7f1..64c31f8 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation else if (m_animations.Count == 0) { animIDs[0] = m_implicitDefaultAnimation.AnimID; - sequenceNums[0] = m_defaultAnimation.SequenceNum; + sequenceNums[0] = m_implicitDefaultAnimation.SequenceNum; objectIDs[0] = m_implicitDefaultAnimation.ObjectID; } -- cgit v1.1 From c1c540f454b0c9fd189ed768764fb8a51ee773c6 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 9 Jan 2013 00:20:14 +0000 Subject: Revert "Fix sequence id fr default anim" This reverts commit a775931a0cec9f65748c6e20dd2695edcbe21b7f. --- OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 64c31f8..d2fc7f1 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation else if (m_animations.Count == 0) { animIDs[0] = m_implicitDefaultAnimation.AnimID; - sequenceNums[0] = m_implicitDefaultAnimation.SequenceNum; + sequenceNums[0] = m_defaultAnimation.SequenceNum; objectIDs[0] = m_implicitDefaultAnimation.ObjectID; } -- cgit v1.1 From f16c4a254c263a7fd75799fe79da6b3d0a1c80a2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 9 Jan 2013 00:20:24 +0000 Subject: Revert "Prevent empty Anim Packs" This reverts commit 5561333668f61f043cdfc0733a4eb50a1bcfb14e. --- OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index d2fc7f1..65ae445 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -164,13 +164,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation { int defaultSize = 0; if (m_defaultAnimation.AnimID != UUID.Zero) - { - defaultSize++; - } - else if (m_animations.Count == 0) - { defaultSize++; - } animIDs = new UUID[m_animations.Count + defaultSize]; sequenceNums = new int[m_animations.Count + defaultSize]; @@ -182,12 +176,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation sequenceNums[0] = m_defaultAnimation.SequenceNum; objectIDs[0] = m_defaultAnimation.ObjectID; } - else if (m_animations.Count == 0) - { - animIDs[0] = m_implicitDefaultAnimation.AnimID; - sequenceNums[0] = m_defaultAnimation.SequenceNum; - objectIDs[0] = m_implicitDefaultAnimation.ObjectID; - } for (int i = 0; i < m_animations.Count; ++i) { -- cgit v1.1 From 701ca1e4b8b3d54e1e93baf54aada3867d403075 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 10 Jan 2013 22:38:48 +0000 Subject: Add "debug scene pbackup true|false" console command. This enables or disable periodic scene backup. For debug purposes. If false, scene is still saved on shutdown. --- OpenSim/Region/Framework/Scenes/Scene.cs | 39 ++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 11b63b7..d0a2115 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -77,6 +77,23 @@ namespace OpenSim.Region.Framework.Scenes /// public bool DebugUpdates { get; private set; } + /// + /// If true then the scene is saved to persistent storage periodically, every m_update_backup frames and + /// if objects meet required conditions (m_dontPersistBefore and m_dontPersistAfter). + /// + /// + /// Even if false, the scene will still be saved on clean shutdown. + /// FIXME: Currently, setting this to false will mean that objects are not periodically returned from parcels. + /// This needs to be fixed. + /// + public bool PeriodicBackup { get; private set; } + + /// + /// If false then the scene is never saved to persistence storage even if PeriodicBackup == true and even + /// if the scene is being shut down for the final time. + /// + public bool UseBackup { get; private set; } + public SynchronizeSceneHandler SynchronizeScene; /// @@ -341,7 +358,6 @@ namespace OpenSim.Region.Framework.Scenes private Timer m_mapGenerationTimer = new Timer(); private bool m_generateMaptiles; - private bool m_useBackup = true; #endregion Fields @@ -594,11 +610,6 @@ namespace OpenSim.Region.Framework.Scenes get { return m_authenticateHandler; } } - public bool UseBackup - { - get { return m_useBackup; } - } - // an instance to the physics plugin's Scene object. public PhysicsScene PhysicsScene { @@ -768,8 +779,8 @@ namespace OpenSim.Region.Framework.Scenes StartDisabled = startupConfig.GetBoolean("StartDisabled", false); m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); - m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); - if (!m_useBackup) + UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup); + if (!UseBackup) m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); //Animation states @@ -937,6 +948,8 @@ namespace OpenSim.Region.Framework.Scenes { PhysicalPrims = true; CollidablePrims = true; + PeriodicBackup = true; + UseBackup = true; BordersLocked = true; Border northBorder = new Border(); @@ -1189,6 +1202,14 @@ namespace OpenSim.Region.Framework.Scenes Active = active; } + if (options.ContainsKey("pbackup")) + { + bool active; + + if (bool.TryParse(options["pbackup"], out active)) + PeriodicBackup = active; + } + if (options.ContainsKey("scripting")) { bool enableScripts = true; @@ -1570,7 +1591,7 @@ namespace OpenSim.Region.Framework.Scenes eventMS = Util.EnvironmentTickCountSubtract(tmpMS); } - if (Frame % m_update_backup == 0) + if (PeriodicBackup && Frame % m_update_backup == 0) { tmpMS = Util.EnvironmentTickCount(); UpdateStorageBackup(); -- cgit v1.1 From 983e458bb67defd79c48d6ee66682f8f86e2029c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 10 Jan 2013 22:59:40 +0000 Subject: refactor: route the final scene backup through the same code that handles periodic backup This is rather than making unnecessary duplicate checks that the SOG later performs again. --- OpenSim/Region/Framework/Scenes/Scene.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d0a2115..515184c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1322,16 +1322,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.Debug("[SCENE]: Persisting changed objects"); EventManager.TriggerSceneShuttingDown(this); - - EntityBase[] entities = GetEntities(); - foreach (EntityBase entity in entities) - { - if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged) - { - ((SceneObjectGroup)entity).ProcessBackup(SimulationDataService, false); - } - } - + Backup(false); m_sceneGraph.Close(); if (!GridService.DeregisterRegion(RegionInfo.RegionID)) -- cgit v1.1 From a16ae5d7e3e687fdcdae39f848f66087f16433a2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 10 Jan 2013 23:49:48 +0000 Subject: Move scene debug commands into separate module. Command changes from "debug scene " to "debug scene set " to accomodate future settings --- .../Framework/Interfaces/ISceneCommandsModule.cs | 43 ++++++ OpenSim/Region/Framework/Scenes/Scene.cs | 153 ++++++++------------- 2 files changed, 102 insertions(+), 94 deletions(-) create mode 100644 OpenSim/Region/Framework/Interfaces/ISceneCommandsModule.cs (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/ISceneCommandsModule.cs b/OpenSim/Region/Framework/Interfaces/ISceneCommandsModule.cs new file mode 100644 index 0000000..c5e678b --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/ISceneCommandsModule.cs @@ -0,0 +1,43 @@ +/* + * 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 OpenSim 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 OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.Framework.Interfaces +{ + public interface ISceneCommandsModule + { + /// + /// Sets the scene debug options. + /// + void SetSceneDebugOptions(Dictionary options); + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 515184c..4859dff 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -70,12 +70,12 @@ namespace OpenSim.Region.Framework.Scenes /// /// Show debug information about teleports. /// - public bool DebugTeleporting { get; private set; } + public bool DebugTeleporting { get; set; } /// /// Show debug information about the scene loop. /// - public bool DebugUpdates { get; private set; } + public bool DebugUpdates { get; set; } /// /// If true then the scene is saved to persistent storage periodically, every m_update_backup frames and @@ -86,13 +86,61 @@ namespace OpenSim.Region.Framework.Scenes /// FIXME: Currently, setting this to false will mean that objects are not periodically returned from parcels. /// This needs to be fixed. /// - public bool PeriodicBackup { get; private set; } + public bool PeriodicBackup { get; set; } /// /// If false then the scene is never saved to persistence storage even if PeriodicBackup == true and even /// if the scene is being shut down for the final time. /// - public bool UseBackup { get; private set; } + public bool UseBackup { get; set; } + + /// + /// If false then physical objects are disabled, though collisions will continue as normal. + /// + public bool PhysicsEnabled { get; set; } + + /// + /// If false then scripts are not enabled on the smiulator + /// + public bool ScriptsEnabled + { + get { return m_scripts_enabled; } + set + { + if (m_scripts_enabled != value) + { + if (!value) + { + m_log.Info("Stopping all Scripts in Scene"); + + EntityBase[] entities = Entities.GetEntities(); + foreach (EntityBase ent in entities) + { + if (ent is SceneObjectGroup) + ((SceneObjectGroup)ent).RemoveScriptInstances(false); + } + } + else + { + m_log.Info("Starting all Scripts in Scene"); + + EntityBase[] entities = Entities.GetEntities(); + foreach (EntityBase ent in entities) + { + if (ent is SceneObjectGroup) + { + SceneObjectGroup sog = (SceneObjectGroup)ent; + sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0); + sog.ResumeScripts(); + } + } + } + + m_scripts_enabled = value; + } + } + } + private bool m_scripts_enabled; public SynchronizeSceneHandler SynchronizeScene; @@ -299,8 +347,6 @@ namespace OpenSim.Region.Framework.Scenes private Dictionary m_returns = new Dictionary(); private Dictionary m_groupsWithTargets = new Dictionary(); - private bool m_physics_enabled = true; - private bool m_scripts_enabled = true; private string m_defaultScriptEngine; /// @@ -762,9 +808,11 @@ namespace OpenSim.Region.Framework.Scenes DumpAssetsToFile = dumpAssetsToFile; + // XXX: Don't set the public property since we don't want to activate here. This needs to be handled + // better in the future. m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts; - m_physics_enabled = !RegionInfo.RegionSettings.DisablePhysics; + PhysicsEnabled = !RegionInfo.RegionSettings.DisablePhysics; m_simulatorVersion = simulatorVersion + " (" + Util.GetRuntimeInformation() + ")"; @@ -948,6 +996,8 @@ namespace OpenSim.Region.Framework.Scenes { PhysicalPrims = true; CollidablePrims = true; + PhysicsEnabled = true; + PeriodicBackup = true; UseBackup = true; @@ -1192,91 +1242,6 @@ namespace OpenSim.Region.Framework.Scenes } } - public void SetSceneCoreDebug(Dictionary options) - { - if (options.ContainsKey("active")) - { - bool active; - - if (bool.TryParse(options["active"], out active)) - Active = active; - } - - if (options.ContainsKey("pbackup")) - { - bool active; - - if (bool.TryParse(options["pbackup"], out active)) - PeriodicBackup = active; - } - - if (options.ContainsKey("scripting")) - { - bool enableScripts = true; - if (bool.TryParse(options["scripting"], out enableScripts) && m_scripts_enabled != enableScripts) - { - if (!enableScripts) - { - m_log.Info("Stopping all Scripts in Scene"); - - EntityBase[] entities = Entities.GetEntities(); - foreach (EntityBase ent in entities) - { - if (ent is SceneObjectGroup) - ((SceneObjectGroup)ent).RemoveScriptInstances(false); - } - } - else - { - m_log.Info("Starting all Scripts in Scene"); - - EntityBase[] entities = Entities.GetEntities(); - foreach (EntityBase ent in entities) - { - if (ent is SceneObjectGroup) - { - SceneObjectGroup sog = (SceneObjectGroup)ent; - sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0); - sog.ResumeScripts(); - } - } - } - - m_scripts_enabled = enableScripts; - } - } - - if (options.ContainsKey("physics")) - { - bool enablePhysics; - if (bool.TryParse(options["physics"], out enablePhysics)) - m_physics_enabled = enablePhysics; - } - -// if (options.ContainsKey("collisions")) -// { -// // TODO: Implement. If false, should stop objects colliding, though possibly should still allow -// // the avatar themselves to collide with the ground. -// } - - if (options.ContainsKey("teleport")) - { - bool enableTeleportDebugging; - if (bool.TryParse(options["teleport"], out enableTeleportDebugging)) - DebugTeleporting = enableTeleportDebugging; - } - - if (options.ContainsKey("updates")) - { - bool enableUpdateDebugging; - if (bool.TryParse(options["updates"], out enableUpdateDebugging)) - { - DebugUpdates = enableUpdateDebugging; - GcNotify.Enabled = DebugUpdates; - } - } - } - public int GetInaccurateNeighborCount() { return m_neighbours.Count; @@ -1526,7 +1491,7 @@ namespace OpenSim.Region.Framework.Scenes } tmpMS = Util.EnvironmentTickCount(); - if ((Frame % m_update_physics == 0) && m_physics_enabled) + if (PhysicsEnabled && Frame % m_update_physics == 0) m_sceneGraph.UpdatePreparePhysics(); physicsMS2 = Util.EnvironmentTickCountSubtract(tmpMS); @@ -1541,7 +1506,7 @@ namespace OpenSim.Region.Framework.Scenes tmpMS = Util.EnvironmentTickCount(); if (Frame % m_update_physics == 0) { - if (m_physics_enabled) + if (PhysicsEnabled) physicsFPS = m_sceneGraph.UpdatePhysics(MinFrameTime); if (SynchronizeScene != null) -- cgit v1.1 From 05ac6d3209afb640926995d252e8513ef3003819 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 11 Jan 2013 01:46:36 +0000 Subject: Save attachments on detach/exit if a contained script state has been changed. This involves making Attachments module listen for start/stop script changes. It also involves removing the script from the region on detach in the same manner as every other DeleteSceneObject() call rather than simply stopping it This is necessary tue to the bad assymetry of start and stop script triggers but it appears to be the correct behaviour anyway, as detached objects are completely gone from the sim. Not just in a state where their scripts have been stopped. --- OpenSim/Region/Framework/Scenes/EventManager.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 6b08e0f..902ded1 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -339,6 +339,8 @@ namespace OpenSim.Region.Framework.Scenes /// in /// via , /// via + /// XXX: This is only triggered when it is the client that starts the script, not in other situations where + /// a script is started, unlike OnStopScript! /// public event StartScript OnStartScript; @@ -352,6 +354,7 @@ namespace OpenSim.Region.Framework.Scenes /// in , /// , /// + /// XXX: This is triggered when a sciprt is stopped for any reason, unlike OnStartScript! /// public event StopScript OnStopScript; -- cgit v1.1 From daacd4deed9630b67738b342078f0b334e74aa4b Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 9 Jan 2013 17:40:22 -0800 Subject: Fix exception reporting in SceneObjectPart so it logs what the exception is rather than just saying it happened. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 232861e..44e8fdf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4050,9 +4050,9 @@ namespace OpenSim.Region.Framework.Scenes rigidBody, m_localId); } - catch + catch (Exception e) { - m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom.", m_uuid); + m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom. e={1}", m_uuid, e); pa = null; } -- cgit v1.1 From 055b8a2d58a17d5dbc6cdb7f22077e6268578905 Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 14 Jan 2013 22:24:24 -0800 Subject: move resit fix to ScenePresence.cs and allow for requesting sit on objects other than the object currently sat on --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 0219540..6979c33 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1954,6 +1954,10 @@ namespace OpenSim.Region.Framework.Scenes { if (ParentID != 0) { + var targetPart = m_scene.GetSceneObjectPart(targetID); + if (targetPart != null && targetPart.LocalId == ParentID) + return; // already sitting here, ignore + StandUp(); } -- cgit v1.1 From 1b5c41c14ad11325be249ea1cce3c65d4d6a89be Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 16 Jan 2013 00:12:40 +0000 Subject: Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.) This makes use of EventWaitHandles since various web references indicate that Thread.Interrupt() can also cause runtime instability. If co-op termination is enabled, then termination sets the wait handle instead of waiting for a timeout before possibly aborting the thread. This allows the script to cleanly terminate if it's in a llSleep/LL function delay or the next time it enters such a wait without any timeout period. Co-op termination is not yet testable since checking for termination request within loops that never trigger a wait is not yet implemented. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 5c8b097..92bf85a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1738,6 +1738,21 @@ namespace OpenSim.Region.Framework.Scenes /// The part where the script was rezzed if successful. False otherwise. public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase) { + return RezNewScript( + agentID, + itemBase, + "default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"); + } + + /// + /// Rez a new script from nothing with given script text. + /// + /// + /// Template item. + /// + /// The part where the script was rezzed if successful. False otherwise. + public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase, string scriptText) + { // The part ID is the folder ID! SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); if (part == null) @@ -1757,9 +1772,14 @@ namespace OpenSim.Region.Framework.Scenes return null; } - AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, - Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"), - agentID); + AssetBase asset + = CreateAsset( + itemBase.Name, + itemBase.Description, + (sbyte)itemBase.AssetType, + Encoding.ASCII.GetBytes(scriptText), + agentID); + AssetService.Store(asset); TaskInventoryItem taskItem = new TaskInventoryItem(); -- cgit v1.1 From b8949024bc55c62b9268b35d4f2a568760b9d7d3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 16 Jan 2013 01:45:09 +0000 Subject: Revert "Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.)" Doing this as a favour to Melanie. This will be back with passing the wait handles directly to the api. This reverts commit 1b5c41c14ad11325be249ea1cce3c65d4d6a89be. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 26 +++------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 92bf85a..5c8b097 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1738,21 +1738,6 @@ namespace OpenSim.Region.Framework.Scenes /// The part where the script was rezzed if successful. False otherwise. public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase) { - return RezNewScript( - agentID, - itemBase, - "default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"); - } - - /// - /// Rez a new script from nothing with given script text. - /// - /// - /// Template item. - /// - /// The part where the script was rezzed if successful. False otherwise. - public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase, string scriptText) - { // The part ID is the folder ID! SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); if (part == null) @@ -1772,14 +1757,9 @@ namespace OpenSim.Region.Framework.Scenes return null; } - AssetBase asset - = CreateAsset( - itemBase.Name, - itemBase.Description, - (sbyte)itemBase.AssetType, - Encoding.ASCII.GetBytes(scriptText), - agentID); - + AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, + Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"), + agentID); AssetService.Store(asset); TaskInventoryItem taskItem = new TaskInventoryItem(); -- cgit v1.1 From 0963ece25bdef16852f5fd8ae4515a2f05d8b6e4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 16 Jan 2013 02:07:43 +0000 Subject: Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.) This makes use of EventWaitHandles since various web references indicate that Thread.Interrupt() can also cause runtime instability. If co-op termination is enabled, then termination sets the wait handle instead of waiting for a timeout before possibly aborting the thread. This allows the script to cleanly terminate if it's in a llSleep/LL function delay or the next time it enters such a wait without any timeout period. Co-op termination is not yet testable since checking for termination request within loops that never trigger a wait is not yet implemented. This commit, unlike 1b5c41c, passes the wait handle as an extra parameter through IScript.Initialize() instead of passing IScriptInstance itself. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 5c8b097..92bf85a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1738,6 +1738,21 @@ namespace OpenSim.Region.Framework.Scenes /// The part where the script was rezzed if successful. False otherwise. public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase) { + return RezNewScript( + agentID, + itemBase, + "default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"); + } + + /// + /// Rez a new script from nothing with given script text. + /// + /// + /// Template item. + /// + /// The part where the script was rezzed if successful. False otherwise. + public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase, string scriptText) + { // The part ID is the folder ID! SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); if (part == null) @@ -1757,9 +1772,14 @@ namespace OpenSim.Region.Framework.Scenes return null; } - AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, - Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"), - agentID); + AssetBase asset + = CreateAsset( + itemBase.Name, + itemBase.Description, + (sbyte)itemBase.AssetType, + Encoding.ASCII.GetBytes(scriptText), + agentID); + AssetService.Store(asset); TaskInventoryItem taskItem = new TaskInventoryItem(); -- cgit v1.1 From 818254916cb562422b3a3301b9f35fafd64ee3fe Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 16 Jan 2013 15:47:55 +0000 Subject: JustinCC's core re-merge --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 65c50bf..9f0a0e2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1783,6 +1783,21 @@ namespace OpenSim.Region.Framework.Scenes /// The part where the script was rezzed if successful. False otherwise. public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase) { + return RezNewScript( + agentID, + itemBase, + "default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"); + } + + /// + /// Rez a new script from nothing with given script text. + /// + /// + /// Template item. + /// + /// The part where the script was rezzed if successful. False otherwise. + public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase, string scriptText) + { // The part ID is the folder ID! SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); if (part == null) @@ -1802,9 +1817,14 @@ namespace OpenSim.Region.Framework.Scenes return null; } - AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, - Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n\n touch_start(integer num)\n {\n }\n}"), - agentID); + AssetBase asset + = CreateAsset( + itemBase.Name, + itemBase.Description, + (sbyte)itemBase.AssetType, + Encoding.ASCII.GetBytes(scriptText), + agentID); + AssetService.Store(asset); TaskInventoryItem taskItem = new TaskInventoryItem(); -- cgit v1.1 From 74256c0cc47870f6057b64ce117479af79f02ab0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Jan 2013 22:57:09 +0000 Subject: Restore previous client AO behaviour by not allowing them to remove the default animation but continue to allow scripts to do so. This keeps the fix from http://opensimulator.org/mantis/view.php?id=6327 and fixes the behaviour regression in http://opensimulator.org/mantis/view.php?id=6483 Animations may still exhibit different behaviour if both scripts and clients are adjusting animations. A change in the behaviour of client AO to not remove all animations may be a better long term approach. --- OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | 15 +++++++++++++-- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 14 +++++++++++--- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 65ae445..66edfed 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -87,13 +87,24 @@ namespace OpenSim.Region.Framework.Scenes.Animation return false; } - public bool Remove(UUID animID) + /// + /// Remove the specified animation + /// + /// + /// + /// If true, then the default animation can be entirely removed. + /// If false, then removing the default animation will reset it to the simulator default (currently STAND). + /// + public bool Remove(UUID animID, bool allowNoDefault) { lock (m_animations) { if (m_defaultAnimation.AnimID == animID) { - m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero); + if (allowNoDefault) + m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero); + else + ResetDefaultAnimation(); } else if (HasAnimation(animID)) { diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 5b16b67..3657dc4 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -109,14 +109,22 @@ namespace OpenSim.Region.Framework.Scenes.Animation AddAnimation(animID, objectID); } - public void RemoveAnimation(UUID animID) + /// + /// Remove the specified animation + /// + /// + /// + /// If true, then the default animation can be entirely removed. + /// If false, then removing the default animation will reset it to the simulator default (currently STAND). + /// + public void RemoveAnimation(UUID animID, bool allowNoDefault) { if (m_scenePresence.IsChildAgent) return; // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name); - if (m_animations.Remove(animID)) + if (m_animations.Remove(animID, allowNoDefault)) SendAnimPack(); } @@ -132,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (animID == UUID.Zero) return; - RemoveAnimation(animID); + RemoveAnimation(animID, true); } public void ResetAnimations() diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6979c33..c295305 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2260,7 +2260,7 @@ namespace OpenSim.Region.Framework.Scenes public void HandleStopAnim(IClientAPI remoteClient, UUID animID) { - Animator.RemoveAnimation(animID); + Animator.RemoveAnimation(animID, false); } /// -- cgit v1.1 From 115e1c2abb7755eb7b5ffeafbc0aecd255ccfc4e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Jan 2013 23:22:02 +0000 Subject: Add "debug set set animations true|false" region console command. Setting this logs extra information about animation add/remove, such as uuid and animation name Unfortunately cannot be done per client yet --- .../Scenes/Animation/ScenePresenceAnimator.cs | 33 ++++++++++++++++++---- OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++++ 2 files changed, 33 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 3657dc4..e92a087 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -86,7 +86,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_scenePresence.IsChildAgent) return; -// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name); + if (m_scenePresence.Scene.DebugAnimations) + m_log.DebugFormat( + "[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}", + GetAnimName(animID), animID, m_scenePresence.Name); if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) SendAnimPack(); @@ -122,7 +125,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_scenePresence.IsChildAgent) return; -// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name); + if (m_scenePresence.Scene.DebugAnimations) + m_log.DebugFormat( + "[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}", + GetAnimName(animID), animID, m_scenePresence.Name); if (m_animations.Remove(animID, allowNoDefault)) SendAnimPack(); @@ -145,9 +151,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation public void ResetAnimations() { -// m_log.DebugFormat( -// "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", -// m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); + if (m_scenePresence.Scene.DebugAnimations) + m_log.DebugFormat( + "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", + m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); m_animations.Clear(); } @@ -558,5 +565,21 @@ namespace OpenSim.Region.Framework.Scenes.Animation SendAnimPack(animIDs, sequenceNums, objectIDs); } + + public string GetAnimName(UUID animId) + { + string animName; + + if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName)) + { + AssetMetadata amd = m_scenePresence.Scene.AssetService.GetMetadata(animId.ToString()); + if (amd != null) + animName = amd.Name; + else + animName = "Unknown"; + } + + return animName; + } } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4859dff..5778176 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -68,6 +68,11 @@ namespace OpenSim.Region.Framework.Scenes public bool EmergencyMonitoring = false; /// + /// Show debug information about animations. + /// + public bool DebugAnimations { get; set; } + + /// /// Show debug information about teleports. /// public bool DebugTeleporting { get; set; } -- cgit v1.1 From fc6115f77755734d5a60b9eeebef25b98696f4e4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Jan 2013 02:29:02 +0000 Subject: Check the existing ScenePresence.ParentPart to make sure we're not trying to sit on a prim we're already sat upon, rather than looking up the part from scratch. An adaptation of commit 055b8a2 Having both ParentID and ParentPart references now is redundant. ParentID should probably be eliminated. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c295305..a90872e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1954,8 +1954,7 @@ namespace OpenSim.Region.Framework.Scenes { if (ParentID != 0) { - var targetPart = m_scene.GetSceneObjectPart(targetID); - if (targetPart != null && targetPart.LocalId == ParentID) + if (ParentPart.UUID == targetID) return; // already sitting here, ignore StandUp(); -- cgit v1.1 From 95c53ecae708c8f915e02c4f872c931efdd6c29a Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 21 Jan 2013 15:55:54 -0800 Subject: Have SOP and LSL_Api call the proper GetCenterOfMass and GetGeometricCenter routines on the physics engine. Won't make a difference for any existing scripts since ODE always returned Vector3.Zero. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 44e8fdf..e0ea344 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1952,6 +1952,16 @@ namespace OpenSim.Region.Framework.Scenes PhysicsActor pa = PhysActor; if (pa != null) + return new Vector3(pa.GeometricCenter.X, pa.GeometricCenter.Y, pa.GeometricCenter.Z); + else + return new Vector3(0, 0, 0); + } + + public Vector3 GetCenterOfMass() + { + PhysicsActor pa = PhysActor; + + if (pa != null) return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z); else return new Vector3(0, 0, 0); -- cgit v1.1 From c1795ed399c187ba739bc271c6837e26b9bfdf3d Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 23 Jan 2013 21:03:24 +0000 Subject: Add the Avination physics raycast glue so Core Physics can implement raycast --- OpenSim/Region/Framework/Scenes/Scene.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5778176..f2cb117 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1983,6 +1983,19 @@ namespace OpenSim.Region.Framework.Scenes EventManager.TriggerPrimsLoaded(this); } + public bool SupportsRayCastFiltered() + { + if (PhysicsScene == null) + return false; + return PhysicsScene.SupportsRaycastWorldFiltered(); + } + + public object RayCastFiltered(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter) + { + if (PhysicsScene == null) + return null; + return PhysicsScene.RaycastWorld(position, direction, length, Count,filter); + } /// /// Gets a new rez location based on the raycast and the size of the object that is being rezzed. -- cgit v1.1 From 878df52515ea3519130ba646a050c8d8c1f09b29 Mon Sep 17 00:00:00 2001 From: teravus Date: Wed, 23 Jan 2013 21:58:51 -0500 Subject: * This makes the non-physics llCastRay 'better'. It's not 'correctly working', and if you look deep enough, you see that the results are not really stable depending on the direction of the ray. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index e0ea344..6720635 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3628,6 +3628,7 @@ namespace OpenSim.Region.Framework.Scenes result.distance = distance2; result.HitTF = true; result.ipoint = q; + result.face = i; //m_log.Info("[FACE]:" + i.ToString()); //m_log.Info("[POINT]: " + q.ToString()); //m_log.Info("[DIST]: " + distance2.ToString()); -- cgit v1.1 From 1bd0b06ec1a0a5a7d6302d8017edcea7faf557e0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Aug 2010 20:38:20 +0100 Subject: Implement Dynamic Attributes for SOP and PBS. Implement storage in SQLite --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6720635..2a9b99e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -37,6 +37,7 @@ using System.Xml.Serialization; using log4net; using OpenMetaverse; using OpenMetaverse.Packets; +using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; @@ -124,6 +125,11 @@ namespace OpenSim.Region.Framework.Scenes private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// + /// Dynamic attributes can be created and deleted as required. + /// + public DynAttrsOSDMap DynAttrs { get; set; } + /// /// Is this a root part? /// @@ -335,6 +341,7 @@ namespace OpenSim.Region.Framework.Scenes m_particleSystem = Utils.EmptyBytes; Rezzed = DateTime.UtcNow; Description = String.Empty; + DynAttrs = new DynAttrsOSDMap(); // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from @@ -4598,4 +4605,4 @@ namespace OpenSim.Region.Framework.Scenes } } } -} \ No newline at end of file +} -- cgit v1.1 From a6d9c263650cc23d60f941718f87a64aa2f360b2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Aug 2010 22:21:46 +0100 Subject: Encapsulate an OSDMap in DAMap (was DynAttrsOSDMap) rather than inheriting from it This is the easier way to give us control over locking, rather than asking that OSDMap IDictionary methods be virtual --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 2a9b99e..27f3a4d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -128,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Dynamic attributes can be created and deleted as required. /// - public DynAttrsOSDMap DynAttrs { get; set; } + public DAMap DynAttrs { get; set; } /// /// Is this a root part? @@ -341,7 +341,7 @@ namespace OpenSim.Region.Framework.Scenes m_particleSystem = Utils.EmptyBytes; Rezzed = DateTime.UtcNow; Description = String.Empty; - DynAttrs = new DynAttrsOSDMap(); + DynAttrs = new DAMap(); // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from -- cgit v1.1 From af6a7cf95df76708d013932d8ef92c9bbeda0e5d Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 22 Jan 2013 11:59:20 +0200 Subject: Added DynAttrs to the serialized XML format of prims. When copying prims, use deep copy for DynAttrs. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 ++ .../Scenes/Serialization/SceneObjectSerializer.cs | 14 ++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 27f3a4d..189d298 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1625,6 +1625,8 @@ namespace OpenSim.Region.Framework.Scenes Array.Copy(Shape.ExtraParams, extraP, extraP.Length); dupe.Shape.ExtraParams = extraP; + dupe.DynAttrs.CopyFrom(DynAttrs); + if (userExposed) { /* diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 2d4c60a..4a2a47e 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -359,6 +359,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); + m_SOPXmlProcessors.Add("DynAttrs", ProcessDynAttrs); m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0); @@ -722,6 +723,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); } + private static void ProcessDynAttrs(SceneObjectPart obj, XmlTextReader reader) + { + obj.DynAttrs.ReadXml(reader); + } + private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) { obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); @@ -1235,6 +1241,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); if (sop.MediaUrl != null) writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); + + if (sop.DynAttrs.Count > 0) + { + writer.WriteStartElement("DynAttrs"); + sop.DynAttrs.WriteXml(writer); + writer.WriteEndElement(); + } + WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString()); -- cgit v1.1 From 53833babf99d83a27d0be2b820efbe41067ef723 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 26 Jan 2013 03:57:51 +0000 Subject: Add OnScriptMovingStartEvent and OnScriptMovingEndEvent to EventManager so that these can be triggered by future code (not yet implemented). Also hooks up moving_start and moving_end script events, eliminating itemID on XEngine EventManager methods since this is completely unused. An adaptation of the patch in http://opensimulator.org/mantis/view.php?id=6515 Thanks Garmin Kawaguichi and Signpost Marv. --- OpenSim/Region/Framework/Scenes/EventManager.cs | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 902ded1..9ee1520 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -549,6 +549,20 @@ namespace OpenSim.Region.Framework.Scenes /// public event ScriptControlEvent OnScriptControlEvent; + public delegate void ScriptMovingStartEvent(uint localID); + + /// + /// TODO: Should be triggered when a physics object starts moving. + /// + public event ScriptMovingStartEvent OnScriptMovingStartEvent; + + public delegate void ScriptMovingEndEvent(uint localID); + + /// + /// TODO: Should be triggered when a physics object stops moving. + /// + public event ScriptMovingEndEvent OnScriptMovingEndEvent; + public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); /// @@ -2212,6 +2226,48 @@ namespace OpenSim.Region.Framework.Scenes } } + public void TriggerMovingStartEvent(uint localID) + { + ScriptMovingStartEvent handlerScriptMovingStartEvent = OnScriptMovingStartEvent; + if (handlerScriptMovingStartEvent != null) + { + foreach (ScriptMovingStartEvent d in handlerScriptMovingStartEvent.GetInvocationList()) + { + try + { + d(localID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerMovingStartEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + + public void TriggerMovingEndEvent(uint localID) + { + ScriptMovingEndEvent handlerScriptMovingEndEvent = OnScriptMovingEndEvent; + if (handlerScriptMovingEndEvent != null) + { + foreach (ScriptMovingEndEvent d in handlerScriptMovingEndEvent.GetInvocationList()) + { + try + { + d(localID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerMovingEndEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + public void TriggerRequestChangeWaterHeight(float height) { if (height < 0) -- cgit v1.1 From 776cc33541d5b0576f28c02953be728ab3154e22 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 27 Jan 2013 01:07:37 +0000 Subject: Prevent items being destroyed by rename operations. Renaming of a wearable also sends an asset transaciton but it is empty. So we can't ignore name data when a transaction is present and can't treat every transaction as valid. Conflicts: OpenSim/Region/Framework/Scenes/Scene.Inventory.cs --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 92bf85a..6808017 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -407,16 +407,16 @@ namespace OpenSim.Region.Framework.Scenes if (item.Owner != remoteClient.AgentId) return; - if (UUID.Zero == transactionID) - { - item.Name = itemUpd.Name; - item.Description = itemUpd.Description; + item.Name = itemUpd.Name; + item.Description = itemUpd.Description; // m_log.DebugFormat( // "[USER INVENTORY]: itemUpd {0} {1} {2} {3}, item {4} {5} {6} {7}", // itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags, // item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions); + if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid + { if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions)) item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; @@ -451,7 +451,8 @@ namespace OpenSim.Region.Framework.Scenes InventoryService.UpdateItem(item); } - else + + if (UUID.Zero != transactionID) { if (AgentTransactionsModule != null) { -- cgit v1.1 From 7c4e0ff03c5ba9331feb777247594e94fc0f7ac1 Mon Sep 17 00:00:00 2001 From: teravus Date: Wed, 30 Jan 2013 06:22:05 -0500 Subject: * Adds a satisfying angular roll when an avatar is flying and turning. (General, not physics). Makes flying not feel as stiff. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 81 ++++++++++++++++++++++++ 1 file changed, 81 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a90872e..1d22560 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -200,6 +200,11 @@ namespace OpenSim.Region.Framework.Scenes private const int LAND_VELOCITYMAG_MAX = 12; + private const float FLY_ROLL_MAX_RADIANS = 1.1f; + + private const float FLY_ROLL_RADIANS_PER_SECOND = 0.06f; + private const float FLY_ROLL_RESET_RADIANS_PER_SECOND = 0.02f; + private float m_health = 100f; protected ulong crossingFromRegion; @@ -568,6 +573,14 @@ namespace OpenSim.Region.Framework.Scenes } } + // Used for limited viewer 'fake' user rotations. + private Vector3 m_AngularVelocity = Vector3.Zero; + + public Vector3 AngularVelocity + { + get { return m_AngularVelocity; } + } + public bool IsChildAgent { get; set; } /// @@ -690,6 +703,8 @@ namespace OpenSim.Region.Framework.Scenes #endregion + + #region Constructor(s) public ScenePresence( @@ -1033,6 +1048,49 @@ namespace OpenSim.Region.Framework.Scenes ControllingClient.StopFlying(this); } + /// + /// Applies a roll accumulator to the avatar's angular velocity for the avatar fly roll effect. + /// + /// Postive or negative roll amount in radians + private void ApplyFlyingRoll(float amount) + { + float noise = ((float)(Util.RandomClass.NextDouble()*0.2f)-0.1f); + float rollAmount = Util.Clamp(m_AngularVelocity.Z + amount, -FLY_ROLL_MAX_RADIANS, FLY_ROLL_MAX_RADIANS) + noise; + m_AngularVelocity.Z = rollAmount; + } + + /// + /// incrementally sets roll amount to zero + /// + /// Positive roll amount in radians + /// + private float CalculateFlyingRollResetToZero(float amount) + { + const float rollMinRadians = 0f; + + if (m_AngularVelocity.Z > 0) + { + + float leftOverToMin = m_AngularVelocity.Z - rollMinRadians; + if (amount > leftOverToMin) + return -leftOverToMin; + else + return -amount; + + } + else + { + + float leftOverToMin = -m_AngularVelocity.Z - rollMinRadians; + if (amount > leftOverToMin) + return leftOverToMin; + else + return amount; + } + } + + + // neighbouring regions we have enabled a child agent in // holds the seed cap for the child agent in that region private Dictionary m_knownChildRegions = new Dictionary(); @@ -1513,6 +1571,29 @@ namespace OpenSim.Region.Framework.Scenes bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0)); + + + // Applies a satisfying roll effect to the avatar when flying. + if (((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) != 0) && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0)) + { + ApplyFlyingRoll(FLY_ROLL_RADIANS_PER_SECOND); + + } + else if (((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) != 0) && + ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0)) + { + ApplyFlyingRoll(-FLY_ROLL_RADIANS_PER_SECOND); + + } + else + { + if (m_AngularVelocity.Z != 0) + m_AngularVelocity.Z += CalculateFlyingRollResetToZero(FLY_ROLL_RESET_RADIANS_PER_SECOND); + + } + + + if (Flying && IsColliding && controlland) { // nesting this check because LengthSquared() is expensive and we don't -- cgit v1.1 From 52ea6eadaed5e5d2d43807999e6bb805c60056fd Mon Sep 17 00:00:00 2001 From: teravus Date: Wed, 30 Jan 2013 07:34:48 -0500 Subject: * This adds a bit more to the previous flying roll effect by adding additional roll when pressing page down, and reducing your roll when pressing page up to make it feel more responsive and give the user more visual feedback. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 60 ++++++++++++++++++++---- 1 file changed, 50 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1d22560..e0dfb34 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -202,8 +202,8 @@ namespace OpenSim.Region.Framework.Scenes private const float FLY_ROLL_MAX_RADIANS = 1.1f; - private const float FLY_ROLL_RADIANS_PER_SECOND = 0.06f; - private const float FLY_ROLL_RESET_RADIANS_PER_SECOND = 0.02f; + private const float FLY_ROLL_RADIANS_PER_UPDATE = 0.06f; + private const float FLY_ROLL_RESET_RADIANS_PER_UPDATE = 0.02f; private float m_health = 100f; @@ -1052,11 +1052,47 @@ namespace OpenSim.Region.Framework.Scenes /// Applies a roll accumulator to the avatar's angular velocity for the avatar fly roll effect. /// /// Postive or negative roll amount in radians - private void ApplyFlyingRoll(float amount) + private void ApplyFlyingRoll(float amount, bool PressingUp, bool PressingDown) { - float noise = ((float)(Util.RandomClass.NextDouble()*0.2f)-0.1f); - float rollAmount = Util.Clamp(m_AngularVelocity.Z + amount, -FLY_ROLL_MAX_RADIANS, FLY_ROLL_MAX_RADIANS) + noise; + + float rollAmount = Util.Clamp(m_AngularVelocity.Z + amount, -FLY_ROLL_MAX_RADIANS, FLY_ROLL_MAX_RADIANS); m_AngularVelocity.Z = rollAmount; + + // APPLY EXTRA consideration for flying up and flying down during this time. + // if we're turning left + if (amount > 0) + { + + // If we're at the max roll and pressing up, we want to swing BACK a bit + // Automatically adds noise + if (PressingUp) + { + if (m_AngularVelocity.Z >= FLY_ROLL_MAX_RADIANS - 0.04f) + m_AngularVelocity.Z -= 0.9f; + } + // If we're at the max roll and pressing down, we want to swing MORE a bit + if (PressingDown) + { + if (m_AngularVelocity.Z >= FLY_ROLL_MAX_RADIANS && m_AngularVelocity.Z < FLY_ROLL_MAX_RADIANS + 0.6f) + m_AngularVelocity.Z += 0.6f; + } + } + else // we're turning right. + { + // If we're at the max roll and pressing up, we want to swing BACK a bit + // Automatically adds noise + if (PressingUp) + { + if (m_AngularVelocity.Z <= (-FLY_ROLL_MAX_RADIANS)) + m_AngularVelocity.Z += 0.6f; + } + // If we're at the max roll and pressing down, we want to swing MORE a bit + if (PressingDown) + { + if (m_AngularVelocity.Z >= -FLY_ROLL_MAX_RADIANS - 0.6f) + m_AngularVelocity.Z -= 0.6f; + } + } } /// @@ -1572,26 +1608,30 @@ namespace OpenSim.Region.Framework.Scenes ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0)); - + //m_log.Debug("[CONTROL]: " +flags); // Applies a satisfying roll effect to the avatar when flying. if (((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) != 0) && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0)) { - ApplyFlyingRoll(FLY_ROLL_RADIANS_PER_SECOND); + + ApplyFlyingRoll(FLY_ROLL_RADIANS_PER_UPDATE, ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0), ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0)); + } else if (((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) != 0) && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0)) { - ApplyFlyingRoll(-FLY_ROLL_RADIANS_PER_SECOND); + ApplyFlyingRoll(-FLY_ROLL_RADIANS_PER_UPDATE, ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0), ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0)); + } else { if (m_AngularVelocity.Z != 0) - m_AngularVelocity.Z += CalculateFlyingRollResetToZero(FLY_ROLL_RESET_RADIANS_PER_SECOND); + m_AngularVelocity.Z += CalculateFlyingRollResetToZero(FLY_ROLL_RESET_RADIANS_PER_UPDATE); } - + + if (Flying && IsColliding && controlland) -- cgit v1.1 From a0ef3df1941147cfc894493950e4d204f6b34216 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 30 Jan 2013 14:45:03 -0800 Subject: Add JsonTestStore to determine if a JsonStore is associated with a particular UUID. --- OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index da39e95..0bb4567 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs @@ -37,6 +37,7 @@ namespace OpenSim.Region.Framework.Interfaces { bool CreateStore(string value, ref UUID result); bool DestroyStore(UUID storeID); + bool TestStore(UUID storeID); bool TestPath(UUID storeID, string path, bool useJson); bool SetValue(UUID storeID, string path, string value, bool useJson); bool RemoveValue(UUID storeID, string path); -- cgit v1.1 From fac72d540b029ba72195dca69c56034167835d60 Mon Sep 17 00:00:00 2001 From: Jak Daniels Date: Wed, 30 Jan 2013 21:43:35 +0000 Subject: Allow use of MaptileStaticUUID in Regions.ini to override the global setting in OpenSim.ini for each region. Signed-off-by: BlueWall --- OpenSim/Region/Framework/Scenes/Scene.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f2cb117..9e3d60f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -917,10 +917,15 @@ namespace OpenSim.Region.Framework.Scenes string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); UUID tileID; - if (UUID.TryParse(tile, out tileID)) + if ((tile!=UUID.Zero.ToString()) && UUID.TryParse(tile, out tileID)) { RegionInfo.RegionSettings.TerrainImageID = tileID; } + else + { + RegionInfo.RegionSettings.TerrainImageID = RegionInfo.MaptileStaticUUID; + m_log.InfoFormat("[SCENE]: Region {0}, maptile set to {1}", RegionInfo.RegionName, RegionInfo.MaptileStaticUUID.ToString()); + } } string grant = startupConfig.GetString("AllowedClients", String.Empty); -- cgit v1.1 From 6a4c8824ea6568290fe7a2ff1b6a9b4d96896d5f Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 31 Jan 2013 20:46:41 +0000 Subject: Whitespace fix and removing unneccessary parentheses --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9e3d60f..f8d84e3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -917,7 +917,7 @@ namespace OpenSim.Region.Framework.Scenes string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); UUID tileID; - if ((tile!=UUID.Zero.ToString()) && UUID.TryParse(tile, out tileID)) + if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out tileID)) { RegionInfo.RegionSettings.TerrainImageID = tileID; } -- cgit v1.1 From d8d4e7f236346d8dd7d66dbc187bb5362c00f039 Mon Sep 17 00:00:00 2001 From: teravus Date: Fri, 1 Feb 2013 15:42:24 -0500 Subject: Sit and Spin reduction. If sitting, slam avatar angular velocity to zero. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e0dfb34..6e41774 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2342,7 +2342,7 @@ namespace OpenSim.Region.Framework.Scenes ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); ParentID = m_requestedSitTargetID; - + m_AngularVelocity = Vector3.Zero; Velocity = Vector3.Zero; RemoveFromPhysicalScene(); @@ -2358,7 +2358,8 @@ namespace OpenSim.Region.Framework.Scenes public void HandleAgentSitOnGround() { -// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. +// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.. + m_AngularVelocity = Vector3.Zero; Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); SitGround = true; RemoveFromPhysicalScene(); -- cgit v1.1 From 9822bb664b58693790201606126e3fd26f7a4d52 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 2 Feb 2013 02:57:38 +0000 Subject: Log missing assets on "fcache assets" found. This ignores references found by scanning LSL/notecard files since these are the source of false positives. This also changes UuidGatherer to reutn an AssetType.Unknown for embedded script/lsl references instead of Texture, since these are often not textures. This is added to help people in determining when they have missing assets such as textures, etc. In this case, one wants to run "fcache clear" first. --- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index e238d01..c7cec41 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -131,7 +131,10 @@ namespace OpenSim.Region.Framework.Scenes /// within this object). /// /// The scene object for which to gather assets - /// The assets gathered + /// + /// A dictionary which is populated with the asset UUIDs gathered and the type of that asset. + /// For assets where the type is not clear (e.g. UUIDs extracted from LSL and notecards), the type is Unknown. + /// public void GatherAssetUuids(SceneObjectGroup sceneObject, IDictionary assetUuids) { // m_log.DebugFormat( @@ -262,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid); // Assume AssetIDs embedded are textures. - assetUuids[uuid] = AssetType.Texture; + assetUuids[uuid] = AssetType.Unknown; } } } -- cgit v1.1 From 0d0bfa4dcd2fe61a489abc39e53755762d759490 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 2 Feb 2013 03:02:04 +0000 Subject: minor: change comment about assuming script references are textures in UuidGatherer since this is no longer the behaviour. --- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index c7cec41..ad33607 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -264,7 +264,8 @@ namespace OpenSim.Region.Framework.Scenes UUID uuid = new UUID(uuidMatch.Value); // m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid); - // Assume AssetIDs embedded are textures. + // Embedded asset references (if not false positives) could be for many types of asset, so we will + // label these as unknown. assetUuids[uuid] = AssetType.Unknown; } } -- cgit v1.1 From 1f1da230976451d30d920c237d53c699ba96b9d9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 5 Feb 2013 00:23:17 +0000 Subject: Bump version and assembly version numbers from 0.7.5 to 0.7.6 This is mostly Bluewall's work but I am also bumping the general version number OpenSimulator 0.7.5 remains in the release candidate stage. I'm doing this because master is significantly adding things that will not be in 0.7.5 This update should not cause issues with existing external binary DLLs because our DLLs do not have strong names and so the exact version match requirement is not in force. --- OpenSim/Region/Framework/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Properties/AssemblyInfo.cs b/OpenSim/Region/Framework/Properties/AssemblyInfo.cs index 9b504c0..2a5828e 100644 --- a/OpenSim/Region/Framework/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Framework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("0.7.5.*")] +[assembly: AssemblyVersion("0.7.6.*")] [assembly: AssemblyFileVersion("1.0.0.0")] -- cgit v1.1 From 5c94346bd7fd218ede591182b045aeb4a57b108e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Feb 2013 01:17:19 +0000 Subject: refactor: Move functions that lookup asset ids from task inventory or pass them through to ScriptUtils class in OpenSim.Region.Framework.dll Renames functions to better reflect what they do. This is so that code registering with modInvoke() can reuse this code to provide functions that behave in a consistent manner with existing LSL/OSSL functions. --- .../Framework/Scenes/Scripting/ScriptUtils.cs | 122 +++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs new file mode 100644 index 0000000..d8aa258 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs @@ -0,0 +1,122 @@ +/* + * 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 OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Region.Framework.Scenes.Scripting +{ + /// + /// Utility functions for use by scripts manipulating the scene. + /// + public static class ScriptUtils + { + /// + /// Get an asset id given an item name and an item type. + /// + /// UUID.Zero if the name and type did not match any item. + /// + /// + /// + public static UUID GetAssetIdFromItemName(SceneObjectPart part, string name, int type) + { + TaskInventoryItem item = part.Inventory.GetInventoryItem(name); + + if (item != null && item.Type == type) + return item.AssetID; + else + return UUID.Zero; + } + + /// + /// accepts a valid UUID, -or- a name of an inventory item. + /// Returns a valid UUID or UUID.Zero if key invalid and item not found + /// in prim inventory. + /// + /// Scene object part to search for inventory item + /// + /// + public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier) + { + UUID key; + + // if we can parse the string as a key, use it. + // else try to locate the name in inventory of object. found returns key, + // not found returns UUID.Zero + if (!UUID.TryParse(identifier, out key)) + { + TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier); + + if (item != null) + key = item.AssetID; + else + key = UUID.Zero; + } + + return key; + } + + + /// + /// Return the UUID of the asset matching the specified key or name + /// and asset type. + /// + /// Scene object part to search for inventory item + /// + /// + /// + public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier, AssetType type) + { + UUID key; + + if (!UUID.TryParse(identifier, out key)) + { + TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier); + if (item != null && item.Type == (int)type) + key = item.AssetID; + } + else + { + lock (part.TaskInventory) + { + foreach (KeyValuePair item in part.TaskInventory) + { + if (item.Value.Type == (int)type && item.Value.Name == identifier) + { + key = item.Value.ItemID; + break; + } + } + } + } + + return key; + } + } +} \ No newline at end of file -- cgit v1.1 From dfe5826f9fd8854ddb5f0cc465564d8f124d7786 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Feb 2013 01:44:37 +0000 Subject: Remove wrong code in ScriptUtils.GetAssetIdFromKeyOrItemName which would return the item ID instead of the asset ID if the identifier was a uuid that matched an inventory item name. This would practically never happen. This makes this overloaded version of the function consistent with the other version. It looks like this accidentally came over in commit c5af16a from Tue Oct 16 12:40:21 2012 However, there's arguably a case for looking for an item name that matches a UUID before assuming that the identifier is already an asset ID. --- OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs index d8aa258..f08ba59 100644 --- a/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs +++ b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs @@ -82,7 +82,6 @@ namespace OpenSim.Region.Framework.Scenes.Scripting return key; } - /// /// Return the UUID of the asset matching the specified key or name /// and asset type. @@ -101,20 +100,6 @@ namespace OpenSim.Region.Framework.Scenes.Scripting if (item != null && item.Type == (int)type) key = item.AssetID; } - else - { - lock (part.TaskInventory) - { - foreach (KeyValuePair item in part.TaskInventory) - { - if (item.Value.Type == (int)type && item.Value.Name == identifier) - { - key = item.Value.ItemID; - break; - } - } - } - } return key; } -- cgit v1.1 From 9ebad38c34315302d6ed26356fc4da5c0465e3cb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Feb 2013 02:08:44 +0000 Subject: Remove unused ScriptEngineLoader and ScriptEngineInterface in OpenSim.Region.Framework.dll I believe this predates the generic system of registering interfaces and is very long unused. --- OpenSim/Region/Framework/Scenes/Scene.cs | 11 -- .../Scenes/Scripting/ScriptEngineInterface.cs | 38 ------- .../Scenes/Scripting/ScriptEngineLoader.cs | 119 --------------------- 3 files changed, 168 deletions(-) delete mode 100644 OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineInterface.cs delete mode 100644 OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f8d84e3..482235c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4482,19 +4482,8 @@ namespace OpenSim.Region.Framework.Scenes #region Script Engine - private List ScriptEngines = new List(); public bool DumpAssetsToFile; - /// - /// - /// - /// - public void AddScriptEngine(ScriptEngineInterface scriptEngine) - { - ScriptEngines.Add(scriptEngine); - scriptEngine.InitializeEngine(this); - } - private bool ScriptDanger(SceneObjectPart part,Vector3 pos) { ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineInterface.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineInterface.cs deleted file mode 100644 index 812a21c..0000000 --- a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineInterface.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -//TODO: WHERE TO PLACE THIS? - -namespace OpenSim.Region.Framework.Scenes.Scripting -{ - public interface ScriptEngineInterface - { - void InitializeEngine(Scene Sceneworld); - void Shutdown(); -// void StartScript(string ScriptID, IScriptHost ObjectID); - } -} diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs deleted file mode 100644 index c58ccc5..0000000 --- a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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. - */ - -/* Original code: Tedd Hansen */ -using System; -using System.IO; -using System.Reflection; -using log4net; - -namespace OpenSim.Region.Framework.Scenes.Scripting -{ - public class ScriptEngineLoader - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - public ScriptEngineInterface LoadScriptEngine(string EngineName) - { - ScriptEngineInterface ret = null; - try - { - ret = - LoadAndInitAssembly( - Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"), - "OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine"); - } - catch (Exception e) - { - m_log.Error("[ScriptEngine]: " + - "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + - e.StackTrace.ToString()); - } - return ret; - } - - /// - /// Does actual loading and initialization of script Assembly - /// - /// AppDomain to load script into - /// FileName of script assembly (.dll) - /// - private ScriptEngineInterface LoadAndInitAssembly(string FileName, string NameSpace) - { - //Common.SendToDebug("Loading ScriptEngine Assembly " + FileName); - // Load .Net Assembly (.dll) - // Initialize and return it - - // TODO: Add error handling - - Assembly a; - //try - //{ - - - // Load to default appdomain (temporary) - a = Assembly.LoadFrom(FileName); - // Load to specified appdomain - // TODO: Insert security - //a = FreeAppDomain.Load(FileName); - //} - //catch (Exception e) - //{ - // m_log.Error("[ScriptEngine]: Error loading assembly \String.Empty + FileName + "\": " + e.ToString()); - //} - - - //m_log.Debug("Loading: " + FileName); - //foreach (Type _t in a.GetTypes()) - //{ - // m_log.Debug("Type: " + _t.ToString()); - //} - - Type t; - //try - //{ - t = a.GetType(NameSpace, true); - //} - //catch (Exception e) - //{ - // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); - //} - - ScriptEngineInterface ret; - //try - //{ - ret = (ScriptEngineInterface) Activator.CreateInstance(t); - //} - //catch (Exception e) - //{ - // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); - //} - - return ret; - } - } -} -- cgit v1.1 From 2ce8a050e4181c2f2a9ee215a400c02678d88865 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Feb 2013 02:15:54 +0000 Subject: Remove very long unused IScriptHost and NullScriptHost --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- .../Framework/Scenes/Scripting/IScriptHost.cs | 46 ----------- .../Framework/Scenes/Scripting/NullScriptHost.cs | 91 ---------------------- 3 files changed, 1 insertion(+), 138 deletions(-) delete mode 100644 OpenSim/Region/Framework/Scenes/Scripting/IScriptHost.cs delete mode 100644 OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 189d298..19e6d37 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.Scenes #endregion Enumerations - public class SceneObjectPart : IScriptHost, ISceneEntity + public class SceneObjectPart : ISceneEntity { /// /// Denote all sides of the prim diff --git a/OpenSim/Region/Framework/Scenes/Scripting/IScriptHost.cs b/OpenSim/Region/Framework/Scenes/Scripting/IScriptHost.cs deleted file mode 100644 index f3be028..0000000 --- a/OpenSim/Region/Framework/Scenes/Scripting/IScriptHost.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 OpenMetaverse; - -namespace OpenSim.Region.Framework.Scenes.Scripting -{ - public interface IScriptHost - { - string Name { get; set; } - string Description { get; set; } - - UUID UUID { get; } - UUID OwnerID { get; } - UUID CreatorID { get; } - Vector3 AbsolutePosition { get; } - - string SitName { get; set; } - string TouchName { get; set; } - void SetText(string text, Vector3 color, double alpha); - } -} diff --git a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs deleted file mode 100644 index d7198f0..0000000 --- a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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 OpenMetaverse; -using log4net; -using System.Reflection; -using OpenSim.Framework; - -namespace OpenSim.Region.Framework.Scenes.Scripting -{ - public class NullScriptHost : IScriptHost - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private Vector3 m_pos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); - - public string Name - { - get { return "Object"; } - set { } - } - - public string SitName - { - get { return String.Empty; } - set { } - } - - public string TouchName - { - get { return String.Empty; } - set { } - } - - public string Description - { - get { return String.Empty; } - set { } - } - - public UUID UUID - { - get { return UUID.Zero; } - } - - public UUID OwnerID - { - get { return UUID.Zero; } - } - - public UUID CreatorID - { - get { return UUID.Zero; } - } - - public Vector3 AbsolutePosition - { - get { return m_pos; } - } - - public void SetText(string text, Vector3 color, double alpha) - { - m_log.Warn("Tried to SetText "+text+" on NullScriptHost"); - } - } -} -- cgit v1.1 From 145e38e5e9bed04d5c41880a5d508cab4603cc1d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Feb 2013 02:21:17 +0000 Subject: Remove long unused Scene.DumpAssetsToFile boolean. --- OpenSim/Region/Framework/Scenes/Scene.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 482235c..de3978c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -720,7 +720,6 @@ namespace OpenSim.Region.Framework.Scenes public Scene(RegionInfo regInfo, AgentCircuitManager authen, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, - bool dumpAssetsToFile, IConfigSource config, string simulatorVersion) : this(regInfo) { @@ -811,8 +810,6 @@ namespace OpenSim.Region.Framework.Scenes RegisterDefaultSceneEvents(); - DumpAssetsToFile = dumpAssetsToFile; - // XXX: Don't set the public property since we don't want to activate here. This needs to be handled // better in the future. m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts; @@ -4482,8 +4479,6 @@ namespace OpenSim.Region.Framework.Scenes #region Script Engine - public bool DumpAssetsToFile; - private bool ScriptDanger(SceneObjectPart part,Vector3 pos) { ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); -- cgit v1.1 From e5beb480eaf23fa7454728724de80b2a67ded1e8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 6 Feb 2013 08:03:04 +0000 Subject: Partial port of Avination's support for the new physics parameters. Implements the parameters as properties, the serialization and database storage (MySQL only). Implements llSetPrimitiveParams for prim physics shape and the other 4 extra params. Only the prim shape type "None" is currently functional. No support for the Viewer UI (yet), that will be ported in due course. Lots more to port, this is a large-ish changeset. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 96 +++++++++++++++++++++- .../Scenes/Serialization/SceneObjectSerializer.cs | 43 ++++++++++ 2 files changed, 136 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 19e6d37..55b5462 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -302,6 +302,13 @@ namespace OpenSim.Region.Framework.Scenes protected Vector3 m_lastAcceleration; protected Vector3 m_lastAngularVelocity; protected int m_lastTerseSent; + + protected byte m_physicsShapeType = (byte)PhysShapeType.prim; + // TODO: Implement these + //protected float m_density = 1000.0f; // in kg/m^3 + //protected float m_gravitymod = 1.0f; + //protected float m_friction = 0.6f; // wood + //protected float m_bounce = 0.5f; // wood /// /// Stores media texture data @@ -1322,6 +1329,69 @@ namespace OpenSim.Region.Framework.Scenes set { m_collisionSoundVolume = value; } } + public byte DefaultPhysicsShapeType() + { + byte type; + + if (Shape != null && (Shape.SculptType == (byte)SculptType.Mesh)) + type = (byte)PhysShapeType.convex; + else + type = (byte)PhysShapeType.prim; + + return type; + } + + public byte PhysicsShapeType + { + get { return m_physicsShapeType; } + set + { + byte oldv = m_physicsShapeType; + + if (value >= 0 && value <= (byte)PhysShapeType.convex) + { + if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this) + m_physicsShapeType = DefaultPhysicsShapeType(); + else + m_physicsShapeType = value; + } + else + m_physicsShapeType = DefaultPhysicsShapeType(); + + if (m_physicsShapeType != oldv && ParentGroup != null) + { + if (m_physicsShapeType == (byte)PhysShapeType.none) + { + if (PhysActor != null) + { + Velocity = new Vector3(0, 0, 0); + Acceleration = new Vector3(0, 0, 0); + if (ParentGroup.RootPart == this) + AngularVelocity = new Vector3(0, 0, 0); + ParentGroup.Scene.RemovePhysicalPrim(1); + RemoveFromPhysics(); + } + } + else if (PhysActor == null) + { + ApplyPhysics((uint)Flags, VolumeDetectActive); + } + else + { + // TODO: Update physics actor + } + + if (ParentGroup != null) + ParentGroup.HasGroupChanged = true; + } + } + } + + public float Density { get; set; } + public float GravityModifier { get; set; } + public float Friction { get; set; } + public float Bounciness { get; set; } + #endregion Public Properties with only Get private uint ApplyMask(uint val, bool set, uint mask) @@ -1523,9 +1593,8 @@ namespace OpenSim.Region.Framework.Scenes if (!ParentGroup.Scene.CollidablePrims) return; -// m_log.DebugFormat( -// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", -// Name, LocalId, UUID, m_physicalPrim); + if (PhysicsShapeType == (byte)PhysShapeType.none) + return; bool isPhysical = (rootObjectFlags & (uint) PrimFlags.Physics) != 0; bool isPhantom = (rootObjectFlags & (uint) PrimFlags.Phantom) != 0; @@ -3878,6 +3947,26 @@ namespace OpenSim.Region.Framework.Scenes } } + public void UpdateExtraPhysics(ExtraPhysicsData physdata) + { + if (physdata.PhysShapeType == PhysShapeType.invalid || ParentGroup == null) + return; + + if (PhysicsShapeType != (byte)physdata.PhysShapeType) + { + PhysicsShapeType = (byte)physdata.PhysShapeType; + + } + + if(Density != physdata.Density) + Density = physdata.Density; + if(GravityModifier != physdata.GravitationModifier) + GravityModifier = physdata.GravitationModifier; + if(Friction != physdata.Friction) + Friction = physdata.Friction; + if(Bounciness != physdata.Bounce) + Bounciness = physdata.Bounce; + } /// /// Update the flags on this prim. This covers properties such as phantom, physics and temporary. /// @@ -3949,6 +4038,7 @@ namespace OpenSim.Region.Framework.Scenes if (SetPhantom || ParentGroup.IsAttachment + || PhysicsShapeType == (byte)PhysShapeType.none || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints { AddFlag(PrimFlags.Phantom); diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 4a2a47e..78229fe 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -367,6 +367,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); + + m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType); + m_SOPXmlProcessors.Add("Density", ProcessDensity); + m_SOPXmlProcessors.Add("Friction", ProcessFriction); + m_SOPXmlProcessors.Add("Bounce", ProcessBounce); + m_SOPXmlProcessors.Add("GravityModifier", ProcessGravityModifier); + #endregion #region TaskInventoryXmlProcessors initialization @@ -594,6 +601,31 @@ namespace OpenSim.Region.Framework.Scenes.Serialization obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); } + private static void ProcessPhysicsShapeType(SceneObjectPart obj, XmlTextReader reader) + { + obj.PhysicsShapeType = (byte)reader.ReadElementContentAsInt("PhysicsShapeType", String.Empty); + } + + private static void ProcessDensity(SceneObjectPart obj, XmlTextReader reader) + { + obj.Density = reader.ReadElementContentAsFloat("Density", String.Empty); + } + + private static void ProcessFriction(SceneObjectPart obj, XmlTextReader reader) + { + obj.Friction = reader.ReadElementContentAsFloat("Friction", String.Empty); + } + + private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader) + { + obj.Bounciness = reader.ReadElementContentAsFloat("Bounce", String.Empty); + } + + private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader) + { + obj.GravityModifier = reader.ReadElementContentAsFloat("GravityModifier", String.Empty); + } + private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) { List errorNodeNames; @@ -1257,6 +1289,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); + if(sop.PhysicsShapeType != sop.DefaultPhysicsShapeType()) + writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower()); + if (sop.Density != 1000.0f) + writer.WriteElementString("Density", sop.Density.ToString().ToLower()); + if (sop.Friction != 0.6f) + writer.WriteElementString("Friction", sop.Friction.ToString().ToLower()); + if (sop.Bounciness != 0.5f) + writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower()); + if (sop.GravityModifier != 1.0f) + writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); + writer.WriteEndElement(); } -- cgit v1.1 From e17392acbb46e1e48e169069a822f8b814762214 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 6 Feb 2013 17:29:17 -0800 Subject: Enables script access to the per object dynamic attributes through the JsonStore script functions. Adds JsonAttachObjectStore to associate a store identifier with an object (scripts can only access the store in their host object, this could be extended but isn't necessary for now). Note this opens a method to the DAMap OSDMap. This will be removed later, but greatly simplifies the code for now. The JsonStore and these scripts are disabled by default. --- OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index 0bb4567..cc7885a 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs @@ -35,6 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces public interface IJsonStoreModule { + bool AttachObjectStore(UUID objectID); bool CreateStore(string value, ref UUID result); bool DestroyStore(UUID storeID); bool TestStore(UUID storeID); -- cgit v1.1 From 6504e3d4cee1573115e8a83c06227a297a32f093 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 03:30:02 +0000 Subject: Rename "Bounciness" to "Restitution" --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +++--- .../Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 55b5462..b00f388 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1390,7 +1390,7 @@ namespace OpenSim.Region.Framework.Scenes public float Density { get; set; } public float GravityModifier { get; set; } public float Friction { get; set; } - public float Bounciness { get; set; } + public float Restitution { get; set; } #endregion Public Properties with only Get @@ -3964,8 +3964,8 @@ namespace OpenSim.Region.Framework.Scenes GravityModifier = physdata.GravitationModifier; if(Friction != physdata.Friction) Friction = physdata.Friction; - if(Bounciness != physdata.Bounce) - Bounciness = physdata.Bounce; + if(Restitution != physdata.Bounce) + Restitution = physdata.Bounce; } /// /// Update the flags on this prim. This covers properties such as phantom, physics and temporary. diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 78229fe..39420a6 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -618,7 +618,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader) { - obj.Bounciness = reader.ReadElementContentAsFloat("Bounce", String.Empty); + obj.Restitution = reader.ReadElementContentAsFloat("Bounce", String.Empty); } private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader) @@ -1295,8 +1295,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("Density", sop.Density.ToString().ToLower()); if (sop.Friction != 0.6f) writer.WriteElementString("Friction", sop.Friction.ToString().ToLower()); - if (sop.Bounciness != 0.5f) - writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower()); + if (sop.Restitution != 0.5f) + writer.WriteElementString("Bounce", sop.Restitution.ToString().ToLower()); if (sop.GravityModifier != 1.0f) writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); -- cgit v1.1 From 6aa876a83b08390ab057eb012fd2c730010f79d8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 03:40:48 +0000 Subject: Rename Bounciness to Restitution --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +++--- .../Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 05b69c1..415a82b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1736,7 +1736,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public float Bounciness + public float Restitution { get { return m_bounce; } set @@ -4494,8 +4494,8 @@ namespace OpenSim.Region.Framework.Scenes GravityModifier = physdata.GravitationModifier; if(Friction != physdata.Friction) Friction = physdata.Friction; - if(Bounciness != physdata.Bounce) - Bounciness = physdata.Bounce; + if(Restitution != physdata.Bounce) + Restitution = physdata.Bounce; } /// /// Update the flags on this prim. This covers properties such as phantom, physics and temporary. diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 5c37c07..ce4fb40 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -634,7 +634,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader) { - obj.Bounciness = reader.ReadElementContentAsFloat("Bounce", String.Empty); + obj.Restitution = reader.ReadElementContentAsFloat("Bounce", String.Empty); } private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader) @@ -1377,8 +1377,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("Density", sop.Density.ToString().ToLower()); if (sop.Friction != 0.6f) writer.WriteElementString("Friction", sop.Friction.ToString().ToLower()); - if (sop.Bounciness != 0.5f) - writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower()); + if (sop.Restitution != 0.5f) + writer.WriteElementString("Bounce", sop.Restitution.ToString().ToLower()); if (sop.GravityModifier != 1.0f) writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); WriteVector(writer, "CameraEyeOffset", sop.GetCameraEyeOffset()); -- cgit v1.1 From c658fa1c0dd83f23c66ccfedb12e8ab02ff01d0a Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 7 Feb 2013 11:05:21 -0800 Subject: Add plumbing for physics properties to get to the physics engine. Addition of entries to PhysicsActor and setting code in SceneObjectPart. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 56 +++++++++++++++++++--- 1 file changed, 50 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b00f388..a3c7ed3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1387,10 +1387,46 @@ namespace OpenSim.Region.Framework.Scenes } } - public float Density { get; set; } - public float GravityModifier { get; set; } - public float Friction { get; set; } - public float Restitution { get; set; } + private float m_density = 10f; + public float Density { + get { return m_density; } + set + { + m_density = value; + if (PhysActor != null) + PhysActor.Density = m_density; + } + } + private float m_gravityModifier = 1f; + public float GravityModifier { + get { return m_gravityModifier; } + set + { + m_gravityModifier = value; + if (PhysActor != null) + PhysActor.GravityModifier = m_gravityModifier; + } + } + private float m_friction = 0.5f; + public float Friction { + get { return m_friction; } + set + { + m_friction = value; + if (PhysActor != null) + PhysActor.Friction = m_friction; + } + } + private float m_restitution = 0f; + public float Restitution { + get { return m_restitution; } + set + { + m_restitution = value; + if (PhysActor != null) + PhysActor.Restitution = m_restitution; + } + } #endregion Public Properties with only Get @@ -1896,8 +1932,18 @@ namespace OpenSim.Region.Framework.Scenes { ParentGroup.Scene.AddPhysicalPrim(1); + // Update initial values for various physical properties + pa.SetMaterial(Material); + pa.Density = Density; + pa.Friction = Friction; + pa.Restitution = Restitution; + pa.GravityModifier = GravityModifier; + + // Link up callbacks for property updates from the physics engine pa.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; pa.OnOutOfBounds += PhysicsOutOfBounds; + + // If this is a child prim, tell the physics engine about the parent if (ParentID != 0 && ParentID != LocalId) { PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; @@ -4062,7 +4108,6 @@ namespace OpenSim.Region.Framework.Scenes if (pa != null) { - pa.SetMaterial(Material); DoPhysicsPropertyUpdate(UsePhysics, true); if ( @@ -4175,7 +4220,6 @@ namespace OpenSim.Region.Framework.Scenes if (pa != null) { pa.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info - pa.SetMaterial(Material); DoPhysicsPropertyUpdate(rigidBody, true); } -- cgit v1.1 From 9089757ea2cabe49f40de64b7e6befa13a4553c1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 21:05:58 +0000 Subject: Revert "Add plumbing for physics properties to get to the physics engine." This reverts commit c658fa1c0dd83f23c66ccfedb12e8ab02ff01d0a. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 56 +++------------------- 1 file changed, 6 insertions(+), 50 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a3c7ed3..b00f388 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1387,46 +1387,10 @@ namespace OpenSim.Region.Framework.Scenes } } - private float m_density = 10f; - public float Density { - get { return m_density; } - set - { - m_density = value; - if (PhysActor != null) - PhysActor.Density = m_density; - } - } - private float m_gravityModifier = 1f; - public float GravityModifier { - get { return m_gravityModifier; } - set - { - m_gravityModifier = value; - if (PhysActor != null) - PhysActor.GravityModifier = m_gravityModifier; - } - } - private float m_friction = 0.5f; - public float Friction { - get { return m_friction; } - set - { - m_friction = value; - if (PhysActor != null) - PhysActor.Friction = m_friction; - } - } - private float m_restitution = 0f; - public float Restitution { - get { return m_restitution; } - set - { - m_restitution = value; - if (PhysActor != null) - PhysActor.Restitution = m_restitution; - } - } + public float Density { get; set; } + public float GravityModifier { get; set; } + public float Friction { get; set; } + public float Restitution { get; set; } #endregion Public Properties with only Get @@ -1932,18 +1896,8 @@ namespace OpenSim.Region.Framework.Scenes { ParentGroup.Scene.AddPhysicalPrim(1); - // Update initial values for various physical properties - pa.SetMaterial(Material); - pa.Density = Density; - pa.Friction = Friction; - pa.Restitution = Restitution; - pa.GravityModifier = GravityModifier; - - // Link up callbacks for property updates from the physics engine pa.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; pa.OnOutOfBounds += PhysicsOutOfBounds; - - // If this is a child prim, tell the physics engine about the parent if (ParentID != 0 && ParentID != LocalId) { PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; @@ -4108,6 +4062,7 @@ namespace OpenSim.Region.Framework.Scenes if (pa != null) { + pa.SetMaterial(Material); DoPhysicsPropertyUpdate(UsePhysics, true); if ( @@ -4220,6 +4175,7 @@ namespace OpenSim.Region.Framework.Scenes if (pa != null) { pa.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info + pa.SetMaterial(Material); DoPhysicsPropertyUpdate(rigidBody, true); } -- cgit v1.1 From 7bf33d333af6e7393a05940d1ab436f5dce73814 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 22:25:28 +0000 Subject: Plumb the path from the client to the extra physics params and back --- OpenSim/Region/Framework/Interfaces/IEventQueue.cs | 2 ++ OpenSim/Region/Framework/Scenes/SceneGraph.cs | 25 ++++++++++++++++++++-- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 + 3 files changed, 26 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs index bfa5d17..5512642 100644 --- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs @@ -59,5 +59,7 @@ namespace OpenSim.Region.Framework.Interfaces void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono); OSD BuildEvent(string eventName, OSD eventBody); + void partPhysicsProperties(uint localID, byte physhapetype, float density, float friction, float bounce, float gravmod, UUID avatarID); + } } diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a4383fd..a84f6d3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1408,7 +1408,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// protected internal void UpdatePrimFlags( - uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, IClientAPI remoteClient) + uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, ExtraPhysicsData PhysData, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); if (group != null) @@ -1416,7 +1416,28 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) { // VolumeDetect can't be set via UI and will always be off when a change is made there - group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, false); + // now only change volume dtc if phantom off + + if (PhysData.PhysShapeType == PhysShapeType.invalid) // check for extraPhysics data + { + bool vdtc; + if (SetPhantom) // if phantom keep volumedtc + vdtc = group.RootPart.VolumeDetectActive; + else // else turn it off + vdtc = false; + + group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, vdtc); + } + else + { + SceneObjectPart part = GetSceneObjectPart(localID); + if (part != null) + { + part.UpdateExtraPhysics(PhysData); + if (part.UpdatePhysRequired) + remoteClient.SendPartPhysicsProprieties(part); + } + } } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b00f388..cd40b29 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1042,6 +1042,7 @@ namespace OpenSim.Region.Framework.Scenes } public UpdateRequired UpdateFlag { get; set; } + public bool UpdatePhysRequired { get; set; } /// /// Used for media on a prim. -- cgit v1.1 From 22675e6b14ce1b180f517c1ab92627d283192032 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 23:22:00 +0000 Subject: Add some more code from Avination. This changes physics actor stuff around to work with the new params. Not actually plumbed just yet. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 189 +++++++++++++++++---- 1 file changed, 152 insertions(+), 37 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index cd40b29..9f602f7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -304,11 +304,10 @@ namespace OpenSim.Region.Framework.Scenes protected int m_lastTerseSent; protected byte m_physicsShapeType = (byte)PhysShapeType.prim; - // TODO: Implement these - //protected float m_density = 1000.0f; // in kg/m^3 - //protected float m_gravitymod = 1.0f; - //protected float m_friction = 0.6f; // wood - //protected float m_bounce = 0.5f; // wood + protected float m_density = 1000.0f; // in kg/m^3 + protected float m_gravitymod = 1.0f; + protected float m_friction = 0.6f; // wood + protected float m_bounce = 0.5f; // wood /// /// Stores media texture data @@ -1379,19 +1378,92 @@ namespace OpenSim.Region.Framework.Scenes } else { - // TODO: Update physics actor + PhysActor.PhysicsShapeType = m_physicsShapeType; } if (ParentGroup != null) ParentGroup.HasGroupChanged = true; } + + if (m_physicsShapeType != value) + { + UpdatePhysRequired = true; + } } } - public float Density { get; set; } - public float GravityModifier { get; set; } - public float Friction { get; set; } - public float Restitution { get; set; } + public float Density // in kg/m^3 + { + get { return m_density; } + set + { + if (value >=1 && value <= 22587.0) + { + m_density = value; + UpdatePhysRequired = true; + } + + ScheduleFullUpdateIfNone(); + + if (ParentGroup != null) + ParentGroup.HasGroupChanged = true; + } + } + + public float GravityModifier + { + get { return m_gravitymod; } + set + { + if( value >= -1 && value <=28.0f) + { + m_gravitymod = value; + UpdatePhysRequired = true; + } + + ScheduleFullUpdateIfNone(); + + if (ParentGroup != null) + ParentGroup.HasGroupChanged = true; + + } + } + + public float Friction + { + get { return m_friction; } + set + { + if (value >= 0 && value <= 255.0f) + { + m_friction = value; + UpdatePhysRequired = true; + } + + ScheduleFullUpdateIfNone(); + + if (ParentGroup != null) + ParentGroup.HasGroupChanged = true; + } + } + + public float Restitution + { + get { return m_bounce; } + set + { + if (value >= 0 && value <= 1.0f) + { + m_bounce = value; + UpdatePhysRequired = true; + } + + ScheduleFullUpdateIfNone(); + + if (ParentGroup != null) + ParentGroup.HasGroupChanged = true; + } + } #endregion Public Properties with only Get @@ -1589,8 +1661,10 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive) + public void ApplyPhysics(uint rootObjectFlags, bool _VolumeDetectActive) { + VolumeDetectActive = _VolumeDetectActive; + if (!ParentGroup.Scene.CollidablePrims) return; @@ -1600,28 +1674,22 @@ namespace OpenSim.Region.Framework.Scenes bool isPhysical = (rootObjectFlags & (uint) PrimFlags.Physics) != 0; bool isPhantom = (rootObjectFlags & (uint) PrimFlags.Phantom) != 0; + if (_VolumeDetectActive) + isPhantom = true; + if (IsJoint()) { DoPhysicsPropertyUpdate(isPhysical, true); } else { - // Special case for VolumeDetection: If VolumeDetection is set, the phantom flag is locally ignored - if (VolumeDetectActive) - isPhantom = false; - - // The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition - // or flexible - if (!isPhantom && !ParentGroup.IsAttachment && !(Shape.PathCurve == (byte)Extrusion.Flexible)) + if ((!isPhantom || isPhysical || _VolumeDetectActive) && !ParentGroup.IsAttachment + && !(Shape.PathCurve == (byte)Extrusion.Flexible)) { - // Added clarification.. since A rigid body is an object that you can kick around, etc. - bool rigidBody = isPhysical && !isPhantom; - - PhysicsActor pa = AddToPhysics(rigidBody); - - if (pa != null) - pa.SetVolumeDetect(VolumeDetectActive ? 1 : 0); + AddToPhysics(isPhysical, isPhantom, isPhysical); } + else + PhysActor = null; // just to be sure } } @@ -2503,6 +2571,19 @@ namespace OpenSim.Region.Framework.Scenes APIDTarget = Quaternion.Identity; } + + + public void ScheduleFullUpdateIfNone() + { + if (ParentGroup == null) + return; + +// ??? ParentGroup.HasGroupChanged = true; + + if (UpdateFlag != UpdateRequired.FULL) + ScheduleFullUpdate(); + } + /// /// Schedules this prim for a full update /// @@ -4059,7 +4140,9 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup.Scene.CollidablePrims && pa == null) { - pa = AddToPhysics(UsePhysics); + AddToPhysics(UsePhysics, SetPhantom, false); + pa = PhysActor; + if (pa != null) { @@ -4146,10 +4229,13 @@ namespace OpenSim.Region.Framework.Scenes /// /// The physics actor. null if there was a failure. /// - private PhysicsActor AddToPhysics(bool rigidBody) + private void AddToPhysics(bool isPhysical, bool isPhantom, bool applyDynamics) { PhysicsActor pa; + Vector3 velocity = Velocity; + Vector3 rotationalVelocity = AngularVelocity;; + try { pa = ParentGroup.Scene.PhysicsScene.AddPrimShape( @@ -4157,8 +4243,10 @@ namespace OpenSim.Region.Framework.Scenes Shape, AbsolutePosition, Scale, - RotationOffset, - rigidBody, + GetWorldRotation(), + isPhysical, + isPhantom, + PhysicsShapeType, m_localId); } catch (Exception e) @@ -4167,20 +4255,47 @@ namespace OpenSim.Region.Framework.Scenes pa = null; } - // FIXME: Ideally we wouldn't set the property here to reduce situations where threads changing physical - // properties can stop on each other. However, DoPhysicsPropertyUpdate() currently relies on PhysActor - // being set. - PhysActor = pa; - - // Basic Physics can also return null as well as an exception catch. if (pa != null) { pa.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info pa.SetMaterial(Material); - DoPhysicsPropertyUpdate(rigidBody, true); + + if (VolumeDetectActive) // change if not the default only + pa.SetVolumeDetect(1); + // we are going to tell rest of code about physics so better have this here + PhysActor = pa; + + if (isPhysical) + { + ParentGroup.Scene.AddPhysicalPrim(1); + + pa.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; + pa.OnOutOfBounds += PhysicsOutOfBounds; + + if (ParentID != 0 && ParentID != LocalId) + { + PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; + + if (parentPa != null) + { + pa.link(parentPa); + } + } + } + + if (applyDynamics) + // do independent of isphysical so parameters get setted (at least some) + { + Velocity = velocity; + AngularVelocity = rotationalVelocity; +// pa.Velocity = velocity; + pa.RotationalVelocity = rotationalVelocity; + } + + ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa); } - return pa; + PhysActor = pa; } /// -- cgit v1.1 From a2dad09172ce462ea38ff77b684f07ae4b22fbd8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 23:34:47 +0000 Subject: Actually plumb the new values to physics. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9f602f7..9b29973 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1407,6 +1407,10 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup != null) ParentGroup.HasGroupChanged = true; + + PhysicsActor pa = PhysActor; + if (pa != null) + pa.Density = Density; } } @@ -1426,6 +1430,9 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup != null) ParentGroup.HasGroupChanged = true; + PhysicsActor pa = PhysActor; + if (pa != null) + pa.GravModifier = GravityModifier; } } @@ -1444,6 +1451,10 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup != null) ParentGroup.HasGroupChanged = true; + + PhysicsActor pa = PhysActor; + if (pa != null) + pa.Friction = Friction; } } @@ -1462,6 +1473,10 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup != null) ParentGroup.HasGroupChanged = true; + + PhysicsActor pa = PhysActor; + if (pa != null) + pa.Restitution = Restitution; } } @@ -4260,6 +4275,11 @@ namespace OpenSim.Region.Framework.Scenes pa.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info pa.SetMaterial(Material); + pa.Density = Density; + pa.GravModifier = GravityModifier; + pa.Friction = Friction; + pa.Restitution = Restitution; + if (VolumeDetectActive) // change if not the default only pa.SetVolumeDetect(1); // we are going to tell rest of code about physics so better have this here -- cgit v1.1 From c2bf91c5e3bda35034a49f4cfacc30f73c0ee688 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 8 Feb 2013 02:45:30 +0000 Subject: If a component of a coalesced object fails to deserialization, do not add a null where the object should be. This prevents a later load IAR failure. This code is currently only used by IAR loading. --- .../CoalescedSceneObjectsSerializer.cs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index a4f730d..5cb271d 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs @@ -42,9 +42,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization /// /// Serialize and deserialize coalesced scene objects. /// - /// - /// Deserialization not yet here. - /// public class CoalescedSceneObjectsSerializer { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -128,6 +125,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization // m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml); coa = null; + int i = 0; using (StringReader sr = new StringReader(xml)) { @@ -153,7 +151,23 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (reader.Name == "SceneObjectGroup") { string soXml = reader.ReadOuterXml(); - coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml)); + + SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(soXml); + + if (so != null) + { + coa.Add(so); + } + else + { + // XXX: Possibly we should fail outright here rather than continuing if a particular component of the + // coalesced object fails to load. + m_log.WarnFormat( + "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", + i); + } + + i++; } } -- cgit v1.1 From adedd70c352581bc447452f5835c10853c77bea8 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 10 Feb 2013 13:01:33 -0500 Subject: Fix teleport/telehub issue: Fix bug that allowed only login access to regions with mis-configured telehubs. Administrators now have teleport access when there exists a mis-configured telehub in the region. Estate owners are now placed at region center in the absence of spawnpoints instead of being denied access. Grid Gods are unrestricted. All others are denied access to the region until spawnpoints are assigned to the telehub object. --- OpenSim/Region/Framework/Scenes/Scene.cs | 9 +++++++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 ++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index de3978c..9b17b7f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5506,8 +5506,13 @@ namespace OpenSim.Region.Framework.Scenes if (banned) { - reason = "No suitable landing point found"; - return false; + if(Permissions.IsAdministrator(agentID) == false || Permissions.IsGridGod(agentID) == false) + { + reason = "No suitable landing point found"; + return false; + } + reason = "Administrative access only"; + return true; } } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6e41774..30bd715 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4021,6 +4021,7 @@ namespace OpenSim.Region.Framework.Scenes (m_teleportFlags & TeleportFlags.ViaLocation) != 0 || (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0) { + if (GodLevel < 200 && ((!m_scene.Permissions.IsGod(m_uuid) && !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || @@ -4029,7 +4030,14 @@ namespace OpenSim.Region.Framework.Scenes { SpawnPoint[] spawnPoints = m_scene.RegionInfo.RegionSettings.SpawnPoints().ToArray(); if (spawnPoints.Length == 0) + { + if(m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) + { + pos.X = 128.0f; + pos.Y = 128.0f; + } return; + } int index; bool selected = false; @@ -4049,7 +4057,8 @@ namespace OpenSim.Region.Framework.Scenes // SpawnPoint sp = spawnPoints[index]; ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y); - if (land == null || land.IsEitherBannedOrRestricted(UUID)) + if (spawnPoints.Length == 0) + return; if (land == null || land.IsEitherBannedOrRestricted(UUID)) selected = false; else selected = true; -- cgit v1.1 From 6f3dcf58b8f47922b68993cfdd9cdbd5b4ae36d8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 10 Feb 2013 20:00:39 +0000 Subject: Fix code to check for no spawn points. Possibly a merge artefact? --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 30bd715..70e3952 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4046,6 +4046,8 @@ namespace OpenSim.Region.Framework.Scenes { case "random": + if (spawnPoints.Length == 0) + return; do { index = Util.RandomClass.Next(spawnPoints.Length - 1); @@ -4057,8 +4059,8 @@ namespace OpenSim.Region.Framework.Scenes // SpawnPoint sp = spawnPoints[index]; ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y); - if (spawnPoints.Length == 0) - return; if (land == null || land.IsEitherBannedOrRestricted(UUID)) + + if (land == null || land.IsEitherBannedOrRestricted(UUID)) selected = false; else selected = true; -- cgit v1.1 From bcb172301dfc1d8dcdb837be89c3ce3248500cc0 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 13 Feb 2013 07:14:04 -0800 Subject: Adds a couple requested functions to the JsonStore script interface. JsonPathType returns the type of node pointed to by the path and deprecates the functionality of both JsonTestPath functions. JsonArrayLength returns the length of an array node. --- OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index cc7885a..d7907e3 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs @@ -31,6 +31,16 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { + // these could be expanded at some point to provide more type information + // for now value accounts for all base types + public enum JsonStoreNodeType + { + Undefined = 0, + Object = 1, + Array = 2, + Value = 3 + } + public delegate void TakeValueCallback(string s); public interface IJsonStoreModule @@ -38,13 +48,18 @@ namespace OpenSim.Region.Framework.Interfaces bool AttachObjectStore(UUID objectID); bool CreateStore(string value, ref UUID result); bool DestroyStore(UUID storeID); + + JsonStoreNodeType PathType(UUID storeID, string path); bool TestStore(UUID storeID); bool TestPath(UUID storeID, string path, bool useJson); + bool SetValue(UUID storeID, string path, string value, bool useJson); bool RemoveValue(UUID storeID, string path); bool GetValue(UUID storeID, string path, bool useJson, out string value); void TakeValue(UUID storeID, string path, bool useJson, TakeValueCallback cback); void ReadValue(UUID storeID, string path, bool useJson, TakeValueCallback cback); + + int ArrayLength(UUID storeID, string path); } } -- cgit v1.1 From ef662fc959c7943e55c548c50c6b160d12e5c095 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 14 Feb 2013 08:40:15 +0100 Subject: Add an event and some logic to allow customizing Simulator Features by avatar --- OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs b/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs index 8cef14e..6effcc1 100644 --- a/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs @@ -26,18 +26,22 @@ */ using System; +using OpenMetaverse; using OpenMetaverse.StructuredData; namespace OpenSim.Region.Framework.Interfaces { + public delegate void SimulatorFeaturesRequestDelegate(UUID agentID, ref OSDMap features); + /// /// Add remove or retrieve Simulator Features that will be given to a viewer via the SimulatorFeatures capability. /// public interface ISimulatorFeaturesModule { + event SimulatorFeaturesRequestDelegate OnSimulatorFeaturesRequest; void AddFeature(string name, OSD value); bool RemoveFeature(string name); bool TryGetFeature(string name, out OSD value); OSDMap GetFeatures(); } -} \ No newline at end of file +} -- cgit v1.1 From 5920abbf8d1b1770c03bc6232f1afe0551b4a331 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 14 Feb 2013 09:48:11 -0800 Subject: Add EventManager events triggered when a SOP is added or removed from the physical scene. Invocations added in SceneObjectPart. --- OpenSim/Region/Framework/Scenes/EventManager.cs | 55 ++++++++++++++++++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 + 2 files changed, 57 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 9ee1520..59d0148 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -791,6 +791,19 @@ namespace OpenSim.Region.Framework.Scenes public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); /// + /// Triggered when an object is placed into the physical scene (PhysicsActor created). + /// + public event Action OnObjectAddedToPhysicalScene; + /// + /// Triggered when an object is removed from the physical scene (PhysicsActor destroyed). + /// + /// + /// Note: this is triggered just before the PhysicsActor is removed from the + /// physics engine so the receiver can do any necessary cleanup before its destruction. + /// + public event Action OnObjectRemovedFromPhysicalScene; + + /// /// Triggered when an object is removed from the scene. /// /// @@ -1516,6 +1529,48 @@ namespace OpenSim.Region.Framework.Scenes } } + public void TriggerObjectAddedToPhysicalScene(SceneObjectPart obj) + { + Action handler = OnObjectAddedToPhysicalScene; + if (handler != null) + { + foreach (Action d in handler.GetInvocationList()) + { + try + { + d(obj); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerObjectAddedToPhysicalScene failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + + public void TriggerObjectRemovedFromPhysicalScene(SceneObjectPart obj) + { + Action handler = OnObjectRemovedFromPhysicalScene; + if (handler != null) + { + foreach (Action d in handler.GetInvocationList()) + { + try + { + d(obj); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerObjectRemovedFromPhysicalScene failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + public void TriggerShutdown() { Action handlerShutdown = OnShutdown; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9b29973..cce8b21 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4316,6 +4316,7 @@ namespace OpenSim.Region.Framework.Scenes } PhysActor = pa; + ParentGroup.Scene.EventManager.TriggerObjectAddedToPhysicalScene(this); } /// @@ -4328,6 +4329,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void RemoveFromPhysics() { + ParentGroup.Scene.EventManager.TriggerObjectRemovedFromPhysicalScene(this); ParentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); PhysActor = null; } -- cgit v1.1 From edb99dcc19d20980ab8fc1a0a272017855e1f266 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 14 Feb 2013 21:11:58 +0000 Subject: Rename new JsonScript functions JsonPathType() -> JsonGetPathType() and JsonArrayLength() -> JsonGetArrayLength() This is for consistentency with the verb:noun naming approach existing json script functions and other script functions. Corresponding c# methods also changed since verb:noun is also the .net c# method naming guideline (as used by OpenSimulator) and for consistency with script functions. As agreed with cmickeyb --- OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index d7907e3..b40d24f 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.Framework.Interfaces bool CreateStore(string value, ref UUID result); bool DestroyStore(UUID storeID); - JsonStoreNodeType PathType(UUID storeID, string path); + JsonStoreNodeType GetPathType(UUID storeID, string path); bool TestStore(UUID storeID); bool TestPath(UUID storeID, string path, bool useJson); @@ -60,6 +60,6 @@ namespace OpenSim.Region.Framework.Interfaces void TakeValue(UUID storeID, string path, bool useJson, TakeValueCallback cback); void ReadValue(UUID storeID, string path, bool useJson, TakeValueCallback cback); - int ArrayLength(UUID storeID, string path); + int GetArrayLength(UUID storeID, string path); } } -- cgit v1.1 From e9cc22fea48a6d80fccbd624fd9710dfa3830980 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 16 Feb 2013 00:26:21 +0000 Subject: Add regression test TestSaveNonRootFolderToIar --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index c1522e7..52ad538 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests UserAccount ua = UserAccountHelpers.CreateUserWithInventory(scene, agentId); InventoryFolderBase folder1 - = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, ua.PrincipalID, "folder1"); + = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, ua.PrincipalID, "folder1", false); IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient; scene.DeRezObjects(client, new List() { so.LocalId }, UUID.Zero, DeRezAction.Take, folder1.ID); diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 0b461f5..df819ec 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -133,7 +133,7 @@ namespace OpenSim.Region.Framework.Tests scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); InventoryFolderBase folder - = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; + = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; // Perform test scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID); diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs index 9457ebb..e50b4da 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs @@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Tests Scene scene = new SceneHelpers().SetupScene(); UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); - UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, foldersName); + UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, foldersName, false); List oneFolder = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, foldersName); @@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Tests InventoryFolderBase firstRetrievedFolder = oneFolder[0]; Assert.That(firstRetrievedFolder.Name, Is.EqualTo(foldersName)); - UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, foldersName); + UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, foldersName, false); List twoFolders = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, foldersName); @@ -121,7 +121,7 @@ namespace OpenSim.Region.Framework.Tests UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); InventoryFolderBase folder1 - = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, "folder1"); + = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, "folder1", false); scene.GiveInventoryFolder(user2.PrincipalID, user1.PrincipalID, folder1.ID, UUID.Zero); -- cgit v1.1 From 6560d80fa856fb73c51a7ccd37f720c25b12d42d Mon Sep 17 00:00:00 2001 From: teravus Date: Sat, 16 Feb 2013 22:54:37 -0500 Subject: * Fix walking to via autopilot. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 70e3952..9c1d2b6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1847,7 +1847,11 @@ namespace OpenSim.Region.Framework.Scenes // Get terrain height for sub-region in a megaregion if necessary int X = (int)((m_scene.RegionInfo.RegionLocX * Constants.RegionSize) + pos.X); int Y = (int)((m_scene.RegionInfo.RegionLocY * Constants.RegionSize) + pos.Y); - UUID target_regionID = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y).RegionID; + GridRegion target_region = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y); + // If X and Y is NaN, target_region will be null + if (target_region == null) + return; + UUID target_regionID = target_region.RegionID; Scene targetScene = m_scene; if (!SceneManager.Instance.TryGetScene(target_regionID, out targetScene)) -- cgit v1.1 From 4779f7d7d5ce0e284d9ed15104389f8479b11545 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 19 Feb 2013 17:14:55 -0800 Subject: Deleted all AssemblyFileVersion directives --- OpenSim/Region/Framework/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Properties/AssemblyInfo.cs b/OpenSim/Region/Framework/Properties/AssemblyInfo.cs index 2a5828e..167c248 100644 --- a/OpenSim/Region/Framework/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Framework/Properties/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.InteropServices; // Revision // [assembly: AssemblyVersion("0.7.6.*")] -[assembly: AssemblyFileVersion("1.0.0.0")] + -- cgit v1.1 From 903b40b47e53cc131b57919e8a8a83db3cb36f96 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 19 Feb 2013 22:53:46 -0800 Subject: Fix the JsonStore path set problem justincc found earlier today and remove the deprecated TestPath functions. --- OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index b40d24f..345f01b 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs @@ -51,7 +51,6 @@ namespace OpenSim.Region.Framework.Interfaces JsonStoreNodeType GetPathType(UUID storeID, string path); bool TestStore(UUID storeID); - bool TestPath(UUID storeID, string path, bool useJson); bool SetValue(UUID storeID, string path, string value, bool useJson); bool RemoveValue(UUID storeID, string path); -- cgit v1.1 From a93f06eb88489f822d903249377ce8cbdd991fb0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 22 Feb 2013 23:08:14 +0000 Subject: minor: Add doc to ScenePresence.IsInTransit to make it clear that this is set only for region crossing and not teleport, etc. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9c1d2b6..39a885c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -657,6 +657,12 @@ namespace OpenSim.Region.Framework.Scenes private bool m_inTransit; + /// + /// This signals whether the presence is in transit between neighbouring regions. + /// + /// + /// It is not set when the presence is teleporting or logging in/out directly to a region. + /// public bool IsInTransit { get { return m_inTransit; } -- cgit v1.1 From d0cb4fc3262df2afe2ef34396c7960f7afee6b89 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 25 Feb 2013 23:04:38 +0000 Subject: Move map related settings from [Startup] to a new [Map] section in OpenSim.ini Existing map settings in [Startup] will continue to work, and if present will override anything in [Map] However, the proper place for such settings would now be [Map] This is to reduce the use of [Startup] as a bag for non-generic settings which should really go in sections, in common with other settings. This commit also extends Diva's previous work to allow a default setting to be given when looking at multiple sections for settings. --- OpenSim/Region/Framework/Scenes/Scene.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9b17b7f..5b61538 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -897,7 +897,11 @@ namespace OpenSim.Region.Framework.Scenes m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); - m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); + string[] possibleMapConfigSections = new string[] { "Map", "Startup" }; + + m_generateMaptiles + = Util.GetConfigVarFromSections(config, "GenerateMaptiles", possibleMapConfigSections, true); + if (m_generateMaptiles) { int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0); @@ -911,7 +915,10 @@ namespace OpenSim.Region.Framework.Scenes } else { - string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); + string tile + = Util.GetConfigVarFromSections( + config, "MaptileStaticUUID", possibleMapConfigSections, UUID.Zero.ToString()); + UUID tileID; if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out tileID)) -- cgit v1.1 From b8a7c8b26f3005eed5b161c37509b06b1d604967 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 26 Feb 2013 23:36:36 +0000 Subject: Add regression test for llRequestUrl() --- OpenSim/Region/Framework/Interfaces/IScriptModule.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 143af48..ced4e91 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs @@ -52,7 +52,18 @@ namespace OpenSim.Region.Framework.Interfaces string GetXMLState(UUID itemID); bool SetXMLState(UUID itemID, string xml); + /// + /// Post a script event to a single script. + /// + /// true if the post suceeded, false if it did not + /// The item ID of the script. + /// The name of the event. + /// + /// The arguments of the event. These are in the order in which they appear. + /// e.g. for http_request this will be an object array of key request_id, string method, string body + /// bool PostScriptEvent(UUID itemID, string name, Object[] args); + bool PostObjectEvent(UUID itemID, string name, Object[] args); /// -- cgit v1.1 From 0e8ec5649ec5929927760368226ac5c584dc4a4e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 27 Feb 2013 22:31:47 +0000 Subject: Get "show modules" console command to obey selected command line region/s --- OpenSim/Region/Framework/Scenes/SceneManager.cs | 27 ++++++++++--------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 1e2e973..780bd01 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -331,35 +331,30 @@ namespace OpenSim.Region.Framework.Scenes public void SendCommandToPluginModules(string[] cmdparams) { - ForEachCurrentScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); }); + ForEachSelectedScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); }); } public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions) { - ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); }); + ForEachSelectedScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); }); } - private void ForEachCurrentScene(Action func) + public void ForEachSelectedScene(Action func) { if (CurrentScene == null) - { - lock (m_localScenes) - m_localScenes.ForEach(func); - } + ForEachScene(func); else - { func(CurrentScene); - } } public void RestartCurrentScene() { - ForEachCurrentScene(delegate(Scene scene) { scene.RestartNow(); }); + ForEachSelectedScene(delegate(Scene scene) { scene.RestartNow(); }); } public void BackupCurrentScene() { - ForEachCurrentScene(delegate(Scene scene) { scene.Backup(true); }); + ForEachSelectedScene(delegate(Scene scene) { scene.Backup(true); }); } public bool TrySetCurrentScene(string regionName) @@ -490,7 +485,7 @@ namespace OpenSim.Region.Framework.Scenes /// Name of avatar to debug public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) { - ForEachCurrentScene(scene => + ForEachSelectedScene(scene => scene.ForEachScenePresence(sp => { if (name == null || sp.Name == name) @@ -509,7 +504,7 @@ namespace OpenSim.Region.Framework.Scenes { List avatars = new List(); - ForEachCurrentScene( + ForEachSelectedScene( delegate(Scene scene) { scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) @@ -526,7 +521,7 @@ namespace OpenSim.Region.Framework.Scenes { List presences = new List(); - ForEachCurrentScene(delegate(Scene scene) + ForEachSelectedScene(delegate(Scene scene) { scene.ForEachScenePresence(delegate(ScenePresence sp) { @@ -555,12 +550,12 @@ namespace OpenSim.Region.Framework.Scenes public void ForceCurrentSceneClientUpdate() { - ForEachCurrentScene(delegate(Scene scene) { scene.ForceClientUpdate(); }); + ForEachSelectedScene(delegate(Scene scene) { scene.ForceClientUpdate(); }); } public void HandleEditCommandOnCurrentScene(string[] cmdparams) { - ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); + ForEachSelectedScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); } public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) -- cgit v1.1 From 14684116f8ef23892b71ef16759224a536ac27bf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Feb 2013 20:57:03 +0000 Subject: Add regression tests for llGetNotecardLine() --- OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index df819ec..6e0ea7d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -130,7 +130,7 @@ namespace OpenSim.Region.Framework.Tests SceneObjectPart sop1 = sog1.RootPart; TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard( - scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); + scene, 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)); + scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); // Perform test scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); -- cgit v1.1 From 1bc8692a999f4e80b90b9a1eb7c7428b2e74214e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 2 Mar 2013 01:43:54 +0000 Subject: Move AllowedClients and BannedClients section to new [AccessControl] section in OpenSim.ini from [Startup] This change also corrects the setting names - they were actually wrong (though the text in {} was correct). If there are settings in [Startup] they will continue to be used and anything there will override settings in [AccessControl] --- OpenSim/Region/Framework/Scenes/Scene.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5b61538..14dac7a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -932,7 +932,12 @@ namespace OpenSim.Region.Framework.Scenes } } - string grant = startupConfig.GetString("AllowedClients", String.Empty); + string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "Startup" }; + + string grant + = Util.GetConfigVarFromSections( + config, "AllowedClients", possibleAccessControlConfigSections, ""); + if (grant.Length > 0) { foreach (string viewer in grant.Split('|')) @@ -941,7 +946,10 @@ namespace OpenSim.Region.Framework.Scenes } } - grant = startupConfig.GetString("BannedClients", String.Empty); + grant + = Util.GetConfigVarFromSections( + config, "BannedClients", possibleAccessControlConfigSections, ""); + if (grant.Length > 0) { foreach (string viewer in grant.Split('|')) -- cgit v1.1 From 9875e840f7e71f0b253c0b2aa90d47edc9c77b64 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 5 Mar 2013 20:33:17 -0800 Subject: Per discussions with justincc... split the JsonStore type functions into one for node type and one for value type. Define and export constants for both nodes and values. --- OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index 345f01b..b67312e 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs @@ -41,6 +41,16 @@ namespace OpenSim.Region.Framework.Interfaces Value = 3 } + public enum JsonStoreValueType + { + Undefined = 0, + Boolean = 1, + Integer = 2, + Float = 3, + String = 4, + UUID = 5 + } + public delegate void TakeValueCallback(string s); public interface IJsonStoreModule @@ -49,7 +59,9 @@ namespace OpenSim.Region.Framework.Interfaces bool CreateStore(string value, ref UUID result); bool DestroyStore(UUID storeID); - JsonStoreNodeType GetPathType(UUID storeID, string path); + JsonStoreNodeType GetNodeType(UUID storeID, string path); + JsonStoreValueType GetValueType(UUID storeID, string path); + bool TestStore(UUID storeID); bool SetValue(UUID storeID, string path, string value, bool useJson); -- cgit v1.1 From 8960418e7d51a0f861e7b4cb800f007d76862c9c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Mar 2013 21:37:53 +0000 Subject: Add regression test for presence crossing between regions on the same simulator. Unlike a much earlier commented out version of this test, this is done in synchronous mode. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 37 +++--- .../Scenes/Tests/ScenePresenceAgentTests.cs | 103 --------------- .../Scenes/Tests/ScenePresenceCrossingTests.cs | 140 +++++++++++++++++++++ 3 files changed, 159 insertions(+), 121 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 39a885c..a7c7539 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1613,32 +1613,28 @@ namespace OpenSim.Region.Framework.Scenes bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0)); - //m_log.Debug("[CONTROL]: " +flags); // Applies a satisfying roll effect to the avatar when flying. - if (((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) != 0) && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0)) + if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) != 0 && (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0) { - - ApplyFlyingRoll(FLY_ROLL_RADIANS_PER_UPDATE, ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0), ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0)); - - + ApplyFlyingRoll( + FLY_ROLL_RADIANS_PER_UPDATE, + (flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0, + (flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0); } - else if (((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) != 0) && - ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0)) + else if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) != 0 && + (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0) { - ApplyFlyingRoll(-FLY_ROLL_RADIANS_PER_UPDATE, ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0), ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0)); - - + ApplyFlyingRoll( + -FLY_ROLL_RADIANS_PER_UPDATE, + (flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0, + (flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0); } else { if (m_AngularVelocity.Z != 0) - m_AngularVelocity.Z += CalculateFlyingRollResetToZero(FLY_ROLL_RESET_RADIANS_PER_UPDATE); - - } - - - + m_AngularVelocity.Z += CalculateFlyingRollResetToZero(FLY_ROLL_RESET_RADIANS_PER_UPDATE); + } if (Flying && IsColliding && controlland) { @@ -2400,7 +2396,8 @@ namespace OpenSim.Region.Framework.Scenes /// The vector in which to move. This is relative to the rotation argument public void AddNewMovement(Vector3 vec) { -// m_log.DebugFormat("[SCENE PRESENCE]: Adding new movement {0} for {1}", vec, Name); +// m_log.DebugFormat( +// "[SCENE PRESENCE]: Adding new movement {0} with rotation {1} for {2}", vec, Rotation, Name); Vector3 direc = vec * Rotation; direc.Normalize(); @@ -2420,6 +2417,8 @@ namespace OpenSim.Region.Framework.Scenes direc *= 0.03f * 128f * SpeedModifier; +// m_log.DebugFormat("[SCENE PRESENCE]: Force to apply before modification was {0} for {1}", direc, Name); + if (PhysicsActor != null) { if (Flying) @@ -2453,6 +2452,8 @@ namespace OpenSim.Region.Framework.Scenes } } +// m_log.DebugFormat("[SCENE PRESENCE]: Setting force to apply to {0} for {1}", direc, Name); + // TODO: Add the force instead of only setting it to support multiple forces per frame? m_forceToApply = direc; } diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index 5faf131..bbfbbfc 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs @@ -289,108 +289,5 @@ namespace OpenSim.Region.Framework.Scenes.Tests // // Assert.That(presence, Is.Null, "presence is not null"); // } - - // I'm commenting this test because it does not represent - // crossings. The Thread.Sleep's in here are not meaningful mocks, - // and they sometimes fail in panda. - // We need to talk in order to develop a test - // that really tests region crossings. There are 3 async components, - // but things are synchronous among them. So there should be - // 3 threads in here. - //[Test] -// public void T021_TestCrossToNewRegion() -// { -// TestHelpers.InMethod(); -// -// scene.RegisterRegionWithGrid(); -// scene2.RegisterRegionWithGrid(); -// -// // Adding child agent to region 1001 -// string reason; -// scene2.NewUserConnection(acd1,0, out reason); -// scene2.AddNewClient(testclient, PresenceType.User); -// -// ScenePresence presence = scene.GetScenePresence(agent1); -// presence.MakeRootAgent(new Vector3(0,unchecked(Constants.RegionSize-1),0), true); -// -// ScenePresence presence2 = scene2.GetScenePresence(agent1); -// -// // Adding neighbour region caps info to presence2 -// -// string cap = presence.ControllingClient.RequestClientInfo().CapsPath; -// presence2.AddNeighbourRegion(region1, cap); -// -// Assert.That(presence.IsChildAgent, Is.False, "Did not start root in origin region."); -// Assert.That(presence2.IsChildAgent, Is.True, "Is not a child on destination region."); -// -// // Cross to x+1 -// presence.AbsolutePosition = new Vector3(Constants.RegionSize+1,3,100); -// presence.Update(); -// -// EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); -// -// // Mimicking communication between client and server, by waiting OK from client -// // sent by TestClient.CrossRegion call. Originally, this is network comm. -// if (!wh.WaitOne(5000,false)) -// { -// presence.Update(); -// if (!wh.WaitOne(8000,false)) -// throw new ArgumentException("1 - Timeout waiting for signal/variable."); -// } -// -// // This is a TestClient specific method that fires OnCompleteMovementToRegion event, which -// // would normally be fired after receiving the reply packet from comm. done on the last line. -// testclient.CompleteMovement(); -// -// // Crossings are asynchronous -// int timer = 10; -// -// // Make sure cross hasn't already finished -// if (!presence.IsInTransit && !presence.IsChildAgent) -// { -// // If not and not in transit yet, give it some more time -// Thread.Sleep(5000); -// } -// -// // Enough time, should at least be in transit by now. -// while (presence.IsInTransit && timer > 0) -// { -// Thread.Sleep(1000); -// timer-=1; -// } -// -// Assert.That(timer,Is.GreaterThan(0),"Timed out waiting to cross 2->1."); -// Assert.That(presence.IsChildAgent, Is.True, "Did not complete region cross as expected."); -// Assert.That(presence2.IsChildAgent, Is.False, "Did not receive root status after receiving agent."); -// -// // Cross Back -// presence2.AbsolutePosition = new Vector3(-10, 3, 100); -// presence2.Update(); -// -// if (!wh.WaitOne(5000,false)) -// { -// presence2.Update(); -// if (!wh.WaitOne(8000,false)) -// throw new ArgumentException("2 - Timeout waiting for signal/variable."); -// } -// testclient.CompleteMovement(); -// -// if (!presence2.IsInTransit && !presence2.IsChildAgent) -// { -// // If not and not in transit yet, give it some more time -// Thread.Sleep(5000); -// } -// -// // Enough time, should at least be in transit by now. -// while (presence2.IsInTransit && timer > 0) -// { -// Thread.Sleep(1000); -// timer-=1; -// } -// -// Assert.That(timer,Is.GreaterThan(0),"Timed out waiting to cross 1->2."); -// Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected."); -// Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); -// } } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs new file mode 100644 index 0000000..ef9fff5 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs @@ -0,0 +1,140 @@ +/* + * 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.Reflection; +using Nini.Config; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Servers; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.CoreModules.Framework; +using OpenSim.Region.CoreModules.Framework.EntityTransfer; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + [TestFixture] + public class ScenePresenceCrossingTests : OpenSimTestCase + { + [TestFixtureSetUp] + public void FixtureInit() + { + // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread. + 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 TestCrossOnSameSimulator() + { + TestHelpers.InMethod(); + TestHelpers.EnableLogging(); + + UUID userId = TestHelpers.ParseTail(0x1); + + EntityTransferModule etmA = new EntityTransferModule(); + EntityTransferModule etmB = new EntityTransferModule(); + LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule(); + + IConfigSource config = new IniConfigSource(); + IConfig modulesConfig = config.AddConfig("Modules"); + modulesConfig.Set("EntityTransferModule", etmA.Name); + modulesConfig.Set("SimulationServices", lscm.Name); + IConfig entityTransferConfig = config.AddConfig("EntityTransfer"); + + // In order to run a single threaded regression test we do not want the entity transfer module waiting + // for a callback from the destination scene before removing its avatar data. +// entityTransferConfig.Set("wait_for_callback", false); + + SceneHelpers sh = new SceneHelpers(); + TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000); + TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1000, 999); + + SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); + SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA); + SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB); + + ScenePresence originalSp = SceneHelpers.AddScenePresence(sceneA, userId, sh.SceneManager); + originalSp.AbsolutePosition = new Vector3(128, 32, 10); + +// originalSp.Flying = true; + +// Console.WriteLine("First pos {0}", originalSp.AbsolutePosition); + + AgentUpdateArgs moveArgs = new AgentUpdateArgs(); + //moveArgs.BodyRotation = Quaternion.CreateFromEulers(Vector3.Zero); + moveArgs.BodyRotation = Quaternion.CreateFromEulers(new Vector3(0, 0, (float)-(Math.PI / 2))); + moveArgs.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS; + + originalSp.HandleAgentUpdate(originalSp.ControllingClient, moveArgs); + + sceneA.Update(1); + +// Console.WriteLine("Second pos {0}", originalSp.AbsolutePosition); + + // FIXME: This is a sufficient number of updates to for the presence to reach the northern border. + // But really we want to do this in a more robust way. + for (int i = 0; i < 100; i++) + { + sceneA.Update(1); +// Console.WriteLine("Pos {0}", originalSp.AbsolutePosition); + } + + // sceneA should now only have a child agent + ScenePresence spAfterCrossSceneA = sceneA.GetScenePresence(originalSp.UUID); + Assert.That(spAfterCrossSceneA.IsChildAgent, Is.True); + + ScenePresence spAfterCrossSceneB = sceneB.GetScenePresence(originalSp.UUID); + + // Agent remains a child until the client triggers complete movement + Assert.That(spAfterCrossSceneB.IsChildAgent, Is.True); + + TestClient sceneBTc = ((TestClient)spAfterCrossSceneB.ControllingClient); + + bool receivedCompleteMovement = false; + sceneBTc.OnReceivedMoveAgentIntoRegion += (ri, pos, look) => receivedCompleteMovement = true; + + sceneBTc.CompleteMovement(); + + Assert.That(receivedCompleteMovement, Is.True); + Assert.That(spAfterCrossSceneB.IsChildAgent, Is.False); + } + } +} \ No newline at end of file -- cgit v1.1 From f954c53ddb009009e386a4046857cc20d0fd656c Mon Sep 17 00:00:00 2001 From: teravus Date: Wed, 6 Mar 2013 17:02:53 -0500 Subject: * Separate two if trees that got merged into one if tree with borked logic. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 7cab841..e22cf47 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4574,7 +4574,8 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup.RootPart == this) AngularVelocity = new Vector3(0, 0, 0); } - else if (SetVD != wasVD) + + else { if (ParentGroup.Scene.CollidablePrims) { @@ -4620,9 +4621,31 @@ namespace OpenSim.Region.Framework.Scenes UpdatePhysicsSubscribedEvents(); } } - + if (SetVD) + { + // If the above logic worked (this is urgent candidate to unit tests!) + // we now have a physicsactor. + // Defensive programming calls for a check here. + // Better would be throwing an exception that could be catched by a unit test as the internal + // logic should make sure, this Physactor is always here. + if (pa != null) + { + pa.SetVolumeDetect(1); + AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active + VolumeDetectActive = true; + } // m_log.Debug("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); + } + else if (SetVD != wasVD) + { + // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like + // (mumbles, well, at least if you have infinte CPU powers :-)) + if (pa != null) + pa.SetVolumeDetect(0); + RemFlag(PrimFlags.Phantom); + VolumeDetectActive = false; + } // and last in case we have a new actor and not building if (ParentGroup != null) -- cgit v1.1 From 5751ecde5250484fe8e4b79ef38bfbf441e3dead Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Mar 2013 23:06:00 +0000 Subject: Add code for testing event queue messages recevied on region cross. This is currently disabled pending an improvement in the test code to properly add avatars when an event queue module is present. --- .../Scenes/Tests/ScenePresenceCrossingTests.cs | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs index ef9fff5..81a2fcc 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections.Generic; using System.Reflection; using Nini.Config; using NUnit.Framework; @@ -65,10 +66,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestCrossOnSameSimulator() { TestHelpers.InMethod(); - TestHelpers.EnableLogging(); +// TestHelpers.EnableLogging(); UUID userId = TestHelpers.ParseTail(0x1); +// TestEventQueueGetModule eqmA = new TestEventQueueGetModule(); EntityTransferModule etmA = new EntityTransferModule(); EntityTransferModule etmB = new EntityTransferModule(); LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule(); @@ -77,7 +79,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests IConfig modulesConfig = config.AddConfig("Modules"); modulesConfig.Set("EntityTransferModule", etmA.Name); modulesConfig.Set("SimulationServices", lscm.Name); - IConfig entityTransferConfig = config.AddConfig("EntityTransfer"); +// IConfig entityTransferConfig = config.AddConfig("EntityTransfer"); // In order to run a single threaded regression test we do not want the entity transfer module waiting // for a callback from the destination scene before removing its avatar data. @@ -89,6 +91,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA); +// SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, eqmA); SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB); ScenePresence originalSp = SceneHelpers.AddScenePresence(sceneA, userId, sh.SceneManager); @@ -98,6 +101,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Console.WriteLine("First pos {0}", originalSp.AbsolutePosition); +// eqmA.ClearEvents(); + AgentUpdateArgs moveArgs = new AgentUpdateArgs(); //moveArgs.BodyRotation = Quaternion.CreateFromEulers(Vector3.Zero); moveArgs.BodyRotation = Quaternion.CreateFromEulers(new Vector3(0, 0, (float)-(Math.PI / 2))); @@ -117,6 +122,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Console.WriteLine("Pos {0}", originalSp.AbsolutePosition); } + // Need to sort processing of EnableSimulator message on adding scene presences before we can test eqm + // messages +// Dictionary> eqmEvents = eqmA.Events; +// +// Assert.That(eqmEvents.Count, Is.EqualTo(1)); +// Assert.That(eqmEvents.ContainsKey(originalSp.UUID), Is.True); +// +// List spEqmEvents = eqmEvents[originalSp.UUID]; +// +// Assert.That(spEqmEvents.Count, Is.EqualTo(1)); +// Assert.That(spEqmEvents[0].Name, Is.EqualTo("CrossRegion")); + // sceneA should now only have a child agent ScenePresence spAfterCrossSceneA = sceneA.GetScenePresence(originalSp.UUID); Assert.That(spAfterCrossSceneA.IsChildAgent, Is.True); @@ -128,12 +145,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests TestClient sceneBTc = ((TestClient)spAfterCrossSceneB.ControllingClient); - bool receivedCompleteMovement = false; - sceneBTc.OnReceivedMoveAgentIntoRegion += (ri, pos, look) => receivedCompleteMovement = true; + int agentMovementCompleteReceived = 0; + sceneBTc.OnReceivedMoveAgentIntoRegion += (ri, pos, look) => agentMovementCompleteReceived++; sceneBTc.CompleteMovement(); - Assert.That(receivedCompleteMovement, Is.True); + Assert.That(agentMovementCompleteReceived, Is.EqualTo(1)); Assert.That(spAfterCrossSceneB.IsChildAgent, Is.False); } } -- cgit v1.1 From 5097437e1174d19d3dcb68e936581e60e4ef49cc Mon Sep 17 00:00:00 2001 From: teravus Date: Fri, 8 Mar 2013 19:32:47 -0500 Subject: * Apparently, sometimes texture entries come in from the wire with no default texture defined.. so apply better fallback protection against that. The net result is clients will have their selected textures set when they would have previously had an ignored exception. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index cce8b21..3e9a6fa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4503,8 +4503,25 @@ namespace OpenSim.Region.Framework.Scenes Changed changeFlags = 0; + Primitive.TextureEntryFace fallbackNewFace = newTex.DefaultTexture; + Primitive.TextureEntryFace fallbackOldFace = oldTex.DefaultTexture; + + // On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all + // other prim-sides are set, but apparently that's not always the case. Lets assume packet/data corruption at this point. + if (fallbackNewFace == null) + { + fallbackNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); + newTex.DefaultTexture = fallbackNewFace; + } + if (fallbackOldFace == null) + { + fallbackOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); + oldTex.DefaultTexture = fallbackOldFace; + } + for (int i = 0 ; i < GetNumberOfSides(); i++) { + Primitive.TextureEntryFace newFace = newTex.DefaultTexture; Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture; -- cgit v1.1 From 0c6268fe5606c197d99c81a5e84a84e667e28fe8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 11 Mar 2013 23:15:13 +0000 Subject: minor: remove mono compiler warning in SceneObjectUndoRedoTests --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs index 96973de..4883ae7 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs @@ -110,8 +110,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests Vector3 firstSize = new Vector3(2, 3, 4); Vector3 secondSize = new Vector3(5, 6, 7); - Vector3 thirdSize = new Vector3(8, 9, 10); - Vector3 fourthSize = new Vector3(11, 12, 13); +// Vector3 thirdSize = new Vector3(8, 9, 10); +// Vector3 fourthSize = new Vector3(11, 12, 13); Scene scene = new SceneHelpers().SetupScene(); scene.MaxUndoCount = 20; -- cgit v1.1 From 5c53660a7f055be9ed41f30893de673acac8a0f1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 13 Mar 2013 22:59:06 +0000 Subject: Add prototype dynamic objects map for scene object parts This allows region modules to add dynamic objects to SOPs rather than having to continually push and pull OSD dynamic attributes. This is to explore the original MOAP use case for dynamic attributes where it could be very awkward and possibly time-consuming to keep reconstructing MediaEntrys from stored DynamicAttributes. This commit adds a DOExampleModule to demonstrate/evolve this code. Dynamic objects involve no storage or persistence changes - the 'backing store' for any data that does need to be saved will remain the DAMap. DOExampleModule in this commit only attaches a fresh dynamic object. Actually constructing this from stored dynamic attributes and handling persistence is left for later. These changes should affect no existing functionality, though it may or may not reveal necessary changes in DAMap down the road. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3e9a6fa..ee7c4f4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -129,6 +129,27 @@ namespace OpenSim.Region.Framework.Scenes /// Dynamic attributes can be created and deleted as required. /// public DAMap DynAttrs { get; set; } + + private DOMap m_dynObjs; + + /// + /// Dynamic objects that can be created and deleted as required. + /// + public DOMap DynObjs + { + get + { + if (m_dynObjs == null) + m_dynObjs = new DOMap(); + + return m_dynObjs; + } + + set + { + m_dynObjs = value; + } + } /// /// Is this a root part? @@ -348,6 +369,7 @@ namespace OpenSim.Region.Framework.Scenes Rezzed = DateTime.UtcNow; Description = String.Empty; DynAttrs = new DAMap(); + DynObjs = new DOMap(); // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from -- cgit v1.1 From 48d41ef3076eb4c2a8c4a67d811630ab7b498469 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 13 Mar 2013 23:25:56 +0000 Subject: Remove unnecessary instation of DOMap() in SOP from commit 5c53660 since this is being done lazily --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ee7c4f4..a8b63fe 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -369,7 +369,6 @@ namespace OpenSim.Region.Framework.Scenes Rezzed = DateTime.UtcNow; Description = String.Empty; DynAttrs = new DAMap(); - DynObjs = new DOMap(); // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from -- cgit v1.1 From e9c394fb4ed56ffb931a0161b8c6fdc929b38058 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 14 Mar 2013 21:23:48 +0000 Subject: Make llGetObjectDetails() return the correct world rotation for a sitting avatar This addresses http://opensimulator.org/mantis/view.php?id=6567 This creates a ScenePresence.GetWorldRotation() with the same semantics as SOP.GetWorldRotation() SP.Rotation can't be used since it's relative to the sat upon prim if the avatar is sitting. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 40 +++++++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a7c7539..82bb759 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -559,16 +559,28 @@ namespace OpenSim.Region.Framework.Scenes private Quaternion m_bodyRot = Quaternion.Identity; + /// + /// The rotation of the avatar. + /// + /// + /// If the avatar is not sitting, this is with respect to the world + /// If the avatar is sitting, this is a with respect to the part that it's sitting upon (a local rotation). + /// If you always want the world rotation, use GetWorldRotation() + /// public Quaternion Rotation { - get { return m_bodyRot; } + get + { + return m_bodyRot; + } + set { m_bodyRot = value; + if (PhysicsActor != null) - { PhysicsActor.Orientation = m_bodyRot; - } + // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, m_bodyRot); } } @@ -608,6 +620,26 @@ namespace OpenSim.Region.Framework.Scenes set { m_health = value; } } + /// + /// Gets the world rotation of this presence. + /// + /// + /// Unlike Rotation, this returns the world rotation no matter whether the avatar is sitting on a prim or not. + /// + /// + public Quaternion GetWorldRotation() + { + if (IsSatOnObject) + { + SceneObjectPart sitPart = ParentPart; + + if (sitPart != null) + return sitPart.GetWorldRotation() * Rotation; + } + + return Rotation; + } + public void AdjustKnownSeeds() { Dictionary seeds; @@ -709,8 +741,6 @@ namespace OpenSim.Region.Framework.Scenes #endregion - - #region Constructor(s) public ScenePresence( -- cgit v1.1 From fcecfc81bbd6ee8ebfa2dc0585d92ebf899358c1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 18 Mar 2013 22:56:03 +0000 Subject: Multiattach, part 1 Conflicts: OpenSim/Framework/AvatarAppearance.cs OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs --- OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 620ec22..46daab3 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// true if the object was successfully attached, false otherwise - bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool temp); + bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool temp, bool append); /// /// Rez an attachment from user inventory and change inventory status to match. diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 14dac7a..3c91c5b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2741,7 +2741,7 @@ namespace OpenSim.Region.Framework.Scenes RootPrim.RemFlag(PrimFlags.TemporaryOnRez); if (AttachmentsModule != null) - AttachmentsModule.AttachObject(sp, grp, 0, false, false); + AttachmentsModule.AttachObject(sp, grp, 0, false, false, true); } else { -- cgit v1.1 From 3cb1c23554439dc1f9ea2911a27d16de986e2ffd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 20 Mar 2013 01:46:50 +0000 Subject: Force a viewer object update for attachments at the end of the final Scene.CompleteMovement() in order to make all multi-attachments appear on the destination region. For some reason, sending updates before this will not have this effect. This may be something related to some viewers (e.g. LL 3.3.4) or something OpenSimulator isn't getting quite right. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 82bb759..6d96c93 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1326,6 +1326,15 @@ namespace OpenSim.Region.Framework.Scenes friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); } + // XXX: If we force an update here, then multiple attachments do appear correctly on a destination region + // If we do it a little bit earlier (e.g. when converting the child to a root agent) then this does not work. + // This may be due to viewer code or it may be something we're not doing properly simulator side. + lock (m_attachments) + { + foreach (SceneObjectGroup sog in m_attachments) + sog.ScheduleGroupForFullUpdate(); + } + // m_log.DebugFormat( // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); -- cgit v1.1 From 8de933ab07a0f9e8291d705a9a03d5b1ba60caa9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 20 Mar 2013 02:09:25 +0000 Subject: Insert a short delay on the simulator side rezzing of attachments in order to fix viewer 3 issues if its own rezzing actions on login collide with the simulator side actions. This resolves issues (at least in my tests with LL 3.3.4) where this can make attachments invisible until one zooms in on the avatar. This doesn't affect version 1 viewers since this delay is shorter than the login delay. This doesn't increase the login time since this part of the process was already being performed asynchronously. This may be a temporary solution. --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3c91c5b..89eca32 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2832,7 +2832,7 @@ namespace OpenSim.Region.Framework.Scenes sp.IsChildAgent = false; if (AttachmentsModule != null) - Util.FireAndForget(delegate(object o) { AttachmentsModule.RezAttachments(sp); }); + Util.FireAndForget(o => { Thread.Sleep(5000); AttachmentsModule.RezAttachments(sp); }); } } else -- cgit v1.1 From 36651bed71ce1011c376078943a4fef7e8a9ada6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 20 Mar 2013 23:01:16 +0000 Subject: On the later forms of teleport failure, tell the user if this was because viewer couldn't/didn't connect with destination or if destination didn't signal teleport completion. Also adds regression test for the case where the viewer couldn't connect with the destination region. Also refactoring of regression test support code associated with entity transfer in order to make this test possible and the code less obscure. --- .../Scenes/Tests/ScenePresenceCrossingTests.cs | 9 +- .../Scenes/Tests/ScenePresenceTeleportTests.cs | 135 +++++++++++++++++---- 2 files changed, 121 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs index 81a2fcc..b67b8b9 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestCrossOnSameSimulator() { TestHelpers.InMethod(); -// TestHelpers.EnableLogging(); + TestHelpers.EnableLogging(); UUID userId = TestHelpers.ParseTail(0x1); @@ -94,7 +94,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests // SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, eqmA); SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB); - ScenePresence originalSp = SceneHelpers.AddScenePresence(sceneA, userId, sh.SceneManager); + AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId); + TestClient tc = new TestClient(acd, sceneA, sh.SceneManager); + List destinationTestClients = new List(); + EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients); + + ScenePresence originalSp = SceneHelpers.AddScenePresence(sceneA, tc, acd, sh.SceneManager); originalSp.AbsolutePosition = new Vector3(128, 32, 10); // originalSp.Flying = true; diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index 8dd1f3d..d6bc313 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs @@ -26,7 +26,10 @@ */ using System; -using System.Reflection; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; using Nini.Config; using NUnit.Framework; using OpenMetaverse; @@ -40,8 +43,6 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; using OpenSim.Region.CoreModules.World.Permissions; using OpenSim.Tests.Common; using OpenSim.Tests.Common.Mock; -using System.IO; -using System.Text; namespace OpenSim.Region.Framework.Scenes.Tests { @@ -68,7 +69,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] - public void TestSameRegionTeleport() + public void TestSameRegion() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -106,10 +107,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] - public void TestSameSimulatorSeparatedRegionsTeleport() + public void TestSameSimulatorSeparatedRegions() { TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); +// TestHelpers.EnableLogging(); UUID userId = TestHelpers.ParseTail(0x1); @@ -141,9 +142,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests ScenePresence sp = SceneHelpers.AddScenePresence(sceneA, userId, sh.SceneManager); sp.AbsolutePosition = new Vector3(30, 31, 32); - // XXX: A very nasty hack to tell the client about the destination scene without having to crank the whole - // UDP stack (?) -// ((TestClient)sp.ControllingClient).TeleportTargetScene = sceneB; + List destinationTestClients = new List(); + EntityTransferHelpers.SetUpInformClientOfNeighbour((TestClient)sp.ControllingClient, destinationTestClients); sceneA.RequestTeleportLocation( sp.ControllingClient, @@ -152,7 +152,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests teleportLookAt, (uint)TeleportFlags.ViaLocation); - ((TestClient)sp.ControllingClient).CompleteTeleportClientSide(); + // SetupInformClientOfNeighbour() will have handled the callback into the target scene to setup the child + // agent. This call will now complete the movement of the user into the destination and upgrade the agent + // from child to root. + destinationTestClients[0].CompleteMovement(); Assert.That(sceneA.GetScenePresence(userId), Is.Null); @@ -177,7 +180,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Test teleport procedures when the target simulator returns false when queried about access. /// [Test] - public void TestSameSimulatorSeparatedRegionsQueryAccessFails() + public void TestSameSimulatorSeparatedRegions_DeniedOnQueryAccess() { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); @@ -261,7 +264,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Test teleport procedures when the target simulator create agent step is refused. /// [Test] - public void TestSameSimulatorSeparatedRegionsCreateAgentFails() + public void TestSameSimulatorSeparatedRegions_DeniedOnCreateAgent() { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); @@ -333,13 +336,101 @@ namespace OpenSim.Region.Framework.Scenes.Tests // TestHelpers.DisableLogging(); } + /// + /// Test teleport when the destination region does not process (or does not receive) the connection attempt + /// from the viewer. + /// + /// + /// This could be quite a common case where the source region can connect to a remove destination region + /// (for CreateAgent) but the viewer cannot reach the destination region due to network issues. + /// [Test] - public void TestSameSimulatorNeighbouringRegionsTeleport() + public void TestSameSimulatorSeparatedRegions_DestinationDidNotProcessViewerConnection() { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); UUID userId = TestHelpers.ParseTail(0x1); + Vector3 preTeleportPosition = new Vector3(30, 31, 32); + + EntityTransferModule etmA = new EntityTransferModule(); + EntityTransferModule etmB = new EntityTransferModule(); + + LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule(); + + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("EntityTransferModule", etmA.Name); + config.Configs["Modules"].Set("SimulationServices", lscm.Name); + + config.AddConfig("EntityTransfer"); + + // In order to run a single threaded regression test we do not want the entity transfer module waiting + // for a callback from the destination scene before removing its avatar data. + config.Configs["EntityTransfer"].Set("wait_for_callback", false); + +// config.AddConfig("Startup"); +// config.Configs["Startup"].Set("serverside_object_permissions", true); + + SceneHelpers sh = new SceneHelpers(); + TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000); + TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000); + + SceneHelpers.SetupSceneModules(sceneA, config, etmA ); + + // We need to set up the permisions module on scene B so that our later use of agent limit to deny + // QueryAccess won't succeed anyway because administrators are always allowed in and the default + // IsAdministrator if no permissions module is present is true. + SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule(), etmB }); + + // Shared scene modules + SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); + + Vector3 teleportPosition = new Vector3(10, 11, 12); + Vector3 teleportLookAt = new Vector3(20, 21, 22); + + ScenePresence sp = SceneHelpers.AddScenePresence(sceneA, userId, sh.SceneManager); + sp.AbsolutePosition = preTeleportPosition; + + sceneA.RequestTeleportLocation( + sp.ControllingClient, + sceneB.RegionInfo.RegionHandle, + teleportPosition, + teleportLookAt, + (uint)TeleportFlags.ViaLocation); + + // FIXME: Not setting up InformClientOfNeighbour on the TestClient means that it does not initiate + // communication with the destination region. But this is a very non-obvious way of doing it - really we + // should be forced to expicitly set this up. + + Assert.That(sceneB.GetScenePresence(userId), Is.Null); + + ScenePresence sceneASp = sceneA.GetScenePresence(userId); + Assert.That(sceneASp, Is.Not.Null); + Assert.That(sceneASp.Scene.RegionInfo.RegionName, Is.EqualTo(sceneA.RegionInfo.RegionName)); + Assert.That(sceneASp.AbsolutePosition, Is.EqualTo(preTeleportPosition)); + + Assert.That(sceneA.GetRootAgentCount(), Is.EqualTo(1)); + Assert.That(sceneA.GetChildAgentCount(), Is.EqualTo(0)); + Assert.That(sceneB.GetRootAgentCount(), Is.EqualTo(0)); + Assert.That(sceneB.GetChildAgentCount(), Is.EqualTo(0)); + + // TODO: Add assertions to check correct circuit details in both scenes. + + // Lookat is sent to the client only - sp.Lookat does not yield the same thing (calculation from camera + // position instead). +// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt)); + +// TestHelpers.DisableLogging(); + } + + [Test] + public void TestSameSimulatorNeighbouringRegions() + { + TestHelpers.InMethod(); + TestHelpers.EnableLogging(); + + UUID userId = TestHelpers.ParseTail(0x1); EntityTransferModule etmA = new EntityTransferModule(); EntityTransferModule etmB = new EntityTransferModule(); @@ -366,10 +457,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests Vector3 teleportPosition = new Vector3(10, 11, 12); Vector3 teleportLookAt = new Vector3(20, 21, 22); - ScenePresence originalSp = SceneHelpers.AddScenePresence(sceneA, userId, sh.SceneManager); - originalSp.AbsolutePosition = new Vector3(30, 31, 32); + AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId); + TestClient tc = new TestClient(acd, sceneA, sh.SceneManager); + List destinationTestClients = new List(); + EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients); + + ScenePresence beforeSceneASp = SceneHelpers.AddScenePresence(sceneA, tc, acd, sh.SceneManager); + beforeSceneASp.AbsolutePosition = new Vector3(30, 31, 32); - ScenePresence beforeSceneASp = sceneA.GetScenePresence(userId); Assert.That(beforeSceneASp, Is.Not.Null); Assert.That(beforeSceneASp.IsChildAgent, Is.False); @@ -377,10 +472,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(beforeSceneBSp, Is.Not.Null); Assert.That(beforeSceneBSp.IsChildAgent, Is.True); - // XXX: A very nasty hack to tell the client about the destination scene without having to crank the whole - // UDP stack (?) -// ((TestClient)beforeSceneASp.ControllingClient).TeleportTargetScene = sceneB; - + // In this case, we will not receieve a second InformClientOfNeighbour since the viewer already knows + // about the neighbour region it is teleporting to. sceneA.RequestTeleportLocation( beforeSceneASp.ControllingClient, sceneB.RegionInfo.RegionHandle, @@ -388,7 +481,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests teleportLookAt, (uint)TeleportFlags.ViaLocation); - ((TestClient)beforeSceneASp.ControllingClient).CompleteTeleportClientSide(); + destinationTestClients[0].CompleteMovement(); ScenePresence afterSceneASp = sceneA.GetScenePresence(userId); Assert.That(afterSceneASp, Is.Not.Null); -- cgit v1.1 From b1cd1d917e25e34c2efda65ab52164269863da87 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 20 Mar 2013 23:12:13 +0000 Subject: minor: don't bother with the pause before rezzing attachments if we are running regression tests (fire and forget calls launched on the same thread). Also adds code comments as to why this pause exists. --- OpenSim/Region/Framework/Scenes/Scene.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 89eca32..c9c0662 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2831,8 +2831,22 @@ namespace OpenSim.Region.Framework.Scenes // XXX: This is convoluted. sp.IsChildAgent = false; + // We leave a 5 second pause before attempting to rez attachments to avoid a clash with + // version 3 viewers that maybe doing their own attachment rezzing related to their current + // outfit folder on startup. If these operations do clash, then the symptoms are invisible + // attachments until one zooms in on the avatar. + // + // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly + // delaying any attachment related regression tests. if (AttachmentsModule != null) - Util.FireAndForget(o => { Thread.Sleep(5000); AttachmentsModule.RezAttachments(sp); }); + Util.FireAndForget( + o => + { + if (Util.FireAndForgetMethod != FireAndForgetMethod.None) + Thread.Sleep(5000); + + AttachmentsModule.RezAttachments(sp); + }); } } else -- cgit v1.1 From 4de530af45c86a003676a10d6b037a5acec3646c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 20 Mar 2013 23:13:12 +0000 Subject: minor: disable logging on regression TestCrossOnSameSimulator() that I accidentally left on a few commits ago. --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs index b67b8b9..8775949 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestCrossOnSameSimulator() { TestHelpers.InMethod(); - TestHelpers.EnableLogging(); +// TestHelpers.EnableLogging(); UUID userId = TestHelpers.ParseTail(0x1); -- cgit v1.1 From cc504eb0d136d6555ddae990a98592eaf123816a Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 21 Mar 2013 01:44:09 +0100 Subject: Fix SceneManager to use the new automatic property throughout. --- OpenSim/Region/Framework/Scenes/SceneManager.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index c307f7a..c70342f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -100,7 +100,6 @@ namespace OpenSim.Region.Framework.Scenes } private readonly DoubleDictionary m_localScenes = new DoubleDictionary(); - private Scene m_currentScene = null; public List Scenes { @@ -354,7 +353,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_localScenes.TryGetValue(regionName, out s)) { - m_currentScene = s; + CurrentScene = s; return true; } @@ -370,7 +369,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_localScenes.TryGetValue(regionID, out s)) { - m_currentScene = s; + CurrentScene = s; return true; } -- cgit v1.1 From 46c833810ccd9dd0c3273803e208dc85bb0860a9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 21 Mar 2013 00:46:08 +0000 Subject: On a teleport, lock m_agentsInTransit whilst we grab the value to check for completion just to be sure we're not using a thread cached version. --- .../Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index d6bc313..de4458d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs @@ -107,7 +107,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] - public void TestSameSimulatorSeparatedRegions() + public void TestSameSimulatorIsolatedRegions() { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); @@ -180,7 +180,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Test teleport procedures when the target simulator returns false when queried about access. /// [Test] - public void TestSameSimulatorSeparatedRegions_DeniedOnQueryAccess() + public void TestSameSimulatorIsolatedRegions_DeniedOnQueryAccess() { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); @@ -264,7 +264,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// Test teleport procedures when the target simulator create agent step is refused. /// [Test] - public void TestSameSimulatorSeparatedRegions_DeniedOnCreateAgent() + public void TestSameSimulatorIsolatedRegions_DeniedOnCreateAgent() { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); @@ -345,7 +345,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests /// (for CreateAgent) but the viewer cannot reach the destination region due to network issues. /// [Test] - public void TestSameSimulatorSeparatedRegions_DestinationDidNotProcessViewerConnection() + public void TestSameSimulatorIsolatedRegions_DestinationDidNotProcessViewerConnection() { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); -- cgit v1.1 From 93206ef0fa6dffe93313455b3354ce3787e7262d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Mar 2013 00:39:03 +0000 Subject: Add "show borders" command to show the borders of a region. This is relevant to mega-regions where the borders are very different to a regular region. Also adds some method doc and other code comments. --- OpenSim/Region/Framework/Scenes/Border.cs | 7 +++++-- OpenSim/Region/Framework/Scenes/Scene.cs | 1 - OpenSim/Region/Framework/Scenes/ScenePresence.cs | 14 +++++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Border.cs b/OpenSim/Region/Framework/Scenes/Border.cs index c6a6511..08c0c31 100644 --- a/OpenSim/Region/Framework/Scenes/Border.cs +++ b/OpenSim/Region/Framework/Scenes/Border.cs @@ -33,8 +33,7 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Scenes { public class Border - { - + { /// /// Line perpendicular to the Direction Cardinal. Z value is the /// @@ -81,6 +80,10 @@ namespace OpenSim.Region.Framework.Scenes TriggerRegionY = triggerRegionY; } + /// + /// Tests to see if the given position would cross this border. + /// + /// public bool TestCross(Vector3 position) { bool result = false; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c9c0662..e8f00a4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2541,7 +2541,6 @@ namespace OpenSim.Region.Framework.Scenes } } - return null; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6d96c93..f7ae3a2 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -442,9 +442,9 @@ namespace OpenSim.Region.Framework.Scenes { m_pos = PhysicsActor.Position; - //m_log.DebugFormat( - // "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!", - // m_pos, Name, Scene.RegionInfo.RegionName); +// m_log.DebugFormat( +// "[SCENE PRESENCE]: Set position of {0} in {1} to {2} via getting AbsolutePosition!", +// Name, Scene.Name, m_pos); } else { @@ -471,6 +471,9 @@ namespace OpenSim.Region.Framework.Scenes } set { +// m_log.DebugFormat("[SCENE PRESENCE]: Setting position of {0} in {1} to {2}", Name, Scene.Name, value); +// Util.PrintCallStack(); + if (PhysicsActor != null) { try @@ -878,6 +881,7 @@ namespace OpenSim.Region.Framework.Scenes // before the inventory is processed in MakeRootAgent. This fixes a race condition // related to the handling of attachments //m_scene.GetAvatarAppearance(ControllingClient, out Appearance); + if (m_scene.TestBorderCross(pos, Cardinals.E)) { Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E); @@ -2909,6 +2913,10 @@ namespace OpenSim.Region.Framework.Scenes if (!IsInTransit) { +// m_log.DebugFormat( +// "[SCENE PRESENCE]: Testing border check for projected position {0} of {1} in {2}", +// pos2, Name, Scene.Name); + // Checks if where it's headed exists a region bool needsTransit = false; if (m_scene.TestBorderCross(pos2, Cardinals.W)) -- cgit v1.1 From 01636ca90015561366130a3db9b19e4eb976b80a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Mar 2013 00:47:59 +0000 Subject: Fix teleporting into the non-SW 256x256 corner of a megaregion, though currently with a 10 second delay before auto-reteleport to the correct location. This now does a check for border crossing (required to trigger the teleport) immediately in SP.MakeRootAgent(). If left any later, it looks like the physics scene changes the position and stops the cross happening. If done any earlier, nothing happens because the cross-code currently requires a PhysicsActor to be in place, thuogh it's probably not necessary for this case. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f7ae3a2..f3b923f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -925,6 +925,13 @@ namespace OpenSim.Region.Framework.Scenes AddToPhysicalScene(isFlying); + // XXX: This is to trigger any secondary teleport needed for a megaregion when the user has teleported to a + // location outside the 'root region' (the south-west 256x256 corner). This is the earlist we can do it + // since it requires a physics actor to be present. If it is left any later, then physics appears to reset + // the value to a negative position which does not trigger the border cross. + // This may not be the best location for this. + CheckForBorderCrossing(); + if (ForceFly) { Flying = true; -- cgit v1.1 From c341664c1b8ccf3bd7b81795b900b971a15ff318 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 24 Mar 2013 18:56:28 +0100 Subject: Phase 1 of implementing a transfer permission. Overwrite libOMV's PermissionMask with our own and add export permissions as well as a new definition for "All" as meaning "all conventional permissions" rather than "all possible permissions" --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 7 ++++--- OpenSim/Region/Framework/Scenes/Scene.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index a9e1fc2..6a3fb24 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -39,6 +39,7 @@ using OpenSim.Region.Framework; using OpenSim.Framework.Client; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Serialization; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { @@ -907,7 +908,7 @@ namespace OpenSim.Region.Framework.Scenes { CreateNewInventoryItem( remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, asset, invType, - (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, 0, creationDate, transationID); + (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, creationDate, transationID); } @@ -1036,8 +1037,8 @@ namespace OpenSim.Region.Framework.Scenes CreateNewInventoryItem( remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, name, description, 0, callbackID, asset, invType, - (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, - (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); + (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All, + (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, Util.UnixTimeSinceEpoch()); } else { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6b031ae..357a94b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -51,6 +51,7 @@ using OpenSim.Region.Physics.Manager; using Timer=System.Timers.Timer; using TPFlags = OpenSim.Framework.Constants.TeleportFlags; using GridRegion = OpenSim.Services.Interfaces.GridRegion; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 26524fb..f8624e7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -34,6 +34,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using System.Collections.Generic; using System.Xml; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 0f5d116..b109b4f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -41,6 +41,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Physics.Manager; using OpenSim.Region.Framework.Scenes.Serialization; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ffde415..9265805 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -43,6 +43,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Region.Physics.Manager; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 3a9a146..d04d87b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -38,6 +38,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; using OpenSim.Region.Framework.Scenes.Serialization; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { -- cgit v1.1 From 5f4c4df227025c6b6156ce8238b56553dca4b5ae Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 26 Mar 2013 03:40:06 +0000 Subject: Phase 1 of implementing a transfer permission. Overwrite libOMV's PermissionMask with our own and add export permissions as well as a new definition for "All" as meaning "all conventional permissions" rather than "all possible permissions" --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 7 ++++--- OpenSim/Region/Framework/Scenes/Scene.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 6808017..2ce778d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -39,6 +39,7 @@ using OpenSim.Region.Framework; using OpenSim.Framework.Client; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Serialization; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { @@ -892,7 +893,7 @@ namespace OpenSim.Region.Framework.Scenes { CreateNewInventoryItem( remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, asset, invType, - (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, 0, creationDate); + (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, creationDate); } /// @@ -1010,8 +1011,8 @@ namespace OpenSim.Region.Framework.Scenes CreateNewInventoryItem( remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, name, description, 0, callbackID, asset, invType, - (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, - (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); + (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All, + (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, Util.UnixTimeSinceEpoch()); } else { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e8f00a4..45cbdd5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -51,6 +51,7 @@ using OpenSim.Region.Physics.Manager; using Timer=System.Timers.Timer; using TPFlags = OpenSim.Framework.Constants.TeleportFlags; using GridRegion = OpenSim.Services.Interfaces.GridRegion; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index ddf5da0..dcb62f8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -34,6 +34,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using System.Collections.Generic; using System.Xml; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 15795e5..0621e2a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -40,6 +40,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Physics.Manager; using OpenSim.Region.Framework.Scenes.Serialization; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a8b63fe..27325c5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -43,6 +43,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Region.Physics.Manager; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index db723fa..7dba7c8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -38,6 +38,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; using OpenSim.Region.Framework.Scenes.Serialization; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Region.Framework.Scenes { -- cgit v1.1 From c2093ccce16cd5210c8e0759f23b5b4bd205b7af Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Mar 2013 22:07:58 +0000 Subject: Move the simulator-side RezAttachments call on login to SP.MakeRootAgent with the other attachments code, using TeleportFlags.ViaLogin check to fire if necessary. This is to simplify the code (no tricky 'wasChild' signalling required) and to reduce the risk of a thread clash between simulator-side attaching (necessary for v1 viewers) and the viewer-side attaching the v3 viewers perform. --- OpenSim/Region/Framework/Scenes/Scene.cs | 28 ---------------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 41 ++++++++++++++++++------ 2 files changed, 31 insertions(+), 38 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 45cbdd5..0ac4027 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2820,34 +2820,6 @@ namespace OpenSim.Region.Framework.Scenes m_eventManager.TriggerOnNewPresence(sp); sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags; - - // The first agent upon login is a root agent by design. - // For this agent we will have to rez the attachments. - // All other AddNewClient calls find aCircuit.child to be true. - if (aCircuit.child == false) - { - // We have to set SP to be a root agent here so that SP.MakeRootAgent() will later not try to - // start the scripts again (since this is done in RezAttachments()). - // XXX: This is convoluted. - sp.IsChildAgent = false; - - // We leave a 5 second pause before attempting to rez attachments to avoid a clash with - // version 3 viewers that maybe doing their own attachment rezzing related to their current - // outfit folder on startup. If these operations do clash, then the symptoms are invisible - // attachments until one zooms in on the avatar. - // - // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly - // delaying any attachment related regression tests. - if (AttachmentsModule != null) - Util.FireAndForget( - o => - { - if (Util.FireAndForgetMethod != FireAndForgetMethod.None) - Thread.Sleep(5000); - - AttachmentsModule.RezAttachments(sp); - }); - } } else { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f3b923f..4fb9a1b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -866,7 +866,6 @@ namespace OpenSim.Region.Framework.Scenes //m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count); - bool wasChild = IsChildAgent; IsChildAgent = false; IGroupsModule gm = m_scene.RequestModuleInterface(); @@ -952,18 +951,40 @@ namespace OpenSim.Region.Framework.Scenes // and it has already rezzed the attachments and started their scripts. // We do the following only for non-login agents, because their scripts // haven't started yet. - lock (m_attachments) + if ((TeleportFlags & TeleportFlags.ViaLogin) != 0) + { + // We leave a 5 second pause before attempting to rez attachments to avoid a clash with + // version 3 viewers that maybe doing their own attachment rezzing related to their current + // outfit folder on startup. If these operations do clash, then the symptoms are invisible + // attachments until one zooms in on the avatar. + // + // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly + // delaying any attachment related regression tests. + if (Scene.AttachmentsModule != null) + Util.FireAndForget( + o => + { + if (Util.FireAndForgetMethod != FireAndForgetMethod.None) + System.Threading.Thread.Sleep(5000); + + Scene.AttachmentsModule.RezAttachments(this); + }); + } + else { - if (wasChild && HasAttachments()) + lock (m_attachments) { - m_log.DebugFormat( - "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); - - // Resume scripts - foreach (SceneObjectGroup sog in m_attachments) + if (HasAttachments()) { - sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); - sog.ResumeScripts(); + m_log.DebugFormat( + "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); + + // Resume scripts + foreach (SceneObjectGroup sog in m_attachments) + { + sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); + sog.ResumeScripts(); + } } } } -- cgit v1.1 From 3b377f16b29a6395d73af1cc987cb9abf9935376 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Mar 2013 22:44:59 +0000 Subject: Fix regression tests by making a new NPC always trigger simulator side attachment code when created. Regression from previous commit c2093ccc. Failed because NPCs don't set the ViaLogin flag --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4fb9a1b..3a1e758 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -951,7 +951,7 @@ namespace OpenSim.Region.Framework.Scenes // and it has already rezzed the attachments and started their scripts. // We do the following only for non-login agents, because their scripts // haven't started yet. - if ((TeleportFlags & TeleportFlags.ViaLogin) != 0) + if (PresenceType == PresenceType.Npc || (TeleportFlags & TeleportFlags.ViaLogin) != 0) { // We leave a 5 second pause before attempting to rez attachments to avoid a clash with // version 3 viewers that maybe doing their own attachment rezzing related to their current @@ -964,7 +964,7 @@ namespace OpenSim.Region.Framework.Scenes Util.FireAndForget( o => { - if (Util.FireAndForgetMethod != FireAndForgetMethod.None) + if (PresenceType != PresenceType.Npc && Util.FireAndForgetMethod != FireAndForgetMethod.None) System.Threading.Thread.Sleep(5000); Scene.AttachmentsModule.RezAttachments(this); -- cgit v1.1 From 4ad9b275302ee109937512963eab095ff542a0c7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Mar 2013 22:51:59 +0000 Subject: If the viewer has already rezzed any attachments itself, then ignore the simulator-side rez attachments call. This is a further effort to reduce v3 viewer race conditions where this call may clash with the viewer signalling attachment wearing from its current outfit folder. --- OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 4 ++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 +++++------- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 46daab3..156a09d 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -53,6 +53,10 @@ namespace OpenSim.Region.Framework.Interfaces /// RezAttachments. This should only be called upon login on the first region. /// Attachment rezzings on crossings and TPs are done in a different way. /// + /// + /// This is only actually necessary for viewers which do not have a current outfit folder (these viewers make + /// their own attachment calls on login) and agents which have attachments but no viewer (e.g. NPCs). + /// /// void RezAttachments(IScenePresence sp); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3a1e758..fcb2f6d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -953,13 +953,11 @@ namespace OpenSim.Region.Framework.Scenes // haven't started yet. if (PresenceType == PresenceType.Npc || (TeleportFlags & TeleportFlags.ViaLogin) != 0) { - // We leave a 5 second pause before attempting to rez attachments to avoid a clash with - // version 3 viewers that maybe doing their own attachment rezzing related to their current - // outfit folder on startup. If these operations do clash, then the symptoms are invisible - // attachments until one zooms in on the avatar. - // - // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly - // delaying any attachment related regression tests. + // Viewers which have a current outfit folder will actually rez their own attachments. However, + // viewers without (e.g. v1 viewers) will not, so we still need to make this call. + // + // However, we leave a 5 second pause to try and avoid a clash with viewers that are rezzing + // attachments themselves. This should then mean that this call ends up doing nothing. if (Scene.AttachmentsModule != null) Util.FireAndForget( o => -- cgit v1.1 From 03e421bf3d796bf3498f4f3311c59ce04fb1fea1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Mar 2013 22:55:13 +0000 Subject: minor: comment out unused Scene.AgentCrossing() to reduce code complexity --- OpenSim/Region/Framework/Scenes/Scene.cs | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0ac4027..5337835 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4103,33 +4103,33 @@ namespace OpenSim.Region.Framework.Scenes // } // } - /// - /// Triggered when an agent crosses into this sim. Also happens on initial login. - /// - /// - /// - /// - public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) - { - ScenePresence presence = GetScenePresence(agentID); - if (presence != null) - { - try - { - presence.MakeRootAgent(position, isFlying); - } - catch (Exception e) - { - m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace); - } - } - else - { - m_log.ErrorFormat( - "[SCENE]: Could not find presence for agent {0} crossing into scene {1}", - agentID, RegionInfo.RegionName); - } - } +// /// +// /// Triggered when an agent crosses into this sim. Also happens on initial login. +// /// +// /// +// /// +// /// +// public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) +// { +// ScenePresence presence = GetScenePresence(agentID); +// if (presence != null) +// { +// try +// { +// presence.MakeRootAgent(position, isFlying); +// } +// catch (Exception e) +// { +// m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace); +// } +// } +// else +// { +// m_log.ErrorFormat( +// "[SCENE]: Could not find presence for agent {0} crossing into scene {1}", +// agentID, RegionInfo.RegionName); +// } +// } /// /// We've got an update about an agent that sees into this region, -- cgit v1.1 From c92654fb43f303da8e1623f9fff8a404aad72374 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Mar 2013 23:57:35 +0000 Subject: Stop attempts to update/add existing attachments in user inventory when teleporting between regions. This appears to resolve issues on teleport where attachments disappear or become labelled as invalid within user inventory. --- OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 156a09d..d9901bd 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -80,14 +80,16 @@ namespace OpenSim.Region.Framework.Interfaces void DeleteAttachmentsFromScene(IScenePresence sp, bool silent); /// - /// Attach an object to an avatar + /// Attach an object to an avatar. /// /// /// /// /// + /// If true then add object to user inventory + /// Append to attachment point rather than replace. /// true if the object was successfully attached, false otherwise - bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool temp, bool append); + bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool addToInventory, bool append); /// /// Rez an attachment from user inventory and change inventory status to match. -- cgit v1.1 From 285bd3abc87aced43efa9519a5760d9dae3f50d9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Mar 2013 00:49:55 +0000 Subject: Eliminate code which tries to restart attachment scripts in ScenePresence.MakeRootAgent(), since this is already done in AttachmentsModule --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fcb2f6d..6591fef 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -968,24 +968,6 @@ namespace OpenSim.Region.Framework.Scenes Scene.AttachmentsModule.RezAttachments(this); }); } - else - { - lock (m_attachments) - { - if (HasAttachments()) - { - m_log.DebugFormat( - "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); - - // Resume scripts - foreach (SceneObjectGroup sog in m_attachments) - { - sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); - sog.ResumeScripts(); - } - } - } - } // send the animations of the other presences to me m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) -- cgit v1.1 From 23ae4c0a4d813763bcc39db7693850a21727d7f2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Mar 2013 02:21:38 +0000 Subject: Fix bug where CHANGED_REGION and/or CHANGED_TELEPORT weren't firing for scripts in attachments. This was because the script resumption in AttachmentsModule was firing the attach event instead. Had to reinstate the code in 285bd3a do we can resume the scripts there instead, though the bug existed before its removal. This is to resolve http://opensimulator.org/mantis/view.php?id=6578 --- OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++++- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5337835..911a3e4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2739,7 +2739,10 @@ namespace OpenSim.Region.Framework.Scenes // "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); RootPrim.RemFlag(PrimFlags.TemporaryOnRez); - + + // We must currently not resume scripts at this stage since AttachmentsModule does not have the + // information that this is due to a teleport/border cross rather than an ordinary attachment. + // We currently do this in Scene.MakeRootAgent() instead. if (AttachmentsModule != null) AttachmentsModule.AttachObject(sp, grp, 0, false, false, true); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 27325c5..847df03 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3203,6 +3203,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void SetScriptEvents(UUID scriptid, int events) { +// m_log.DebugFormat( +// "[SCENE OBJECT PART]: Set script events for script with id {0} on {1}/{2} to {3} in {4}", +// scriptid, Name, ParentGroup.Name, events, ParentGroup.Scene.Name); + // scriptEvents oldparts; lock (m_scriptEvents) { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6591fef..4930a39 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -968,6 +968,28 @@ namespace OpenSim.Region.Framework.Scenes Scene.AttachmentsModule.RezAttachments(this); }); } + else + { + // We need to restart scripts here so that they receive the correct changed events (CHANGED_TELEPORT + // and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently + // be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are + // not transporting the required data. + lock (m_attachments) + { + if (HasAttachments()) + { + m_log.DebugFormat( + "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); + + // Resume scripts + foreach (SceneObjectGroup sog in m_attachments) + { + sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); + sog.ResumeScripts(); + } + } + } + } // send the animations of the other presences to me m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) -- cgit v1.1 From 023faa227ef72a3701dc5fbfc46ab5f831c54953 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Mar 2013 23:10:28 +0000 Subject: Check viewer 2/3 attachment calls against avatar appearance attachment data rather than actually attached objects By checking against the grid's Avatar data, we can ignore viewer side attachments but still initiate these calls simulator-side. Initiating simulator-side is always necessary for version 1 viewers. This is a further commit to resolve http://opensimulator.org/mantis/view.php?id=6581 --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4930a39..215a689 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -955,15 +955,12 @@ namespace OpenSim.Region.Framework.Scenes { // Viewers which have a current outfit folder will actually rez their own attachments. However, // viewers without (e.g. v1 viewers) will not, so we still need to make this call. - // - // However, we leave a 5 second pause to try and avoid a clash with viewers that are rezzing - // attachments themselves. This should then mean that this call ends up doing nothing. if (Scene.AttachmentsModule != null) Util.FireAndForget( o => { - if (PresenceType != PresenceType.Npc && Util.FireAndForgetMethod != FireAndForgetMethod.None) - System.Threading.Thread.Sleep(5000); +// if (PresenceType != PresenceType.Npc && Util.FireAndForgetMethod != FireAndForgetMethod.None) +// System.Threading.Thread.Sleep(7000); Scene.AttachmentsModule.RezAttachments(this); }); -- cgit v1.1 From cbc9ae898c474295567532c668644d09b698d59b Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Wed, 27 Mar 2013 17:26:17 -0400 Subject: Added missing functionality (mainly custom headers) to llHTTPRequest. --- OpenSim/Region/Framework/Interfaces/IHttpRequests.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs b/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs index de0f2a3..eb6c5ac 100644 --- a/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs +++ b/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs @@ -36,6 +36,9 @@ namespace OpenSim.Region.Framework.Interfaces HTTP_MIMETYPE = 1, HTTP_BODY_MAXLENGTH = 2, HTTP_VERIFY_CERT = 3, + HTTP_VERBOSE_THROTTLE = 4, + HTTP_CUSTOM_HEADER = 5, + HTTP_PRAGMA_NO_CACHE = 6 } public interface IHttpRequestModule -- cgit v1.1 From 4bf9c4bbb833f8ecbd0757b333da76ffaea14bc7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 31 Mar 2013 20:25:32 +0200 Subject: Export permission, part two. Setting export perms for textures and clothing works. Setting perms for prims also works but they don't propagate correctly yet. NOT FOR PRODUCTIN USE. Your database will need to be updated before you can use this! --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 46 ++++++++++++++++++++-- .../Region/Framework/Scenes/SceneObjectGroup.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 29 ++++++++++---- 3 files changed, 66 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 6a3fb24..d2e41f8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -413,18 +413,57 @@ namespace OpenSim.Region.Framework.Scenes if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid { + // Create a set of base permissions that will not include export if the user + // is not allowed to change the export flag. + bool denyExportChange = false; + + m_log.InfoFormat("[XXX]: B: {0} O: {1} E: {2}", itemUpd.BasePermissions, itemUpd.CurrentPermissions, itemUpd.EveryOnePermissions); + + // If the user is not the creator or doesn't have "E" in both "B" and "O", deny setting export + if ((item.BasePermissions & (uint)(PermissionMask.All | PermissionMask.Export)) != (uint)(PermissionMask.All | PermissionMask.Export) || (item.CurrentPermissions & (uint)PermissionMask.Export) == 0 || item.CreatorIdAsUuid != item.Owner) + denyExportChange = true; + + m_log.InfoFormat("[XXX]: Deny Export Update {0}", denyExportChange); + + // If it is already set, force it set and also force full perm + // else prevent setting it. It can and should never be set unless + // set in base, so the condition above is valid + if (denyExportChange) + { + // If we are not allowed to change it, then force it to the + // original item's setting and if it was on, also force full perm + if ((item.EveryOnePermissions & (uint)PermissionMask.Export) != 0) + { + itemUpd.NextPermissions = (uint)(PermissionMask.All); + itemUpd.EveryOnePermissions |= (uint)PermissionMask.Export; + } + else + { + itemUpd.EveryOnePermissions &= ~(uint)PermissionMask.Export; + } + } + else + { + // If the new state is exportable, force full perm + if ((itemUpd.EveryOnePermissions & (uint)PermissionMask.Export) != 0) + { + m_log.InfoFormat("[XXX]: Force full perm"); + itemUpd.NextPermissions = (uint)(PermissionMask.All); + } + } + if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions)) item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; + if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions)) item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; + if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions)) item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; - -// m_log.DebugFormat("[USER INVENTORY]: item.Flags {0}", item.Flags); - item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; + item.GroupID = itemUpd.GroupID; item.GroupOwned = itemUpd.GroupOwned; item.CreationDate = itemUpd.CreationDate; @@ -446,6 +485,7 @@ namespace OpenSim.Region.Framework.Scenes item.SaleType = itemUpd.SaleType; InventoryService.UpdateItem(item); + remoteClient.SendBulkUpdateInventory(item); } if (UUID.Zero != transactionID) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index b109b4f..69fb6df 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3468,7 +3468,7 @@ namespace OpenSim.Region.Framework.Scenes public void AdjustChildPrimPermissions() { - uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits + uint newOwnerMask = (uint)(PermissionMask.All | PermissionMask.Export) & 0xfffffff8; // Mask folded bits uint foldedPerms = RootPart.OwnerMask & 3; ForEachPart(part => diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9265805..c2f0792 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -470,8 +470,8 @@ namespace OpenSim.Region.Framework.Scenes private uint _category; private Int32 _creationDate; private uint _parentID = 0; - private uint _baseMask = (uint)PermissionMask.All; - private uint _ownerMask = (uint)PermissionMask.All; + private uint _baseMask = (uint)(PermissionMask.All | PermissionMask.Export); + private uint _ownerMask = (uint)(PermissionMask.All | PermissionMask.Export); private uint _groupMask = (uint)PermissionMask.None; private uint _everyoneMask = (uint)PermissionMask.None; private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); @@ -4319,10 +4319,10 @@ namespace OpenSim.Region.Framework.Scenes public void TrimPermissions() { - BaseMask &= (uint)PermissionMask.All; - OwnerMask &= (uint)PermissionMask.All; + BaseMask &= (uint)(PermissionMask.All | PermissionMask.Export); + OwnerMask &= (uint)(PermissionMask.All | PermissionMask.Export); GroupMask &= (uint)PermissionMask.All; - EveryoneMask &= (uint)PermissionMask.All; + EveryoneMask &= (uint)(PermissionMask.All | PermissionMask.Export); NextOwnerMask &= (uint)PermissionMask.All; } @@ -4425,10 +4425,22 @@ namespace OpenSim.Region.Framework.Scenes baseMask; break; case 8: + // Trying to set export permissions - extra checks + if (set && (mask & (uint)PermissionMask.Export) != 0) + { + if ((OwnerMask & (uint)PermissionMask.Export) == 0 || (BaseMask & (uint)PermissionMask.Export) == 0 || (NextOwnerMask & (uint)PermissionMask.All) != (uint)PermissionMask.All) + mask &= ~(uint)PermissionMask.Export; + } EveryoneMask = ApplyMask(EveryoneMask, set, mask) & baseMask; break; case 16: + // Force full perm if export + if ((EveryoneMask & (uint)PermissionMask.Export) != 0) + { + NextOwnerMask = (uint)PermissionMask.All; + break; + } NextOwnerMask = ApplyMask(NextOwnerMask, set, mask) & baseMask; // Prevent the client from creating no copy, no transfer @@ -5225,9 +5237,12 @@ namespace OpenSim.Region.Framework.Scenes public void ApplyNextOwnerPermissions() { - BaseMask &= NextOwnerMask; + // Export needs to be preserved in the base and everyone + // mask, but removed in the owner mask as a next owner + // can never change the export status + BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; OwnerMask &= NextOwnerMask; - EveryoneMask &= NextOwnerMask; + EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; Inventory.ApplyNextOwnerPermissions(); } -- cgit v1.1 From 3934b779b811cc0c6331127f03212d9bbcdc2ce9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 25 Apr 2013 01:39:22 +0200 Subject: Adding the dynamic menu module which allows registering new menu options in compliant viewers --- .../Framework/Interfaces/IDynamicMenuModule.cs | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs new file mode 100644 index 0000000..08b71e4 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs @@ -0,0 +1,57 @@ +/* + * 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.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Region.Framework.Interfaces +{ + public enum InsertLocation : int + { + Agent = 1, + World = 2, + Tools = 3, + Advanced = 4, + Admin = 5 + } + + public enum UserMode : int + { + Normal = 0, + God = 3 + } + + public delegate void CustomMenuHandler(string action, UUID agentID, List selection); + + public interface IDynamicMenuModule + { + void AddMenuItem(UUID agentID, string title, InsertLocation location, UserMode mode, CustomMenuHandler handler); + void AddMenuItem(string title, InsertLocation location, UserMode mode, CustomMenuHandler handler); + void RemoveMenuItem(string action); + } +} -- cgit v1.1 From 3fcac2ba7b7aa64a7fbd26e451f49933b0859527 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 27 Apr 2013 01:20:03 +0200 Subject: Controller module for dynamic floaters (WIP) --- .../Framework/Interfaces/IDynamicFloaterModule.cs | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs new file mode 100644 index 0000000..5e633e6 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs @@ -0,0 +1,51 @@ +/* + * 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.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.Framework.Interfaces +{ + public delegate bool HandlerDelegate(IClientAPI client, FloaterData data, string[] msg); + + public abstract class FloaterData + { + public abstract int Channel { get; } + public abstract string FloaterName { get; } + public virtual string XmlName { get; set; } + public virtual HandlerDelegate Handler { get; set; } + } + + + public interface IDynamicFloaterModule + { + void DoUserFloater(UUID agentID, FloaterData dialogData, string configuration); + void FloaterControl(ScenePresence sp, FloaterData d, string msg); + } +} -- cgit v1.1