From 4b46b7a5adb1c7449725ed1cf1fa5d7122af10bb Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 6 Oct 2011 23:20:51 -0700 Subject: Fixed line endings from previous commit --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 94 +++++++++++----------- .../Scenes/Tests/ScenePresenceAgentTests.cs | 4 +- 3 files changed, 51 insertions(+), 51 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 992e6c5..bcf668f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1109,7 +1109,7 @@ namespace OpenSim.Region.Framework.Scenes // Kick all ROOT agents with the message, 'The simulator is going down' ForEachScenePresence(delegate(ScenePresence avatar) - { + { avatar.RemoveNeighbourRegion(RegionInfo.RegionHandle); if (!avatar.IsChildAgent) @@ -3102,7 +3102,7 @@ namespace OpenSim.Region.Framework.Scenes avatar.Scene.NeedSceneCacheClear(avatar.UUID); if (closeChildAgents && !avatar.IsChildAgent) - { + { List regions = avatar.KnownRegionHandles; regions.Remove(RegionInfo.RegionHandle); m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e7ef377..213f51d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1075,10 +1075,10 @@ namespace OpenSim.Region.Framework.Scenes public void StopFlying() { ControllingClient.StopFlying(this); - } - - // neighbouring regions we have enabled a child agent in - // holds the seed cap for the child agent in that region + } + + // 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(); public void AddNeighbourRegion(ulong regionHandle, string cap) @@ -1095,12 +1095,12 @@ namespace OpenSim.Region.Framework.Scenes } public void RemoveNeighbourRegion(ulong regionHandle) - { + { lock (m_knownChildRegions) { // Checking ContainsKey is redundant as Remove works either way and returns a bool - // This is here to allow the Debug output to be conditional on removal - //if (m_knownChildRegions.ContainsKey(regionHandle)) + // This is here to allow the Debug output to be conditional on removal + //if (m_knownChildRegions.ContainsKey(regionHandle)) // m_log.DebugFormat(" !!! removing known region {0} in {1}. Count = {2}", regionHandle, Scene.RegionInfo.RegionName, m_knownChildRegions.Count); m_knownChildRegions.Remove(regionHandle); } @@ -1113,39 +1113,39 @@ namespace OpenSim.Region.Framework.Scenes RemoveNeighbourRegion(handle); Scene.CapsModule.DropChildSeed(UUID, handle); } - } - - public Dictionary KnownRegions - { - get - { - lock (m_knownChildRegions) - return new Dictionary(m_knownChildRegions); - } - set - { - // Replacing the reference is atomic but we still need to lock on - // the original dictionary object which may be in use elsewhere - lock (m_knownChildRegions) - m_knownChildRegions = value; - } - } - - public List KnownRegionHandles - { - get - { - return new List(KnownRegions.Keys); - } - } - - public int KnownRegionCount - { - get - { - lock (m_knownChildRegions) - return m_knownChildRegions.Count; - } + } + + public Dictionary KnownRegions + { + get + { + lock (m_knownChildRegions) + return new Dictionary(m_knownChildRegions); + } + set + { + // Replacing the reference is atomic but we still need to lock on + // the original dictionary object which may be in use elsewhere + lock (m_knownChildRegions) + m_knownChildRegions = value; + } + } + + public List KnownRegionHandles + { + get + { + return new List(KnownRegions.Keys); + } + } + + public int KnownRegionCount + { + get + { + lock (m_knownChildRegions) + return m_knownChildRegions.Count; + } } #endregion @@ -2986,13 +2986,13 @@ namespace OpenSim.Region.Framework.Scenes /// public void CloseChildAgents(uint newRegionX, uint newRegionY) { - List byebyeRegions = new List(); + List byebyeRegions = new List(); List knownRegions = KnownRegionHandles; m_log.DebugFormat( "[SCENE PRESENCE]: Closing child agents. Checking {0} regions in {1}", knownRegions.Count, Scene.RegionInfo.RegionName); - //DumpKnownRegions(); - + //DumpKnownRegions(); + foreach (ulong handle in knownRegions) { // Don't close the agent on this region yet @@ -3434,10 +3434,10 @@ namespace OpenSim.Region.Framework.Scenes public void Close() { if (!IsChildAgent) - m_scene.AttachmentsModule.DeleteAttachmentsFromScene(this, false); - - // Clear known regions - KnownRegions = new Dictionary(); + m_scene.AttachmentsModule.DeleteAttachmentsFromScene(this, false); + + // Clear known regions + KnownRegions = new Dictionary(); lock (m_reprioritization_timer) { diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index 119eb1f..f0bbf0b 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs @@ -215,8 +215,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests string cap = presence.ControllingClient.RequestClientInfo().CapsPath; presence.AddNeighbourRegion(region2, cap); - presence.AddNeighbourRegion(region3, cap); - + presence.AddNeighbourRegion(region3, cap); + Assert.That(presence.KnownRegionCount, Is.EqualTo(2)); } -- cgit v1.1