aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-03-26 00:57:52 +0000
committerJustin Clark-Casey (justincc)2011-03-26 00:57:52 +0000
commit3d0e072d500f0d76547fb6f93848a289ee42af9f (patch)
treef387ac0d7e5579d6b53fb282c0209b2053063039 /OpenSim
parentAdd test for PCM taint. This currently fails due to unexpected behaviour of ... (diff)
parentMake SceneGraph.ForEachSOG() execute once for each SOG, not once for each pri... (diff)
downloadopensim-SC_OLD-3d0e072d500f0d76547fb6f93848a289ee42af9f.zip
opensim-SC_OLD-3d0e072d500f0d76547fb6f93848a289ee42af9f.tar.gz
opensim-SC_OLD-3d0e072d500f0d76547fb6f93848a289ee42af9f.tar.bz2
opensim-SC_OLD-3d0e072d500f0d76547fb6f93848a289ee42af9f.tar.xz
Merge branch 'master' into primcounts
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs28
-rw-r--r--OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs24
-rw-r--r--OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs76
4 files changed, 83 insertions, 49 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
index f37c399..e26c1d2 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -68,7 +68,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
68 68
69 public void Initialise() 69 public void Initialise()
70 { 70 {
71 m_log.Error("[LOADREGIONS]: " + Name + " cannot be default-initialized!"); 71 m_log.Error("[LOAD REGIONS PLUGIN]: " + Name + " cannot be default-initialized!");
72 throw new PluginNotInitialisedException(Name); 72 throw new PluginNotInitialisedException(Name);
73 } 73 }
74 74
@@ -85,41 +85,39 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
85 IRegionLoader regionLoader; 85 IRegionLoader regionLoader;
86 if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem") 86 if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
87 { 87 {
88 m_log.Info("[LOADREGIONS]: Loading region configurations from filesystem"); 88 m_log.Info("[LOAD REGIONS PLUGIN]: Loading region configurations from filesystem");
89 regionLoader = new RegionLoaderFileSystem(); 89 regionLoader = new RegionLoaderFileSystem();
90 } 90 }
91 else 91 else
92 { 92 {
93 m_log.Info("[LOADREGIONSPLUGIN]: Loading region configurations from web"); 93 m_log.Info("[LOAD REGIONS PLUGIN]: Loading region configurations from web");
94 regionLoader = new RegionLoaderWebServer(); 94 regionLoader = new RegionLoaderWebServer();
95 } 95 }
96 96
97 m_log.Info("[LOADREGIONSPLUGIN]: Loading region configurations...");
98
99 regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source); 97 regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source);
100 RegionInfo[] regionsToLoad = regionLoader.LoadRegions(); 98 RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
101 99
102 m_log.Info("[LOADREGIONSPLUGIN]: Loading specific shared modules..."); 100 m_log.Info("[LOAD REGIONS PLUGIN]: Loading specific shared modules...");
103 m_log.Info("[LOADREGIONSPLUGIN]: DynamicTextureModule..."); 101 m_log.Info("[LOAD REGIONS PLUGIN]: DynamicTextureModule...");
104 m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule()); 102 m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
105 m_log.Info("[LOADREGIONSPLUGIN]: LoadImageURLModule..."); 103 m_log.Info("[LOAD REGIONS PLUGIN]: LoadImageURLModule...");
106 m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule()); 104 m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
107 m_log.Info("[LOADREGIONSPLUGIN]: XMLRPCModule..."); 105 m_log.Info("[LOAD REGIONS PLUGIN]: XMLRPCModule...");
108 m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule()); 106 m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
109// m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule..."); 107// m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule...");
110// m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule()); 108// m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
111 m_log.Info("[LOADREGIONSPLUGIN]: Done."); 109 m_log.Info("[LOAD REGIONS PLUGIN]: Done.");
112 110
113 if (!CheckRegionsForSanity(regionsToLoad)) 111 if (!CheckRegionsForSanity(regionsToLoad))
114 { 112 {
115 m_log.Error("[LOADREGIONS]: Halting startup due to conflicts in region configurations"); 113 m_log.Error("[LOAD REGIONS PLUGIN]: Halting startup due to conflicts in region configurations");
116 Environment.Exit(1); 114 Environment.Exit(1);
117 } 115 }
118 116
119 for (int i = 0; i < regionsToLoad.Length; i++) 117 for (int i = 0; i < regionsToLoad.Length; i++)
120 { 118 {
121 IScene scene; 119 IScene scene;
122 m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + 120 m_log.Debug("[LOAD REGIONS PLUGIN]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
123 Thread.CurrentThread.ManagedThreadId.ToString() + 121 Thread.CurrentThread.ManagedThreadId.ToString() +
124 ")"); 122 ")");
125 123
@@ -164,7 +162,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
164 if (regions[i].RegionID == regions[j].RegionID) 162 if (regions[i].RegionID == regions[j].RegionID)
165 { 163 {
166 m_log.ErrorFormat( 164 m_log.ErrorFormat(
167 "[LOADREGIONS]: Regions {0} and {1} have the same UUID {2}", 165 "[LOAD REGIONS PLUGIN]: Regions {0} and {1} have the same UUID {2}",
168 regions[i].RegionName, regions[j].RegionName, regions[i].RegionID); 166 regions[i].RegionName, regions[j].RegionName, regions[i].RegionID);
169 return false; 167 return false;
170 } 168 }
@@ -172,14 +170,14 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
172 regions[i].RegionLocX == regions[j].RegionLocX && regions[i].RegionLocY == regions[j].RegionLocY) 170 regions[i].RegionLocX == regions[j].RegionLocX && regions[i].RegionLocY == regions[j].RegionLocY)
173 { 171 {
174 m_log.ErrorFormat( 172 m_log.ErrorFormat(
175 "[LOADREGIONS]: Regions {0} and {1} have the same grid location ({2}, {3})", 173 "[LOAD REGIONS PLUGIN]: Regions {0} and {1} have the same grid location ({2}, {3})",
176 regions[i].RegionName, regions[j].RegionName, regions[i].RegionLocX, regions[i].RegionLocY); 174 regions[i].RegionName, regions[j].RegionName, regions[i].RegionLocX, regions[i].RegionLocY);
177 return false; 175 return false;
178 } 176 }
179 else if (regions[i].InternalEndPoint.Port == regions[j].InternalEndPoint.Port) 177 else if (regions[i].InternalEndPoint.Port == regions[j].InternalEndPoint.Port)
180 { 178 {
181 m_log.ErrorFormat( 179 m_log.ErrorFormat(
182 "[LOADREGIONS]: Regions {0} and {1} have the same internal IP port {2}", 180 "[LOAD REGIONS PLUGIN]: Regions {0} and {1} have the same internal IP port {2}",
183 regions[i].RegionName, regions[j].RegionName, regions[i].InternalEndPoint.Port); 181 regions[i].RegionName, regions[j].RegionName, regions[i].InternalEndPoint.Port);
184 return false; 182 return false;
185 } 183 }
diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
index 63e09ae..0aae4ff 100644
--- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
+++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
@@ -25,15 +25,19 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using log4net;
28using System; 29using System;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.IO; 31using System.IO;
32using System.Reflection;
31using Nini.Config; 33using Nini.Config;
32 34
33namespace OpenSim.Framework.RegionLoader.Filesystem 35namespace OpenSim.Framework.RegionLoader.Filesystem
34{ 36{
35 public class RegionLoaderFileSystem : IRegionLoader 37 public class RegionLoaderFileSystem : IRegionLoader
36 { 38 {
39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40
37 private IConfigSource m_configSource; 41 private IConfigSource m_configSource;
38 42
39 public void SetIniConfigSource(IConfigSource configSource) 43 public void SetIniConfigSource(IConfigSource configSource)
@@ -63,36 +67,48 @@ namespace OpenSim.Framework.RegionLoader.Filesystem
63 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 67 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
64 string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); 68 string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
65 69
70 // Create an empty Regions.ini if there are no existing config files.
66 if (configFiles.Length == 0 && iniFiles.Length == 0) 71 if (configFiles.Length == 0 && iniFiles.Length == 0)
67 { 72 {
68 new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); 73 new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource);
69 iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); 74 iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
70 } 75 }
76
77 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath);
71 78
72 List<RegionInfo> regionInfos = new List<RegionInfo>(); 79 List<RegionInfo> regionInfos = new List<RegionInfo>();
73 80
74 int i = 0; 81 int i = 0;
75 foreach (string file in iniFiles) 82 foreach (string file in iniFiles)
76 { 83 {
84 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
85
77 IConfigSource source = new IniConfigSource(file); 86 IConfigSource source = new IniConfigSource(file);
78 87
79 foreach (IConfig config in source.Configs) 88 foreach (IConfig config in source.Configs)
80 { 89 {
81 //m_log.Info("[REGIONLOADERFILESYSTEM]: Creating RegionInfo for " + config.Name);
82 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); 90 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name);
83 regionInfos.Add(regionInfo); 91 regionInfos.Add(regionInfo);
92
93 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
94
84 i++; 95 i++;
85 } 96 }
86 } 97 }
87 98
88 foreach (string file in configFiles) 99 foreach (string file in configFiles)
89 { 100 {
101 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
102
90 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); 103 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource);
91 regionInfos.Add(regionInfo); 104 regionInfos.Add(regionInfo);
105
106 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
107
92 i++; 108 i++;
93 } 109 }
94 110
95 return regionInfos.ToArray(); 111 return regionInfos.ToArray();
96 } 112 }
97 } 113 }
98} 114} \ No newline at end of file
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
index 0ec4af5..de4898a 100644
--- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
+++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
@@ -66,9 +66,9 @@ namespace OpenSim.Framework.RegionLoader.Web
66 { 66 {
67 HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); 67 HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
68 webRequest.Timeout = 30000; //30 Second Timeout 68 webRequest.Timeout = 30000; //30 Second Timeout
69 m_log.Debug("[WEBLOADER]: Sending Download Request..."); 69 m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url);
70 HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); 70 HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
71 m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server..."); 71 m_log.Debug("[WEBLOADER]: Downloading region information...");
72 StreamReader reader = new StreamReader(webResponse.GetResponseStream()); 72 StreamReader reader = new StreamReader(webResponse.GetResponseStream());
73 string xmlSource = String.Empty; 73 string xmlSource = String.Empty;
74 string tempStr = reader.ReadLine(); 74 string tempStr = reader.ReadLine();
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index eca2786..1621398 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -88,9 +88,21 @@ namespace OpenSim.Region.Framework.Scenes
88 protected internal object m_syncRoot = new object(); 88 protected internal object m_syncRoot = new object();
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 /// <summary>
93 /// Index the SceneObjectGroup for each part by the root part's UUID.
94 /// </summary>
93 protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>(); 95 protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>();
96
97 /// <summary>
98 /// Index the SceneObjectGroup for each part by that part's UUID.
99 /// </summary>
100 protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullPartID = new Dictionary<UUID, SceneObjectGroup>();
101
102 /// <summary>
103 /// Index the SceneObjectGroup for each part by that part's local ID.
104 /// </summary>
105 protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalPartID = new Dictionary<uint, SceneObjectGroup>();
94 106
95 private Object m_updateLock = new Object(); 107 private Object m_updateLock = new Object();
96 108
@@ -133,8 +145,10 @@ namespace OpenSim.Region.Framework.Scenes
133 145
134 lock (SceneObjectGroupsByFullID) 146 lock (SceneObjectGroupsByFullID)
135 SceneObjectGroupsByFullID.Clear(); 147 SceneObjectGroupsByFullID.Clear();
136 lock (SceneObjectGroupsByLocalID) 148 lock (SceneObjectGroupsByFullPartID)
137 SceneObjectGroupsByLocalID.Clear(); 149 SceneObjectGroupsByFullPartID.Clear();
150 lock (SceneObjectGroupsByLocalPartID)
151 SceneObjectGroupsByLocalPartID.Clear();
138 152
139 Entities.Clear(); 153 Entities.Clear();
140 } 154 }
@@ -385,17 +399,20 @@ namespace OpenSim.Region.Framework.Scenes
385 OnObjectCreate(sceneObject); 399 OnObjectCreate(sceneObject);
386 400
387 lock (SceneObjectGroupsByFullID) 401 lock (SceneObjectGroupsByFullID)
388 {
389 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 402 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
403
404 lock (SceneObjectGroupsByFullPartID)
405 {
406 SceneObjectGroupsByFullPartID[sceneObject.UUID] = sceneObject;
390 foreach (SceneObjectPart part in children) 407 foreach (SceneObjectPart part in children)
391 SceneObjectGroupsByFullID[part.UUID] = sceneObject; 408 SceneObjectGroupsByFullPartID[part.UUID] = sceneObject;
392 } 409 }
393 410
394 lock (SceneObjectGroupsByLocalID) 411 lock (SceneObjectGroupsByLocalPartID)
395 { 412 {
396 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; 413 SceneObjectGroupsByLocalPartID[sceneObject.LocalId] = sceneObject;
397 foreach (SceneObjectPart part in children) 414 foreach (SceneObjectPart part in children)
398 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; 415 SceneObjectGroupsByLocalPartID[part.LocalId] = sceneObject;
399 } 416 }
400 417
401 return true; 418 return true;
@@ -426,21 +443,24 @@ namespace OpenSim.Region.Framework.Scenes
426 443
427 if (OnObjectRemove != null) 444 if (OnObjectRemove != null)
428 OnObjectRemove(Entities[uuid]); 445 OnObjectRemove(Entities[uuid]);
429 446
430 lock (SceneObjectGroupsByFullID) 447 lock (SceneObjectGroupsByFullID)
448 SceneObjectGroupsByFullID.Remove(grp.UUID);
449
450 lock (SceneObjectGroupsByFullPartID)
431 { 451 {
432 SceneObjectPart[] parts = grp.Parts; 452 SceneObjectPart[] parts = grp.Parts;
433 for (int i = 0; i < parts.Length; i++) 453 for (int i = 0; i < parts.Length; i++)
434 SceneObjectGroupsByFullID.Remove(parts[i].UUID); 454 SceneObjectGroupsByFullPartID.Remove(parts[i].UUID);
435 SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID); 455 SceneObjectGroupsByFullPartID.Remove(grp.RootPart.UUID);
436 } 456 }
437 457
438 lock (SceneObjectGroupsByLocalID) 458 lock (SceneObjectGroupsByLocalPartID)
439 { 459 {
440 SceneObjectPart[] parts = grp.Parts; 460 SceneObjectPart[] parts = grp.Parts;
441 for (int i = 0; i < parts.Length; i++) 461 for (int i = 0; i < parts.Length; i++)
442 SceneObjectGroupsByLocalID.Remove(parts[i].LocalId); 462 SceneObjectGroupsByLocalPartID.Remove(parts[i].LocalId);
443 SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId); 463 SceneObjectGroupsByLocalPartID.Remove(grp.RootPart.LocalId);
444 } 464 }
445 465
446 return Entities.Remove(uuid); 466 return Entities.Remove(uuid);
@@ -854,14 +874,14 @@ namespace OpenSim.Region.Framework.Scenes
854 874
855 //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID); 875 //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID);
856 SceneObjectGroup sog; 876 SceneObjectGroup sog;
857 lock (SceneObjectGroupsByLocalID) 877 lock (SceneObjectGroupsByLocalPartID)
858 SceneObjectGroupsByLocalID.TryGetValue(localID, out sog); 878 SceneObjectGroupsByLocalPartID.TryGetValue(localID, out sog);
859 879
860 if (sog != null) 880 if (sog != null)
861 { 881 {
862 if (sog.HasChildPrim(localID)) 882 if (sog.HasChildPrim(localID))
863 return sog; 883 return sog;
864 SceneObjectGroupsByLocalID.Remove(localID); 884 SceneObjectGroupsByLocalPartID.Remove(localID);
865 } 885 }
866 886
867 EntityBase[] entityList = GetEntities(); 887 EntityBase[] entityList = GetEntities();
@@ -873,8 +893,8 @@ namespace OpenSim.Region.Framework.Scenes
873 sog = (SceneObjectGroup)ent; 893 sog = (SceneObjectGroup)ent;
874 if (sog.HasChildPrim(localID)) 894 if (sog.HasChildPrim(localID))
875 { 895 {
876 lock (SceneObjectGroupsByLocalID) 896 lock (SceneObjectGroupsByLocalPartID)
877 SceneObjectGroupsByLocalID[localID] = sog; 897 SceneObjectGroupsByLocalPartID[localID] = sog;
878 return sog; 898 return sog;
879 } 899 }
880 } 900 }
@@ -891,16 +911,16 @@ namespace OpenSim.Region.Framework.Scenes
891 private SceneObjectGroup GetGroupByPrim(UUID fullID) 911 private SceneObjectGroup GetGroupByPrim(UUID fullID)
892 { 912 {
893 SceneObjectGroup sog; 913 SceneObjectGroup sog;
894 lock (SceneObjectGroupsByFullID) 914 lock (SceneObjectGroupsByFullPartID)
895 SceneObjectGroupsByFullID.TryGetValue(fullID, out sog); 915 SceneObjectGroupsByFullPartID.TryGetValue(fullID, out sog);
896 916
897 if (sog != null) 917 if (sog != null)
898 { 918 {
899 if (sog.ContainsPart(fullID)) 919 if (sog.ContainsPart(fullID))
900 return sog; 920 return sog;
901 921
902 lock (SceneObjectGroupsByFullID) 922 lock (SceneObjectGroupsByFullPartID)
903 SceneObjectGroupsByFullID.Remove(fullID); 923 SceneObjectGroupsByFullPartID.Remove(fullID);
904 } 924 }
905 925
906 EntityBase[] entityList = GetEntities(); 926 EntityBase[] entityList = GetEntities();
@@ -911,8 +931,8 @@ namespace OpenSim.Region.Framework.Scenes
911 sog = (SceneObjectGroup)ent; 931 sog = (SceneObjectGroup)ent;
912 if (sog.HasChildPrim(fullID)) 932 if (sog.HasChildPrim(fullID))
913 { 933 {
914 lock (SceneObjectGroupsByFullID) 934 lock (SceneObjectGroupsByFullPartID)
915 SceneObjectGroupsByFullID[fullID] = sog; 935 SceneObjectGroupsByFullPartID[fullID] = sog;
916 return sog; 936 return sog;
917 } 937 }
918 } 938 }
@@ -1064,11 +1084,12 @@ namespace OpenSim.Region.Framework.Scenes
1064 } 1084 }
1065 1085
1066 /// <summary> 1086 /// <summary>
1067 /// Performs action on all scene object groups. 1087 /// Performs action once on all scene object groups.
1068 /// </summary> 1088 /// </summary>
1069 /// <param name="action"></param> 1089 /// <param name="action"></param>
1070 protected internal void ForEachSOG(Action<SceneObjectGroup> action) 1090 protected internal void ForEachSOG(Action<SceneObjectGroup> action)
1071 { 1091 {
1092 // FIXME: Need to lock here, really.
1072 List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values); 1093 List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values);
1073 foreach (SceneObjectGroup obj in objlist) 1094 foreach (SceneObjectGroup obj in objlist)
1074 { 1095 {
@@ -1084,7 +1105,6 @@ namespace OpenSim.Region.Framework.Scenes
1084 } 1105 }
1085 } 1106 }
1086 } 1107 }
1087
1088 1108
1089 /// <summary> 1109 /// <summary>
1090 /// Performs action on all scene presences. This can ultimately run the actions in parallel but 1110 /// Performs action on all scene presences. This can ultimately run the actions in parallel but