diff options
author | Justin Clark-Casey (justincc) | 2011-03-26 00:42:48 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-03-26 00:42:48 +0000 |
commit | f30bf429c274c9d6d0cfc99513820f759ca94d3e (patch) | |
tree | d1e64261037b08c4c2875467757f04a8107d0b64 /OpenSim/Region/Framework/Scenes | |
parent | minor: make it clearer in the log where we're loading region config files and... (diff) | |
download | opensim-SC-f30bf429c274c9d6d0cfc99513820f759ca94d3e.zip opensim-SC-f30bf429c274c9d6d0cfc99513820f759ca94d3e.tar.gz opensim-SC-f30bf429c274c9d6d0cfc99513820f759ca94d3e.tar.bz2 opensim-SC-f30bf429c274c9d6d0cfc99513820f759ca94d3e.tar.xz |
refactor: rename SOG collections in SceneGraph to make it clearer that they are indexing each part's UUID, not just the root part.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index eca2786..345ed7a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -89,8 +89,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
89 | 89 | ||
90 | protected internal PhysicsScene _PhyScene; | 90 | protected internal PhysicsScene _PhyScene; |
91 | 91 | ||
92 | protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalID = new Dictionary<uint, SceneObjectGroup>(); | 92 | protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalPartID = new Dictionary<uint, SceneObjectGroup>(); |
93 | protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>(); | 93 | protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullPartID = new Dictionary<UUID, SceneObjectGroup>(); |
94 | 94 | ||
95 | private Object m_updateLock = new Object(); | 95 | private Object m_updateLock = new Object(); |
96 | 96 | ||
@@ -131,10 +131,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
131 | m_scenePresenceArray = newlist; | 131 | m_scenePresenceArray = newlist; |
132 | } | 132 | } |
133 | 133 | ||
134 | lock (SceneObjectGroupsByFullID) | 134 | lock (SceneObjectGroupsByFullPartID) |
135 | SceneObjectGroupsByFullID.Clear(); | 135 | SceneObjectGroupsByFullPartID.Clear(); |
136 | lock (SceneObjectGroupsByLocalID) | 136 | lock (SceneObjectGroupsByLocalPartID) |
137 | SceneObjectGroupsByLocalID.Clear(); | 137 | SceneObjectGroupsByLocalPartID.Clear(); |
138 | 138 | ||
139 | Entities.Clear(); | 139 | Entities.Clear(); |
140 | } | 140 | } |
@@ -384,18 +384,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
384 | if (OnObjectCreate != null) | 384 | if (OnObjectCreate != null) |
385 | OnObjectCreate(sceneObject); | 385 | OnObjectCreate(sceneObject); |
386 | 386 | ||
387 | lock (SceneObjectGroupsByFullID) | 387 | lock (SceneObjectGroupsByFullPartID) |
388 | { | 388 | { |
389 | SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; | 389 | SceneObjectGroupsByFullPartID[sceneObject.UUID] = sceneObject; |
390 | foreach (SceneObjectPart part in children) | 390 | foreach (SceneObjectPart part in children) |
391 | SceneObjectGroupsByFullID[part.UUID] = sceneObject; | 391 | SceneObjectGroupsByFullPartID[part.UUID] = sceneObject; |
392 | } | 392 | } |
393 | 393 | ||
394 | lock (SceneObjectGroupsByLocalID) | 394 | lock (SceneObjectGroupsByLocalPartID) |
395 | { | 395 | { |
396 | SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; | 396 | SceneObjectGroupsByLocalPartID[sceneObject.LocalId] = sceneObject; |
397 | foreach (SceneObjectPart part in children) | 397 | foreach (SceneObjectPart part in children) |
398 | SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; | 398 | SceneObjectGroupsByLocalPartID[part.LocalId] = sceneObject; |
399 | } | 399 | } |
400 | 400 | ||
401 | return true; | 401 | return true; |
@@ -427,20 +427,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
427 | if (OnObjectRemove != null) | 427 | if (OnObjectRemove != null) |
428 | OnObjectRemove(Entities[uuid]); | 428 | OnObjectRemove(Entities[uuid]); |
429 | 429 | ||
430 | lock (SceneObjectGroupsByFullID) | 430 | lock (SceneObjectGroupsByFullPartID) |
431 | { | 431 | { |
432 | SceneObjectPart[] parts = grp.Parts; | 432 | SceneObjectPart[] parts = grp.Parts; |
433 | for (int i = 0; i < parts.Length; i++) | 433 | for (int i = 0; i < parts.Length; i++) |
434 | SceneObjectGroupsByFullID.Remove(parts[i].UUID); | 434 | SceneObjectGroupsByFullPartID.Remove(parts[i].UUID); |
435 | SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID); | 435 | SceneObjectGroupsByFullPartID.Remove(grp.RootPart.UUID); |
436 | } | 436 | } |
437 | 437 | ||
438 | lock (SceneObjectGroupsByLocalID) | 438 | lock (SceneObjectGroupsByLocalPartID) |
439 | { | 439 | { |
440 | SceneObjectPart[] parts = grp.Parts; | 440 | SceneObjectPart[] parts = grp.Parts; |
441 | for (int i = 0; i < parts.Length; i++) | 441 | for (int i = 0; i < parts.Length; i++) |
442 | SceneObjectGroupsByLocalID.Remove(parts[i].LocalId); | 442 | SceneObjectGroupsByLocalPartID.Remove(parts[i].LocalId); |
443 | SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId); | 443 | SceneObjectGroupsByLocalPartID.Remove(grp.RootPart.LocalId); |
444 | } | 444 | } |
445 | 445 | ||
446 | return Entities.Remove(uuid); | 446 | return Entities.Remove(uuid); |
@@ -854,14 +854,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
854 | 854 | ||
855 | //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID); | 855 | //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID); |
856 | SceneObjectGroup sog; | 856 | SceneObjectGroup sog; |
857 | lock (SceneObjectGroupsByLocalID) | 857 | lock (SceneObjectGroupsByLocalPartID) |
858 | SceneObjectGroupsByLocalID.TryGetValue(localID, out sog); | 858 | SceneObjectGroupsByLocalPartID.TryGetValue(localID, out sog); |
859 | 859 | ||
860 | if (sog != null) | 860 | if (sog != null) |
861 | { | 861 | { |
862 | if (sog.HasChildPrim(localID)) | 862 | if (sog.HasChildPrim(localID)) |
863 | return sog; | 863 | return sog; |
864 | SceneObjectGroupsByLocalID.Remove(localID); | 864 | SceneObjectGroupsByLocalPartID.Remove(localID); |
865 | } | 865 | } |
866 | 866 | ||
867 | EntityBase[] entityList = GetEntities(); | 867 | EntityBase[] entityList = GetEntities(); |
@@ -873,8 +873,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
873 | sog = (SceneObjectGroup)ent; | 873 | sog = (SceneObjectGroup)ent; |
874 | if (sog.HasChildPrim(localID)) | 874 | if (sog.HasChildPrim(localID)) |
875 | { | 875 | { |
876 | lock (SceneObjectGroupsByLocalID) | 876 | lock (SceneObjectGroupsByLocalPartID) |
877 | SceneObjectGroupsByLocalID[localID] = sog; | 877 | SceneObjectGroupsByLocalPartID[localID] = sog; |
878 | return sog; | 878 | return sog; |
879 | } | 879 | } |
880 | } | 880 | } |
@@ -891,16 +891,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
891 | private SceneObjectGroup GetGroupByPrim(UUID fullID) | 891 | private SceneObjectGroup GetGroupByPrim(UUID fullID) |
892 | { | 892 | { |
893 | SceneObjectGroup sog; | 893 | SceneObjectGroup sog; |
894 | lock (SceneObjectGroupsByFullID) | 894 | lock (SceneObjectGroupsByFullPartID) |
895 | SceneObjectGroupsByFullID.TryGetValue(fullID, out sog); | 895 | SceneObjectGroupsByFullPartID.TryGetValue(fullID, out sog); |
896 | 896 | ||
897 | if (sog != null) | 897 | if (sog != null) |
898 | { | 898 | { |
899 | if (sog.ContainsPart(fullID)) | 899 | if (sog.ContainsPart(fullID)) |
900 | return sog; | 900 | return sog; |
901 | 901 | ||
902 | lock (SceneObjectGroupsByFullID) | 902 | lock (SceneObjectGroupsByFullPartID) |
903 | SceneObjectGroupsByFullID.Remove(fullID); | 903 | SceneObjectGroupsByFullPartID.Remove(fullID); |
904 | } | 904 | } |
905 | 905 | ||
906 | EntityBase[] entityList = GetEntities(); | 906 | EntityBase[] entityList = GetEntities(); |
@@ -911,8 +911,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
911 | sog = (SceneObjectGroup)ent; | 911 | sog = (SceneObjectGroup)ent; |
912 | if (sog.HasChildPrim(fullID)) | 912 | if (sog.HasChildPrim(fullID)) |
913 | { | 913 | { |
914 | lock (SceneObjectGroupsByFullID) | 914 | lock (SceneObjectGroupsByFullPartID) |
915 | SceneObjectGroupsByFullID[fullID] = sog; | 915 | SceneObjectGroupsByFullPartID[fullID] = sog; |
916 | return sog; | 916 | return sog; |
917 | } | 917 | } |
918 | } | 918 | } |
@@ -1069,7 +1069,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1069 | /// <param name="action"></param> | 1069 | /// <param name="action"></param> |
1070 | protected internal void ForEachSOG(Action<SceneObjectGroup> action) | 1070 | protected internal void ForEachSOG(Action<SceneObjectGroup> action) |
1071 | { | 1071 | { |
1072 | List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values); | 1072 | List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullPartID.Values); |
1073 | foreach (SceneObjectGroup obj in objlist) | 1073 | foreach (SceneObjectGroup obj in objlist) |
1074 | { | 1074 | { |
1075 | try | 1075 | try |