diff options
author | Dan Lake | 2011-10-06 22:47:33 -0700 |
---|---|---|
committer | Dan Lake | 2011-10-06 22:47:33 -0700 |
commit | 4748c19bdbcdcaf6050e1f04a5f7394a88e0bf3e (patch) | |
tree | dc2b8f85bebe216378d54dab9410f0a8805145cf /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-4748c19bdbcdcaf6050e1f04a5f7394a88e0bf3e.zip opensim-SC_OLD-4748c19bdbcdcaf6050e1f04a5f7394a88e0bf3e.tar.gz opensim-SC_OLD-4748c19bdbcdcaf6050e1f04a5f7394a88e0bf3e.tar.bz2 opensim-SC_OLD-4748c19bdbcdcaf6050e1f04a5f7394a88e0bf3e.tar.xz |
Refactored "known child region" in ScenePresence. There were 4 different
ways to access the list/dictionary of child regions and locking was
inconsistent. There are now public properties which enforce locks.
Callers are no longer required to create new copies of lists.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b1755ac..992e6c5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1109,9 +1109,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1109 | 1109 | ||
1110 | // Kick all ROOT agents with the message, 'The simulator is going down' | 1110 | // Kick all ROOT agents with the message, 'The simulator is going down' |
1111 | ForEachScenePresence(delegate(ScenePresence avatar) | 1111 | ForEachScenePresence(delegate(ScenePresence avatar) |
1112 | { | 1112 | { |
1113 | if (avatar.KnownChildRegionHandles.Contains(RegionInfo.RegionHandle)) | 1113 | avatar.RemoveNeighbourRegion(RegionInfo.RegionHandle); |
1114 | avatar.KnownChildRegionHandles.Remove(RegionInfo.RegionHandle); | ||
1115 | 1114 | ||
1116 | if (!avatar.IsChildAgent) | 1115 | if (!avatar.IsChildAgent) |
1117 | avatar.ControllingClient.Kick("The simulator is going down."); | 1116 | avatar.ControllingClient.Kick("The simulator is going down."); |
@@ -3103,14 +3102,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3103 | avatar.Scene.NeedSceneCacheClear(avatar.UUID); | 3102 | avatar.Scene.NeedSceneCacheClear(avatar.UUID); |
3104 | 3103 | ||
3105 | if (closeChildAgents && !avatar.IsChildAgent) | 3104 | if (closeChildAgents && !avatar.IsChildAgent) |
3106 | { | 3105 | { |
3107 | //List<ulong> childknownRegions = new List<ulong>(); | 3106 | List<ulong> regions = avatar.KnownRegionHandles; |
3108 | //List<ulong> ckn = avatar.KnownChildRegionHandles; | ||
3109 | //for (int i = 0; i < ckn.Count; i++) | ||
3110 | //{ | ||
3111 | // childknownRegions.Add(ckn[i]); | ||
3112 | //} | ||
3113 | List<ulong> regions = new List<ulong>(avatar.KnownChildRegionHandles); | ||
3114 | regions.Remove(RegionInfo.RegionHandle); | 3107 | regions.Remove(RegionInfo.RegionHandle); |
3115 | m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); | 3108 | m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); |
3116 | } | 3109 | } |
@@ -3181,7 +3174,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3181 | { | 3174 | { |
3182 | for (int i = 0; i < regionslst.Count; i++) | 3175 | for (int i = 0; i < regionslst.Count; i++) |
3183 | { | 3176 | { |
3184 | av.KnownChildRegionHandles.Remove(regionslst[i]); | 3177 | av.RemoveNeighbourRegion(regionslst[i]); |
3185 | } | 3178 | } |
3186 | } | 3179 | } |
3187 | } | 3180 | } |
@@ -3674,7 +3667,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3674 | 3667 | ||
3675 | if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret)) | 3668 | if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret)) |
3676 | { | 3669 | { |
3677 | m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, new List<ulong>(loggingOffUser.KnownRegions.Keys)); | 3670 | m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles); |
3678 | loggingOffUser.ControllingClient.Kick(message); | 3671 | loggingOffUser.ControllingClient.Kick(message); |
3679 | // Give them a second to receive the message! | 3672 | // Give them a second to receive the message! |
3680 | Thread.Sleep(1000); | 3673 | Thread.Sleep(1000); |