Broke the monster RegionLoaded method in RegionCombinerModule into 4 smaller methods. Let's see if this avoids a mono bug that is making megaregions not work in mono. Long shot, but worth a try.
parent
3294714099
commit
05f7fa1543
|
@ -299,10 +299,56 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
//xxy
|
||||
//xxx
|
||||
|
||||
|
||||
if ((((int)conn.X * (int)Constants.RegionSize) + conn.XEnd
|
||||
>= (regionConnections.X * (int)Constants.RegionSize))
|
||||
&& (((int)conn.Y * (int)Constants.RegionSize)
|
||||
>= (regionConnections.Y * (int)Constants.RegionSize)))
|
||||
{
|
||||
connectedYN = DoWorkForOneRegionOverPlusXY(conn, regionConnections, scene);
|
||||
break;
|
||||
}
|
||||
|
||||
// If we're one region over x +y
|
||||
//xyx
|
||||
//xxx
|
||||
//xxx
|
||||
if ((((int)conn.X * (int)Constants.RegionSize)
|
||||
>= (regionConnections.X * (int)Constants.RegionSize))
|
||||
&& (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd
|
||||
>= (regionConnections.Y * (int)Constants.RegionSize)))
|
||||
{
|
||||
connectedYN = DoWorkForOneRegionOverXPlusY(conn, regionConnections, scene);
|
||||
break;
|
||||
}
|
||||
|
||||
// If we're one region over +x +y
|
||||
//xxy
|
||||
//xxx
|
||||
//xxx
|
||||
if ((((int)conn.X * (int)Constants.RegionSize) + conn.YEnd
|
||||
>= (regionConnections.X * (int)Constants.RegionSize))
|
||||
&& (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd
|
||||
>= (regionConnections.Y * (int)Constants.RegionSize)))
|
||||
{
|
||||
connectedYN = DoWorkForOneRegionOverPlusXPlusY(conn, regionConnections, scene);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// If !connectYN means that this region is a root region
|
||||
if (!connectedYN)
|
||||
{
|
||||
DoWorkForRootRegion(regionConnections, scene);
|
||||
|
||||
}
|
||||
}
|
||||
// Set up infinite borders around the entire AABB of the combined ConnectedRegions
|
||||
AdjustLargeRegionBounds();
|
||||
}
|
||||
|
||||
private bool DoWorkForOneRegionOverPlusXY(RegionConnections conn, RegionConnections regionConnections, Scene scene)
|
||||
{
|
||||
Vector3 offset = Vector3.Zero;
|
||||
offset.X = (((regionConnections.X * (int)Constants.RegionSize)) -
|
||||
|
@ -368,18 +414,11 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
// Create a client event forwarder and add this region's events to the root region.
|
||||
if (conn.ClientEventForwarder != null)
|
||||
conn.ClientEventForwarder.AddSceneToEventForwarding(scene);
|
||||
connectedYN = true;
|
||||
break;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we're one region over x +y
|
||||
//xyx
|
||||
//xxx
|
||||
//xxx
|
||||
if ((((int)conn.X * (int)Constants.RegionSize)
|
||||
>= (regionConnections.X * (int)Constants.RegionSize))
|
||||
&& (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd
|
||||
>= (regionConnections.Y * (int)Constants.RegionSize)))
|
||||
private bool DoWorkForOneRegionOverXPlusY(RegionConnections conn, RegionConnections regionConnections, Scene scene)
|
||||
{
|
||||
Vector3 offset = Vector3.Zero;
|
||||
offset.X = (((regionConnections.X * (int)Constants.RegionSize)) -
|
||||
|
@ -430,18 +469,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
conn.RegionScene.BordersLocked = false;
|
||||
if (conn.ClientEventForwarder != null)
|
||||
conn.ClientEventForwarder.AddSceneToEventForwarding(scene);
|
||||
connectedYN = true;
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we're one region over +x +y
|
||||
//xxy
|
||||
//xxx
|
||||
//xxx
|
||||
if ((((int)conn.X * (int)Constants.RegionSize) + conn.YEnd
|
||||
>= (regionConnections.X * (int)Constants.RegionSize))
|
||||
&& (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd
|
||||
>= (regionConnections.Y * (int)Constants.RegionSize)))
|
||||
private bool DoWorkForOneRegionOverPlusXPlusY(RegionConnections conn, RegionConnections regionConnections, Scene scene)
|
||||
{
|
||||
Vector3 offset = Vector3.Zero;
|
||||
offset.X = (((regionConnections.X * (int)Constants.RegionSize)) -
|
||||
|
@ -535,16 +566,13 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
if (conn.ClientEventForwarder != null)
|
||||
conn.ClientEventForwarder.AddSceneToEventForwarding(scene);
|
||||
|
||||
connectedYN = true;
|
||||
return true;
|
||||
|
||||
//scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset,extents);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If !connectYN means that this region is a root region
|
||||
if (!connectedYN)
|
||||
private void DoWorkForRootRegion(RegionConnections regionConnections, Scene scene)
|
||||
{
|
||||
RegionData rdata = new RegionData();
|
||||
rdata.Offset = Vector3.Zero;
|
||||
|
@ -574,10 +602,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
// Adds this root region to a dictionary of regions that are connectable
|
||||
m_regions.Add(scene.RegionInfo.originRegionID, regionConnections);
|
||||
}
|
||||
}
|
||||
// Set up infinite borders around the entire AABB of the combined ConnectedRegions
|
||||
AdjustLargeRegionBounds();
|
||||
}
|
||||
|
||||
private void SetCourseLocationDelegate(ScenePresence presence)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue