diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
index 98becce8ba..40daf1343c 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
@@ -58,6 +58,11 @@ namespace OpenSim.Region.RegionCombinerModule
get { return null; }
}
+ ///
+ /// Is this module enabled?
+ ///
+ private bool enabledYN = false;
+
///
/// This holds the root regions for the megaregions.
///
@@ -66,11 +71,6 @@ namespace OpenSim.Region.RegionCombinerModule
///
private Dictionary m_regions = new Dictionary();
- ///
- /// Is this module enabled?
- ///
- private bool enabledYN = false;
-
///
/// The scenes that comprise the megaregion.
///
@@ -717,16 +717,16 @@ namespace OpenSim.Region.RegionCombinerModule
{
ForwardPermissionRequests(rootConn, r.RegionScene);
}
+
+ // Create the root region's Client Event Forwarder
+ rootConn.ClientEventForwarder = new RegionCombinerClientEventForwarder(rootConn);
+
+ // Sets up the CoarseLocationUpdate forwarder for this root region
+ scene.EventManager.OnNewPresence += SetCourseLocationDelegate;
+
+ // Adds this root region to a dictionary of regions that are connectable
+ m_regions.Add(scene.RegionInfo.originRegionID, rootConn);
}
-
- // Create the root region's Client Event Forwarder
- rootConn.ClientEventForwarder = new RegionCombinerClientEventForwarder(rootConn);
-
- // Sets up the CoarseLocationUpdate forwarder for this root region
- scene.EventManager.OnNewPresence += SetCourseLocationDelegate;
-
- // Adds this root region to a dictionary of regions that are connectable
- m_regions.Add(scene.RegionInfo.originRegionID, rootConn);
}
private void SetCourseLocationDelegate(ScenePresence presence)
@@ -983,6 +983,7 @@ namespace OpenSim.Region.RegionCombinerModule
return true;
}
}
+
oborder = null;
return false;
}
@@ -992,14 +993,19 @@ namespace OpenSim.Region.RegionCombinerModule
pPosition = pPosition/(int) Constants.RegionSize;
int OffsetX = (int) pPosition.X;
int OffsetY = (int) pPosition.Y;
- foreach (RegionConnections regConn in m_regions.Values)
+
+ lock (m_regions)
{
- foreach (RegionData reg in regConn.ConnectedRegions)
+ foreach (RegionConnections regConn in m_regions.Values)
{
- if (reg.Offset.X == OffsetX && reg.Offset.Y == OffsetY)
- return reg;
+ foreach (RegionData reg in regConn.ConnectedRegions)
+ {
+ if (reg.Offset.X == OffsetX && reg.Offset.Y == OffsetY)
+ return reg;
+ }
}
}
+
return new RegionData();
}
@@ -1055,18 +1061,17 @@ namespace OpenSim.Region.RegionCombinerModule
}
#region console commands
+
public void FixPhantoms(string module, string[] cmdparams)
{
- List scenes = new List(m_startingScenes.Values);
+ List scenes = new List(m_startingScenes.Values);
+
foreach (Scene s in scenes)
{
- s.ForEachSOG(delegate(SceneObjectGroup e)
- {
- e.AbsolutePosition = e.AbsolutePosition;
- }
- );
+ s.ForEachSOG(so => so.AbsolutePosition = so.AbsolutePosition);
}
}
+
#endregion
}
}