From 47252214354cb768ecddb50062d650d22f7d1c4f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 20:54:00 +0000 Subject: Stop the avatar sometimes pausing for more than a second on the border when region crossing. This restores a RemoveFromPhysicalScene() call in ScenePresence.CheckForBorderCrossing() when the agent has been placed in transit. If we don't remove the agent from the physical scene, then the method continues to be called via ScenePresence.Update() until the handover of the client between regions is completed. Since this handover can take more than 1000ms (due to the 1000ms event queue polling response from the server), this results in the avatar pausing on the border for the entire handover period. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index cd70de8..4150f4a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2776,6 +2776,13 @@ namespace OpenSim.Region.Framework.Scenes } else { + // We must remove the agent from the physical scene if it has been placed in transit. If we don't, + // then this method continues to be called from ScenePresence.Update() until the handover of the client between + // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms + // event queue polling response from the server), this results in the avatar pausing on the border + // for the handover period. + RemoveFromPhysicalScene(); + // This constant has been inferred from experimentation // I'm not sure what this value should be, so I tried a few values. timeStep = 0.04f; -- cgit v1.1 From e774679f62dc0de54c1926b1b4a611ca317d2bd7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 21:19:16 +0000 Subject: minor: add method doc to a few ScenePresence methods --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4150f4a..b47ec3c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2652,8 +2652,11 @@ namespace OpenSim.Region.Framework.Scenes #region Border Crossing Methods /// - /// Checks to see if the avatar is in range of a border and calls CrossToNewRegion + /// Starts the process of moving an avatar into another region if they are crossing the border. /// + /// + /// Also removes the avatar from the physical scene if transit has started. + /// protected void CheckForBorderCrossing() { if (IsChildAgent) @@ -2721,7 +2724,6 @@ namespace OpenSim.Region.Framework.Scenes neighbor = HaveNeighbor(Cardinals.N, ref fix); } - // Makes sure avatar does not end up outside region if (neighbor <= 0) { @@ -2794,6 +2796,15 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Checks whether this region has a neighbour in the given direction. + /// + /// + /// + /// + /// An integer which represents a compass point. N == 1, going clockwise until we reach NW == 8. + /// Returns a positive integer if there is a region in that direction, a negative integer if not. + /// protected int HaveNeighbor(Cardinals car, ref int[] fix) { uint neighbourx = m_regionInfo.RegionLocX; -- cgit v1.1 From 88da253c947c78e97f78119203e3c2f216a788e2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 21:54:44 +0000 Subject: Add very basic test which invokes the scene update loop once and checks the frame number. This makes Scene.Update() match its original description of performing a single update, which also matches the semantics of SOG and ScenePresence. --- OpenSim/Region/Framework/Scenes/Scene.cs | 307 ++++++++++----------- .../Framework/Scenes/Tests/ScenePresenceTests.cs | 3 - .../Region/Framework/Scenes/Tests/SceneTests.cs | 71 +++++ 3 files changed, 224 insertions(+), 157 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 02a0268..e0af2d6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -129,7 +129,16 @@ namespace OpenSim.Region.Framework.Scenes protected ICapabilitiesModule m_capsModule; // Central Update Loop protected int m_fps = 10; - protected uint m_frame; + + /// + /// Current scene frame number + /// + public uint Frame + { + get; + protected set; + } + protected float m_timespan = 0.089f; protected DateTime m_lastupdate = DateTime.UtcNow; @@ -1183,7 +1192,8 @@ namespace OpenSim.Region.Framework.Scenes try { - Update(); + while (!shuttingdown) + Update(); m_lastUpdate = Util.EnvironmentTickCount(); m_firstHeartbeat = false; @@ -1200,187 +1210,176 @@ namespace OpenSim.Region.Framework.Scenes Watchdog.RemoveThread(); } - /// - /// Performs per-frame updates on the scene, this should be the central scene loop - /// public override void Update() - { - float physicsFPS; - int maintc; + { + TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastupdate; + float physicsFPS = 0f; - while (!shuttingdown) + int maintc = Util.EnvironmentTickCount(); + int tmpFrameMS = maintc; + tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0; + + // Increment the frame counter + ++Frame; + + try { - TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastupdate; - physicsFPS = 0f; + // Check if any objects have reached their targets + CheckAtTargets(); - maintc = Util.EnvironmentTickCount(); - int tmpFrameMS = maintc; - tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0; + // Update SceneObjectGroups that have scheduled themselves for updates + // Objects queue their updates onto all scene presences + if (Frame % m_update_objects == 0) + m_sceneGraph.UpdateObjectGroups(); - // Increment the frame counter - ++m_frame; + // Run through all ScenePresences looking for updates + // Presence updates and queued object updates for each presence are sent to clients + if (Frame % m_update_presences == 0) + m_sceneGraph.UpdatePresences(); - try + // Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client) + if (Frame % m_update_coarse_locations == 0) { - // Check if any objects have reached their targets - CheckAtTargets(); - - // Update SceneObjectGroups that have scheduled themselves for updates - // Objects queue their updates onto all scene presences - if (m_frame % m_update_objects == 0) - m_sceneGraph.UpdateObjectGroups(); + List coarseLocations; + List avatarUUIDs; + SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60); + // Send coarse locations to clients + ForEachScenePresence(delegate(ScenePresence presence) + { + presence.SendCoarseLocations(coarseLocations, avatarUUIDs); + }); + } - // Run through all ScenePresences looking for updates - // Presence updates and queued object updates for each presence are sent to clients - if (m_frame % m_update_presences == 0) - m_sceneGraph.UpdatePresences(); + int tmpPhysicsMS2 = Util.EnvironmentTickCount(); + if ((Frame % m_update_physics == 0) && m_physics_enabled) + m_sceneGraph.UpdatePreparePhysics(); + physicsMS2 = Util.EnvironmentTickCountSubtract(tmpPhysicsMS2); - // Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client) - if (m_frame % m_update_coarse_locations == 0) - { - List coarseLocations; - List avatarUUIDs; - SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60); - // Send coarse locations to clients - ForEachScenePresence(delegate(ScenePresence presence) - { - presence.SendCoarseLocations(coarseLocations, avatarUUIDs); - }); - } + // Apply any pending avatar force input to the avatar's velocity + if (Frame % m_update_entitymovement == 0) + m_sceneGraph.UpdateScenePresenceMovement(); - int tmpPhysicsMS2 = Util.EnvironmentTickCount(); - if ((m_frame % m_update_physics == 0) && m_physics_enabled) - m_sceneGraph.UpdatePreparePhysics(); - physicsMS2 = Util.EnvironmentTickCountSubtract(tmpPhysicsMS2); + // Perform the main physics update. This will do the actual work of moving objects and avatars according to their + // velocity + int tmpPhysicsMS = Util.EnvironmentTickCount(); + if (Frame % m_update_physics == 0) + { + if (m_physics_enabled) + physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_timespan)); + if (SynchronizeScene != null) + SynchronizeScene(this); + } + physicsMS = Util.EnvironmentTickCountSubtract(tmpPhysicsMS); - // Apply any pending avatar force input to the avatar's velocity - if (m_frame % m_update_entitymovement == 0) - m_sceneGraph.UpdateScenePresenceMovement(); + // Delete temp-on-rez stuff + if (Frame % 1000 == 0 && !m_cleaningTemps) + { + int tmpTempOnRezMS = Util.EnvironmentTickCount(); + m_cleaningTemps = true; + Util.FireAndForget(delegate { CleanTempObjects(); m_cleaningTemps = false; }); + tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpTempOnRezMS); + } - // Perform the main physics update. This will do the actual work of moving objects and avatars according to their - // velocity - int tmpPhysicsMS = Util.EnvironmentTickCount(); - if (m_frame % m_update_physics == 0) + if (RegionStatus != RegionStatus.SlaveScene) + { + if (Frame % m_update_events == 0) { - if (m_physics_enabled) - physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_timespan)); - if (SynchronizeScene != null) - SynchronizeScene(this); + int evMS = Util.EnvironmentTickCount(); + UpdateEvents(); + eventMS = Util.EnvironmentTickCountSubtract(evMS); ; } - physicsMS = Util.EnvironmentTickCountSubtract(tmpPhysicsMS); - // Delete temp-on-rez stuff - if (m_frame % 1000 == 0 && !m_cleaningTemps) + if (Frame % m_update_backup == 0) { - int tmpTempOnRezMS = Util.EnvironmentTickCount(); - m_cleaningTemps = true; - Util.FireAndForget(delegate { CleanTempObjects(); m_cleaningTemps = false; }); - tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpTempOnRezMS); + int backMS = Util.EnvironmentTickCount(); + UpdateStorageBackup(); + backupMS = Util.EnvironmentTickCountSubtract(backMS); } - if (RegionStatus != RegionStatus.SlaveScene) + if (Frame % m_update_terrain == 0) { - if (m_frame % m_update_events == 0) - { - int evMS = Util.EnvironmentTickCount(); - UpdateEvents(); - eventMS = Util.EnvironmentTickCountSubtract(evMS); ; - } - - if (m_frame % m_update_backup == 0) - { - int backMS = Util.EnvironmentTickCount(); - UpdateStorageBackup(); - backupMS = Util.EnvironmentTickCountSubtract(backMS); - } + int terMS = Util.EnvironmentTickCount(); + UpdateTerrain(); + terrainMS = Util.EnvironmentTickCountSubtract(terMS); + } - if (m_frame % m_update_terrain == 0) - { - int terMS = Util.EnvironmentTickCount(); - UpdateTerrain(); - terrainMS = Util.EnvironmentTickCountSubtract(terMS); - } + //if (Frame % m_update_land == 0) + //{ + // int ldMS = Util.EnvironmentTickCount(); + // UpdateLand(); + // landMS = Util.EnvironmentTickCountSubtract(ldMS); + //} - //if (m_frame % m_update_land == 0) - //{ - // int ldMS = Util.EnvironmentTickCount(); - // UpdateLand(); - // landMS = Util.EnvironmentTickCountSubtract(ldMS); - //} + frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS); + otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; + lastCompletedFrame = Util.EnvironmentTickCount(); + + // if (Frame%m_update_avatars == 0) + // UpdateInWorldTime(); + StatsReporter.AddPhysicsFPS(physicsFPS); + StatsReporter.AddTimeDilation(TimeDilation); + StatsReporter.AddFPS(1); + StatsReporter.SetRootAgents(m_sceneGraph.GetRootAgentCount()); + StatsReporter.SetChildAgents(m_sceneGraph.GetChildAgentCount()); + StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount()); + StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount()); + StatsReporter.addFrameMS(frameMS); + StatsReporter.addPhysicsMS(physicsMS + physicsMS2); + StatsReporter.addOtherMS(otherMS); + StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); + StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); + } - frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS); - otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; - lastCompletedFrame = Util.EnvironmentTickCount(); - - // if (m_frame%m_update_avatars == 0) - // UpdateInWorldTime(); - StatsReporter.AddPhysicsFPS(physicsFPS); - StatsReporter.AddTimeDilation(TimeDilation); - StatsReporter.AddFPS(1); - StatsReporter.SetRootAgents(m_sceneGraph.GetRootAgentCount()); - StatsReporter.SetChildAgents(m_sceneGraph.GetChildAgentCount()); - StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount()); - StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount()); - StatsReporter.addFrameMS(frameMS); - StatsReporter.addPhysicsMS(physicsMS + physicsMS2); - StatsReporter.addOtherMS(otherMS); - StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); - StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); - } + if (LoginsDisabled && Frame == 20) + { + // In 99.9% of cases it is a bad idea to manually force garbage collection. However, + // this is a rare case where we know we have just went through a long cycle of heap + // allocations, and there is no more work to be done until someone logs in + GC.Collect(); - if (LoginsDisabled && m_frame == 20) + IConfig startupConfig = m_config.Configs["Startup"]; + if (startupConfig == null || !startupConfig.GetBoolean("StartDisabled", false)) { - // In 99.9% of cases it is a bad idea to manually force garbage collection. However, - // this is a rare case where we know we have just went through a long cycle of heap - // allocations, and there is no more work to be done until someone logs in - GC.Collect(); - - IConfig startupConfig = m_config.Configs["Startup"]; - if (startupConfig == null || !startupConfig.GetBoolean("StartDisabled", false)) - { - m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); - LoginsDisabled = false; - m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface(), RegionInfo); - } + m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); + LoginsDisabled = false; + m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface(), RegionInfo); } } - catch (NotImplementedException) - { - throw; - } - catch (AccessViolationException e) - { - m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); - } - //catch (NullReferenceException e) - //{ - // m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); - //} - catch (InvalidOperationException e) - { - m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); - } - catch (Exception e) - { - m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); - } - finally - { - m_lastupdate = DateTime.UtcNow; - } - - maintc = Util.EnvironmentTickCountSubtract(maintc); - maintc = (int)(m_timespan * 1000) - maintc; + } + catch (NotImplementedException) + { + throw; + } + catch (AccessViolationException e) + { + m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); + } + //catch (NullReferenceException e) + //{ + // m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); + //} + catch (InvalidOperationException e) + { + m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); + } + catch (Exception e) + { + m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); + } + finally + { + m_lastupdate = DateTime.UtcNow; + } - if (maintc > 0) - Thread.Sleep(maintc); + maintc = Util.EnvironmentTickCountSubtract(maintc); + maintc = (int)(m_timespan * 1000) - maintc; - // Tell the watchdog that this thread is still alive - Watchdog.UpdateThread(); - } - } + if (maintc > 0) + Thread.Sleep(maintc); - + // Tell the watchdog that this thread is still alive + Watchdog.UpdateThread(); + } public void AddGroupTarget(SceneObjectGroup grp) { diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index ef52363..8286e4f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -116,9 +116,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests agent.ChildrenCapSeeds = new Dictionary(); agent.child = true; - if (scene.PresenceService == null) - Console.WriteLine("Presence Service is null"); - scene.PresenceService.LoginAgent(agent.AgentID.ToString(), agent.SessionID, agent.SecureSessionID); string reason; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs new file mode 100644 index 0000000..9aba8a8 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs @@ -0,0 +1,71 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Timers; +using Timer=System.Timers.Timer; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.CoreModules.World.Serialiser; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + /// + /// Scene presence tests + /// + [TestFixture] + public class SceneTests + { + /// + /// Very basic scene update test. Should become more elaborate with time. + /// + [Test] + public void TestUpdateScene() + { + TestHelper.InMethod(); + + Scene scene = SceneSetupHelpers.SetupScene(); + scene.Update(); + + Assert.That(scene.Frame, Is.EqualTo(1)); + } + } +} \ No newline at end of file -- cgit v1.1 From c763edf56dab869982b5ba002d798f147112a361 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 22:20:08 +0000 Subject: separate attachment tests out into their own class --- .../Framework/Scenes/Tests/AttachmentTests.cs | 180 +++++++++++++++++++++ .../Framework/Scenes/Tests/ScenePresenceTests.cs | 50 ------ 2 files changed, 180 insertions(+), 50 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs new file mode 100644 index 0000000..60e47f6 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs @@ -0,0 +1,180 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Timers; +using Timer=System.Timers.Timer; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.CoreModules.World.Serialiser; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + /// + /// Scene presence tests + /// + [TestFixture] + public class AttachmentTests + { + public Scene scene, scene2; + public UUID agent1; + public static Random random; + public ulong region1, region2; + public AgentCircuitData acd1; + public SceneObjectGroup sog1, sog2, sog3; + + [TestFixtureSetUp] + public void Init() + { + TestHelper.InMethod(); + + scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); + scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); + + ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); + interregionComms.Initialise(new IniConfigSource()); + interregionComms.PostInitialise(); + SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms); + SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms); + + agent1 = UUID.Random(); + random = new Random(); + sog1 = NewSOG(UUID.Random(), scene, agent1); + sog2 = NewSOG(UUID.Random(), scene, agent1); + sog3 = NewSOG(UUID.Random(), scene, agent1); + + //ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); + region1 = scene.RegionInfo.RegionHandle; + region2 = scene2.RegionInfo.RegionHandle; + + SceneSetupHelpers.AddRootAgent(scene, agent1); + } + + [TearDown] + public void TearDown() + { + if (MainServer.Instance != null) MainServer.Instance.Stop(); + } + + [Test] + public void T030_TestAddAttachments() + { + TestHelper.InMethod(); + + ScenePresence presence = scene.GetScenePresence(agent1); + + presence.AddAttachment(sog1); + presence.AddAttachment(sog2); + presence.AddAttachment(sog3); + + Assert.That(presence.HasAttachments(), Is.True); + Assert.That(presence.ValidateAttachments(), Is.True); + } + + [Test] + public void T031_RemoveAttachments() + { + TestHelper.InMethod(); + + ScenePresence presence = scene.GetScenePresence(agent1); + presence.RemoveAttachment(sog1); + presence.RemoveAttachment(sog2); + presence.RemoveAttachment(sog3); + Assert.That(presence.HasAttachments(), Is.False); + } + + // I'm commenting this test because scene setup NEEDS InventoryService to + // be non-null + //[Test] + public void T032_CrossAttachments() + { + TestHelper.InMethod(); + + ScenePresence presence = scene.GetScenePresence(agent1); + ScenePresence presence2 = scene2.GetScenePresence(agent1); + presence2.AddAttachment(sog1); + presence2.AddAttachment(sog2); + + ISharedRegionModule serialiser = new SerialiserModule(); + SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser); + SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser); + + Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross"); + + //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful"); + Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted"); + Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); + } + + private SceneObjectGroup NewSOG(UUID uuid, Scene scene, UUID agent) + { + SceneObjectPart sop = new SceneObjectPart(); + sop.Name = RandomName(); + sop.Description = RandomName(); + sop.Text = RandomName(); + sop.SitName = RandomName(); + sop.TouchName = RandomName(); + sop.UUID = uuid; + sop.Shape = PrimitiveBaseShape.Default; + sop.Shape.State = 1; + sop.OwnerID = agent; + + SceneObjectGroup sog = new SceneObjectGroup(sop); + sog.SetScene(scene); + + return sog; + } + + private static string RandomName() + { + StringBuilder name = new StringBuilder(); + int size = random.Next(5,12); + char ch; + for (int i = 0; i < size; i++) + { + ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; + name.Append(ch); + } + + return name.ToString(); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 8286e4f..d82760e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -331,56 +331,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); } - [Test] - public void T030_TestAddAttachments() - { - TestHelper.InMethod(); - - ScenePresence presence = scene.GetScenePresence(agent1); - - presence.AddAttachment(sog1); - presence.AddAttachment(sog2); - presence.AddAttachment(sog3); - - Assert.That(presence.HasAttachments(), Is.True); - Assert.That(presence.ValidateAttachments(), Is.True); - } - - [Test] - public void T031_RemoveAttachments() - { - TestHelper.InMethod(); - - ScenePresence presence = scene.GetScenePresence(agent1); - presence.RemoveAttachment(sog1); - presence.RemoveAttachment(sog2); - presence.RemoveAttachment(sog3); - Assert.That(presence.HasAttachments(), Is.False); - } - - // I'm commenting this test because scene setup NEEDS InventoryService to - // be non-null - //[Test] - public void T032_CrossAttachments() - { - TestHelper.InMethod(); - - ScenePresence presence = scene.GetScenePresence(agent1); - ScenePresence presence2 = scene2.GetScenePresence(agent1); - presence2.AddAttachment(sog1); - presence2.AddAttachment(sog2); - - ISharedRegionModule serialiser = new SerialiserModule(); - SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser); - SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser); - - Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross"); - - //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful"); - Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted"); - Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); - } - [TearDown] public void TearDown() { -- cgit v1.1 From c155f57dbe6b36697d2e1e50d4de43f7af2b97d1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 22:22:51 +0000 Subject: remove unused test teardown method --- OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs index 60e47f6..af44640 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs @@ -49,7 +49,7 @@ using OpenSim.Tests.Common.Setup; namespace OpenSim.Region.Framework.Scenes.Tests { /// - /// Scene presence tests + /// Attachment tests /// [TestFixture] public class AttachmentTests @@ -86,13 +86,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests region2 = scene2.RegionInfo.RegionHandle; SceneSetupHelpers.AddRootAgent(scene, agent1); - } - - [TearDown] - public void TearDown() - { - if (MainServer.Instance != null) MainServer.Instance.Stop(); - } + } [Test] public void T030_TestAddAttachments() -- cgit v1.1 From 023f953f39709e90c8eb31bc332dc2c01346cbd9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 22:25:45 +0000 Subject: remove another unused test teardown method --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index d82760e..ddff896 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -331,12 +331,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); } - [TearDown] - public void TearDown() - { - if (MainServer.Instance != null) MainServer.Instance.Stop(); - } - public static string GetRandomCapsObjectPath() { UUID caps = UUID.Random(); -- cgit v1.1 From eb699df5f6c7a68a500e38dc994ed7c2f2aa89d9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 22:49:19 +0000 Subject: On SceneSetupHelpers, go back to calling ScenePresence.CompleteMovement() for the last stage of AddRootAgent() instead of SP.MakeRootAgent() Going this extra step doesn't appear to cause any test failures. This is arguably better for test purposes, though at some stage another method may arise which does just call AddRootAgent(). --- .../Framework/Scenes/Tests/ScenePresenceTests.cs | 60 +++++++++++++++------- 1 file changed, 41 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index ddff896..92c73be 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -172,25 +172,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(neighbours.Count, Is.EqualTo(2)); } - - public void fixNullPresence() - { - string firstName = "testfirstname"; - - AgentCircuitData agent = new AgentCircuitData(); - agent.AgentID = agent1; - agent.firstname = firstName; - agent.lastname = "testlastname"; - agent.SessionID = UUID.Zero; - agent.SecureSessionID = UUID.Zero; - agent.circuitcode = 123; - agent.BaseFolder = UUID.Zero; - agent.InventoryFolder = UUID.Zero; - agent.startpos = Vector3.Zero; - agent.CapsPath = GetRandomCapsObjectPath(); - - acd1 = agent; - } [Test] public void T013_TestRemoveNeighbourRegion() @@ -208,6 +189,28 @@ namespace OpenSim.Region.Framework.Scenes.Tests CompleteAvatarMovement */ } + + /// + /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region + /// + /// + /// Please note that unlike the other tests here, this doesn't rely on structures + /// + [Test] + public void TestChildAgentEstablished() + { + UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); + + TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); + TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); + + SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); + ScenePresence childPresence = myScene2.GetScenePresence(agent1); + + // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents +// Assert.That(childPresence, Is.Not.Null); +// Assert.That(childPresence.IsChildAgent, Is.True); + } // I'm commenting this test, because this is not supposed to happen here //[Test] @@ -330,7 +333,26 @@ namespace OpenSim.Region.Framework.Scenes.Tests 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."); } + + public void fixNullPresence() + { + string firstName = "testfirstname"; + AgentCircuitData agent = new AgentCircuitData(); + agent.AgentID = agent1; + agent.firstname = firstName; + agent.lastname = "testlastname"; + agent.SessionID = UUID.Zero; + agent.SecureSessionID = UUID.Zero; + agent.circuitcode = 123; + agent.BaseFolder = UUID.Zero; + agent.InventoryFolder = UUID.Zero; + agent.startpos = Vector3.Zero; + agent.CapsPath = GetRandomCapsObjectPath(); + + acd1 = agent; + } + public static string GetRandomCapsObjectPath() { UUID caps = UUID.Random(); -- cgit v1.1 From dd9efc183812a66b1654aaeb419945cf57650b08 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 23:05:56 +0000 Subject: extend TestChildAgentEstablished() test slightly to put in EntityTransferModule. Not yet enabled. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 +++- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b47ec3c..51b8dcc 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1161,7 +1161,9 @@ namespace OpenSim.Region.Framework.Scenes if (m_agentTransfer != null) m_agentTransfer.EnableChildAgents(this); else - m_log.DebugFormat("[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active"); + m_log.DebugFormat( + "[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active for region {0}", + m_scene.RegionInfo.RegionName); IFriendsModule friendsModule = m_scene.RequestModuleInterface(); if (friendsModule != null) diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 92c73be..60bc86c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -40,6 +40,7 @@ using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.CoreModules.Framework.EntityTransfer; using OpenSim.Region.CoreModules.World.Serialiser; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; using OpenSim.Tests.Common; @@ -199,10 +200,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests [Test] public void TestChildAgentEstablished() { + TestHelper.InMethod(); + log4net.Config.XmlConfigurator.Configure(); + UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); - TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); - TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); + TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); + TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); + + EntityTransferModule etm = new EntityTransferModule(); + SceneSetupHelpers.SetupSceneModules(myScene1, etm); SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); ScenePresence childPresence = myScene2.GetScenePresence(agent1); -- cgit v1.1 From 5c92f62941e21b6e5eec503ab95f149092e20217 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 23:10:46 +0000 Subject: minor: remove mono compiler warning --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 584c577..583214c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -845,7 +845,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private void HandleUseCircuitCode(object o) { - DateTime startTime = DateTime.Now; +// DateTime startTime = DateTime.Now; object[] array = (object[])o; UDPPacketBuffer buffer = (UDPPacketBuffer)array[0]; UseCircuitCodePacket packet = (UseCircuitCodePacket)array[1]; -- cgit v1.1 From 8249d77991352697b4972f7109c014db0ebd5f68 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 23:25:59 +0000 Subject: If GridService.GetNeighbours() could not find the region then log a warning rather than causing a null reference on the normal log line This also extends the TestChildAgentEstablished() test to actually activate the EntityTransferModule, though the test is not yet viable --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 60bc86c..5e1ff79 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -201,15 +201,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestChildAgentEstablished() { TestHelper.InMethod(); - log4net.Config.XmlConfigurator.Configure(); +// log4net.Config.XmlConfigurator.Configure(); UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); + IConfigSource configSource = new IniConfigSource(); + configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule"); EntityTransferModule etm = new EntityTransferModule(); - SceneSetupHelpers.SetupSceneModules(myScene1, etm); + + SceneSetupHelpers.SetupSceneModules(myScene1, configSource, etm); SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); ScenePresence childPresence = myScene2.GetScenePresence(agent1); -- cgit v1.1 From 60fe3d48ee83f004861044c51537256c0c389478 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 23:50:54 +0000 Subject: Put some CapabilitiesModule null checks in Scene Stop tests setting up a capabilities module by default --- OpenSim/Region/Framework/Scenes/Scene.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e0af2d6..ee1e0be 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3010,7 +3010,9 @@ namespace OpenSim.Region.Framework.Scenes (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); m_sceneGraph.removeUserCount(!childagentYN); - CapsModule.RemoveCapsHandler(agentID); + + if (CapsModule != null) + CapsModule.RemoveCapsHandler(agentID); // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever // this method is doing is HORRIBLE!!! @@ -3265,8 +3267,11 @@ namespace OpenSim.Region.Framework.Scenes RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode); - CapsModule.NewUserConnection(agent); - CapsModule.AddCapsHandler(agent.AgentID); + if (CapsModule != null) + { + CapsModule.NewUserConnection(agent); + CapsModule.AddCapsHandler(agent.AgentID); + } } else { @@ -3281,7 +3286,9 @@ namespace OpenSim.Region.Framework.Scenes agent.AgentID, RegionInfo.RegionName); sp.AdjustKnownSeeds(); - CapsModule.NewUserConnection(agent); + + if (CapsModule != null) + CapsModule.NewUserConnection(agent); } } -- cgit v1.1 From 9e47018cfb42cc67a1d414e73396861b3a6b99ea Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Feb 2011 00:14:13 +0000 Subject: Remove test T020_TestMakeRootAgent() which hasn't been active for ages anyway This test was non-viable. Keeping inactive T021_TestCrossToNewRegion() around for now since it's still useful for reference purposes in constructing a future working test. --- .../Framework/Scenes/Tests/ScenePresenceTests.cs | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 5e1ff79..fd2d6fa 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -222,25 +222,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Assert.That(childPresence.IsChildAgent, Is.True); } - // I'm commenting this test, because this is not supposed to happen here - //[Test] - public void T020_TestMakeRootAgent() - { - TestHelper.InMethod(); - - ScenePresence presence = scene.GetScenePresence(agent1); - Assert.That(presence.IsChildAgent, Is.False, "Starts out as a root agent"); - - presence.MakeChildAgent(); - Assert.That(presence.IsChildAgent, Is.True, "Did not change to child agent after MakeChildAgent"); - - // Accepts 0 but rejects Constants.RegionSize - Vector3 pos = new Vector3(0,unchecked(Constants.RegionSize-1),0); - presence.MakeRootAgent(pos,true); - Assert.That(presence.IsChildAgent, Is.False, "Did not go back to root agent"); - Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); - } - // 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. -- cgit v1.1 From 5a16fa882c0f1a6200bc3fdb63b0f4564acf0e6d Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 22 Feb 2011 13:23:54 -0800 Subject: Parameterizes the view distance used to compute and manage child agents in neighbor regions. This means you can extend the view on a simulator beyond the default 3x3 regions. This uses a region default draw distance and should be replaced at some point by the avatar specified draw distance. That will require more careful, dynamic recomputation of child agents every time the draw distance changes. WARNING: this is experimental and has known instabilities. specifically all regions "within site" should be running the same default draw distance or agents will not be closed correctly. --- .../EntityTransfer/EntityTransferModule.cs | 37 +++++++++++++++------- .../EntityTransfer/HGEntityTransferModule.cs | 4 +-- OpenSim/Region/Framework/Scenes/Scene.cs | 9 ++++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 24 +++++++++++--- 4 files changed, 56 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 98aa563..95c771e 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -318,7 +318,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agentCircuit.Id0 = currentAgentCircuit.Id0; } - if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) + if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) { // brand new agent, let's create a new caps seed agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); @@ -336,7 +336,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // OK, it got this agent. Let's close some child agents sp.CloseChildAgents(newRegionX, newRegionY); IClientIPEndpoint ipepClient; - if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) + if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) { //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); #region IP Translation for NAT @@ -447,7 +447,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone - if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) + if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) { Thread.Sleep(5000); sp.Close(); @@ -521,14 +521,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return region; } - protected virtual bool NeedsNewAgent(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY) + protected virtual bool NeedsNewAgent(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY) { - return Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY); + return Util.IsOutsideView(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY); } - protected virtual bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) + protected virtual bool NeedsClosing(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) { - return Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY); + return Util.IsOutsideView(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY); } protected virtual bool IsOutsideRegion(Scene s, Vector3 pos) @@ -1045,7 +1045,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (m_regionInfo != null) { - neighbours = RequestNeighbours(sp.Scene, m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); + neighbours = RequestNeighbours(sp, m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); } else { @@ -1272,8 +1272,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer /// /// /// - protected List RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) + protected List RequestNeighbours(ScenePresence avatar, uint pRegionLocX, uint pRegionLocY) { + Scene pScene = avatar.Scene; RegionInfo m_regionInfo = pScene.RegionInfo; Border[] northBorders = pScene.NorthBorders.ToArray(); @@ -1281,10 +1282,24 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer Border[] eastBorders = pScene.EastBorders.ToArray(); Border[] westBorders = pScene.WestBorders.ToArray(); - // Legacy one region. Provided for simplicity while testing the all inclusive method in the else statement. + // Leaving this as a "megaregions" computation vs "non-megaregions" computation; it isn't + // clear what should be done with a "far view" given that megaregions already extended the + // view to include everything in the megaregion if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1) { - return pScene.GridService.GetNeighbours(m_regionInfo.ScopeID, m_regionInfo.RegionID); + int dd = avatar.DrawDistance < Constants.RegionSize ? (int)Constants.RegionSize : (int)avatar.DrawDistance; + + int startX = (int)pRegionLocX * (int)Constants.RegionSize - dd + (int)(Constants.RegionSize/2); + int startY = (int)pRegionLocY * (int)Constants.RegionSize - dd + (int)(Constants.RegionSize/2); + + int endX = (int)pRegionLocX * (int)Constants.RegionSize + dd + (int)(Constants.RegionSize/2); + int endY = (int)pRegionLocY * (int)Constants.RegionSize + dd + (int)(Constants.RegionSize/2); + + List neighbours = + avatar.Scene.GridService.GetRegionRange(m_regionInfo.ScopeID, startX, endX, startY, endY); + + neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; }); + return neighbours; } else { diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 35dcd95..79e76b4 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -130,9 +130,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return region; } - protected override bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) + protected override bool NeedsClosing(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) { - if (base.NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) + if (base.NeedsClosing(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) return true; int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ee1e0be..7def7e9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -83,6 +83,13 @@ namespace OpenSim.Region.Framework.Scenes public bool m_useFlySlow; public bool m_usePreJump; public bool m_seeIntoRegionFromNeighbor; + + protected float m_defaultDrawDistance = 255.0f; + public float DefaultDrawDistance + { + get { return m_defaultDrawDistance; } + } + // TODO: need to figure out how allow client agents but deny // root agents when ACL denies access to root agent public bool m_strictAccessControl = true; @@ -627,6 +634,8 @@ namespace OpenSim.Region.Framework.Scenes // IConfig startupConfig = m_config.Configs["Startup"]; + m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); + //Animation states m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); // TODO: Change default to true once the feature is supported diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 51b8dcc..9e9481e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -626,7 +626,7 @@ namespace OpenSim.Region.Framework.Scenes Utils.LongToUInts(handle, out x, out y); x = x / Constants.RegionSize; y = y / Constants.RegionSize; - if (Util.IsOutsideView(x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY)) + if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY)) { old.Add(handle); } @@ -700,6 +700,7 @@ namespace OpenSim.Region.Framework.Scenes private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() { + m_DrawDistance = world.DefaultDrawDistance; m_rootRegionHandle = reginfo.RegionHandle; m_controllingClient = client; m_firstname = m_controllingClient.FirstName; @@ -1279,7 +1280,11 @@ namespace OpenSim.Region.Framework.Scenes m_CameraUpAxis = agentData.CameraUpAxis; // The Agent's Draw distance setting - m_DrawDistance = agentData.Far; + // When we get to the point of re-computing neighbors everytime this + // changes, then start using the agent's drawdistance rather than the + // region's draw distance. + // m_DrawDistance = agentData.Far; + m_DrawDistance = Scene.DefaultDrawDistance; // Check if Client has camera in 'follow cam' or 'build' mode. Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation); @@ -2913,7 +2918,7 @@ namespace OpenSim.Region.Framework.Scenes //m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); //m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); - if (Util.IsOutsideView(x, newRegionX, y, newRegionY)) + if (Util.IsOutsideView(DrawDistance, x, newRegionX, y, newRegionY)) { byebyeRegions.Add(handle); } @@ -2989,7 +2994,12 @@ namespace OpenSim.Region.Framework.Scenes Vector3 offset = new Vector3(shiftx, shifty, 0f); - m_DrawDistance = cAgentData.Far; + // When we get to the point of re-computing neighbors everytime this + // changes, then start using the agent's drawdistance rather than the + // region's draw distance. + // m_DrawDistance = cAgentData.Far; + m_DrawDistance = Scene.DefaultDrawDistance; + if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!! m_pos = cAgentData.Position + offset; @@ -3139,7 +3149,11 @@ namespace OpenSim.Region.Framework.Scenes m_CameraLeftAxis = cAgent.LeftAxis; m_CameraUpAxis = cAgent.UpAxis; - m_DrawDistance = cAgent.Far; + // When we get to the point of re-computing neighbors everytime this + // changes, then start using the agent's drawdistance rather than the + // region's draw distance. + // m_DrawDistance = cAgent.Far; + m_DrawDistance = Scene.DefaultDrawDistance; if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0) ControllingClient.SetChildAgentThrottle(cAgent.Throttles); -- cgit v1.1 From 1bb0bae78aa6654730e1095ba07086679de529de Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 22 Feb 2011 13:30:38 -0800 Subject: Forces the owner of a rezzed object to be the "rezzer" of the object rather than the owner of the inventory item. In theory, this shouldn't happen unless you are using grid-wide library for inventory. --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 7bb8789..bd316c6 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -524,6 +524,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (item != null) { + item.Owner = remoteClient.AgentId; + AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); if (rezAsset != null) -- cgit v1.1 From 2f5394e70ddefb5e7ec6a04022eef42a8ac89b0d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Feb 2011 22:33:54 +0000 Subject: Fix bug where avatars in other regions would not always show up on the mini-map --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 969ff13..734ba22 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -204,9 +204,10 @@ namespace OpenSim.Region.Framework.Scenes for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i) { ScenePresence sp = presences[i]; + // If this presence is a child agent, we don't want its coarse locations if (sp.IsChildAgent) - return; + continue; if (sp.ParentID != 0) { -- cgit v1.1 From 197cc3883fe5c532588f6b721d5f9d1295c24abc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Feb 2011 01:16:47 +0000 Subject: Fix bug where having no maximum memory cache timeout would cause the flotsam asset cache to try using Double.MaxValue, which would cause the underlying OpenMetaverse.ExpiringCache to choke. There is probably an underlying bug to fix in ExpiringCache. --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 6ed4867..edb6710 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -252,7 +252,7 @@ namespace Flotsam.RegionModules.AssetCache } else { - m_MemoryCache.AddOrUpdate(key, asset, Double.MaxValue); + m_MemoryCache.AddOrUpdate(key, asset, m_DefaultMemoryExpiration); } } } -- cgit v1.1 From beff0ac32f0575e7805fd0691ba3907b3d13b70c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Feb 2011 01:18:43 +0000 Subject: log actual cache directory for FlotsamAssetCache instead of always logging the default --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index edb6710..90fb9b3 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -147,7 +147,7 @@ namespace Flotsam.RegionModules.AssetCache } m_CacheDirectory = assetConfig.GetString("CacheDirectory", m_DefaultCacheDirectory); - m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory", m_DefaultCacheDirectory); + m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory", m_CacheDirectory); m_MemoryCacheEnabled = assetConfig.GetBoolean("MemoryCacheEnabled", false); m_MemoryExpiration = TimeSpan.FromHours(assetConfig.GetDouble("MemoryCacheTimeout", m_DefaultMemoryExpiration)); -- cgit v1.1 From 939c47ac521dee943083d87abe70a7271ee78077 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Feb 2011 01:25:38 +0000 Subject: instead of using different default memory expiration depending on whether there is a [FLOTSAM ASSET CACHE] section present at all, use the same default all the time this simplifies the code --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 90fb9b3..02a4e4d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -92,7 +92,7 @@ namespace Flotsam.RegionModules.AssetCache // Expiration is expressed in hours. private const double m_DefaultMemoryExpiration = 1.0; private const double m_DefaultFileExpiration = 48; - private TimeSpan m_MemoryExpiration = TimeSpan.Zero; + private TimeSpan m_MemoryExpiration = TimeSpan.FromHours(m_DefaultMemoryExpiration); private TimeSpan m_FileExpiration = TimeSpan.Zero; private TimeSpan m_FileExpirationCleanupTimer = TimeSpan.Zero; @@ -245,16 +245,7 @@ namespace Flotsam.RegionModules.AssetCache private void UpdateMemoryCache(string key, AssetBase asset) { if (m_MemoryCacheEnabled) - { - if (m_MemoryExpiration > TimeSpan.Zero) - { - m_MemoryCache.AddOrUpdate(key, asset, m_MemoryExpiration); - } - else - { - m_MemoryCache.AddOrUpdate(key, asset, m_DefaultMemoryExpiration); - } - } + m_MemoryCache.AddOrUpdate(key, asset, m_MemoryExpiration); } public void Cache(AssetBase asset) -- cgit v1.1 From 0f545abfc17392c4a2113b07a945bd4cc7b8366f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Feb 2011 01:31:38 +0000 Subject: Make the file expiration defaults the same whether the whole [FLOTSAM ASSET CACHE] section is missing or just the particular config values --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 02a4e4d..9adb68b 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -93,8 +93,8 @@ namespace Flotsam.RegionModules.AssetCache private const double m_DefaultMemoryExpiration = 1.0; private const double m_DefaultFileExpiration = 48; private TimeSpan m_MemoryExpiration = TimeSpan.FromHours(m_DefaultMemoryExpiration); - private TimeSpan m_FileExpiration = TimeSpan.Zero; - private TimeSpan m_FileExpirationCleanupTimer = TimeSpan.Zero; + private TimeSpan m_FileExpiration = TimeSpan.FromHours(m_DefaultFileExpiration); + private TimeSpan m_FileExpirationCleanupTimer = TimeSpan.FromHours(m_DefaultFileExpiration); private static int m_CacheDirectoryTiers = 1; private static int m_CacheDirectoryTierLen = 3; @@ -441,7 +441,7 @@ namespace Flotsam.RegionModules.AssetCache private void CleanupExpiredFiles(object source, ElapsedEventArgs e) { if (m_LogLevel >= 2) - m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Checking for expired files older then {0}.", m_FileExpiration.ToString()); + m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Checking for expired files older then {0}.", m_FileExpiration); // Purge all files last accessed prior to this point DateTime purgeLine = DateTime.Now - m_FileExpiration; -- cgit v1.1 From 2b04cab1ee4b7c89bdfbe93622f421f031879943 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Feb 2011 02:15:06 +0000 Subject: change some log messages from info to debug --- OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index f8ce444..08ac624 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } } - m_log.InfoFormat("[AVFACTORY]: complete texture check for {0}", client.AgentId); + m_log.DebugFormat("[AVFACTORY]: complete texture check for {0}", client.AgentId); // If we only found default textures, then the appearance is not cached return (defonly ? false : true); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7def7e9..1a6a70b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3210,7 +3210,7 @@ namespace OpenSim.Region.Framework.Scenes // TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport // Don't disable this log message - it's too helpful - m_log.InfoFormat( + m_log.DebugFormat( "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6})", RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode, teleportFlags); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9e9481e..00a1487 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2442,7 +2442,7 @@ namespace OpenSim.Region.Framework.Scenes // If we are using the the cached appearance then send it out to everyone if (cachedappearance) { - m_log.InfoFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); + m_log.DebugFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); // If the avatars baked textures are all in the cache, then we have a // complete appearance... send it out, if not, then we'll send it when -- cgit v1.1 From cea47491de6723230a49b1ac99cecc5c32758f40 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 27 Feb 2011 18:55:17 +0100 Subject: Fix a few little things --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 3 +++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 ++ 2 files changed, 5 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index bd316c6..798547a 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -148,6 +148,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = m_Scene.InventoryService.GetItem(item); + if (item.Owner != remoteClient.AgentId) + return UUID.Zero; + if (item != null) { if ((InventoryType)item.InvType == InventoryType.Notecard) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e2d96d9..fcbcf59 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -321,6 +321,8 @@ namespace OpenSim.Region.Framework.Scenes // Passing something to another avatar or a an object will already InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = InventoryService.GetItem(item); + if (item.Owner != remoteClient.AgentId) + return; if (item != null) { -- cgit v1.1