Allow megaregions to be used in M7, should we so decide

avinationmerge
Melanie Thielker 2010-07-21 12:31:59 +02:00
parent d4022becc3
commit fb89d0ff4e
2 changed files with 27 additions and 22 deletions

View File

@ -137,6 +137,7 @@ namespace OpenSim.Region.Framework.Scenes
protected SceneCommunicationService m_sceneGridService; protected SceneCommunicationService m_sceneGridService;
public bool LoginsDisabled = true; public bool LoginsDisabled = true;
public bool LoadingPrims = false; public bool LoadingPrims = false;
public bool CombineRegions = false;
public new float TimeDilation public new float TimeDilation
{ {
@ -768,6 +769,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
#region BinaryStats #region BinaryStats

View File

@ -283,29 +283,32 @@ namespace OpenSim.Region.Framework.Scenes
protected internal bool AddRestoredSceneObject( protected internal bool AddRestoredSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
{ {
// KF: Check for out-of-region, move inside and make static. if (!m_parentScene.CombineRegions)
Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, {
sceneObject.RootPart.GroupPosition.Y, // KF: Check for out-of-region, move inside and make static.
sceneObject.RootPart.GroupPosition.Z); Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X,
if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 || sceneObject.RootPart.GroupPosition.Y,
npos.X > Constants.RegionSize || sceneObject.RootPart.GroupPosition.Z);
npos.Y > Constants.RegionSize)) if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 ||
{ npos.X > Constants.RegionSize ||
if (npos.X < 0.0) npos.X = 1.0f; npos.Y > Constants.RegionSize))
if (npos.Y < 0.0) npos.Y = 1.0f;
if (npos.Z < 0.0) npos.Z = 0.0f;
if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f;
if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f;
foreach (SceneObjectPart part in sceneObject.Children.Values)
{ {
part.GroupPosition = npos; if (npos.X < 0.0) npos.X = 1.0f;
if (npos.Y < 0.0) npos.Y = 1.0f;
if (npos.Z < 0.0) npos.Z = 0.0f;
if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f;
if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f;
foreach (SceneObjectPart part in sceneObject.Children.Values)
{
part.GroupPosition = npos;
}
sceneObject.RootPart.Velocity = Vector3.Zero;
sceneObject.RootPart.AngularVelocity = Vector3.Zero;
sceneObject.RootPart.Acceleration = Vector3.Zero;
sceneObject.RootPart.Velocity = Vector3.Zero;
} }
sceneObject.RootPart.Velocity = Vector3.Zero; }
sceneObject.RootPart.AngularVelocity = Vector3.Zero;
sceneObject.RootPart.Acceleration = Vector3.Zero;
sceneObject.RootPart.Velocity = Vector3.Zero;
}
if (!alreadyPersisted) if (!alreadyPersisted)
{ {