Improve locking of RegionCombinerModule.m_regions
parent
5759313f7f
commit
0db60eea85
|
@ -58,6 +58,11 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||||
get { return null; }
|
get { return null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is this module enabled?
|
||||||
|
/// </summary>
|
||||||
|
private bool enabledYN = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This holds the root regions for the megaregions.
|
/// This holds the root regions for the megaregions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -66,11 +71,6 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>();
|
private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Is this module enabled?
|
|
||||||
/// </summary>
|
|
||||||
private bool enabledYN = false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The scenes that comprise the megaregion.
|
/// The scenes that comprise the megaregion.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -717,16 +717,16 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||||
{
|
{
|
||||||
ForwardPermissionRequests(rootConn, r.RegionScene);
|
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)
|
private void SetCourseLocationDelegate(ScenePresence presence)
|
||||||
|
@ -983,6 +983,7 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
oborder = null;
|
oborder = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -992,14 +993,19 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||||
pPosition = pPosition/(int) Constants.RegionSize;
|
pPosition = pPosition/(int) Constants.RegionSize;
|
||||||
int OffsetX = (int) pPosition.X;
|
int OffsetX = (int) pPosition.X;
|
||||||
int OffsetY = (int) pPosition.Y;
|
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)
|
foreach (RegionData reg in regConn.ConnectedRegions)
|
||||||
return reg;
|
{
|
||||||
|
if (reg.Offset.X == OffsetX && reg.Offset.Y == OffsetY)
|
||||||
|
return reg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new RegionData();
|
return new RegionData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1055,18 +1061,17 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||||
}
|
}
|
||||||
|
|
||||||
#region console commands
|
#region console commands
|
||||||
|
|
||||||
public void FixPhantoms(string module, string[] cmdparams)
|
public void FixPhantoms(string module, string[] cmdparams)
|
||||||
{
|
{
|
||||||
List<Scene> scenes = new List<Scene>(m_startingScenes.Values);
|
List<Scene> scenes = new List<Scene>(m_startingScenes.Values);
|
||||||
|
|
||||||
foreach (Scene s in scenes)
|
foreach (Scene s in scenes)
|
||||||
{
|
{
|
||||||
s.ForEachSOG(delegate(SceneObjectGroup e)
|
s.ForEachSOG(so => so.AbsolutePosition = so.AbsolutePosition);
|
||||||
{
|
|
||||||
e.AbsolutePosition = e.AbsolutePosition;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue