Merge branch 'master' of ssh://3dhosting.de/var/git/careminster

avinationmerge
Tom Grimshaw 2010-07-22 10:49:14 -07:00
commit bf374705c6
4 changed files with 59 additions and 27 deletions

View File

@ -145,6 +145,8 @@ 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 CombineRegions = false;
public new float TimeDilation public new float TimeDilation
{ {
@ -655,6 +657,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);
IConfig interest_management_config = m_config.Configs["InterestManagement"]; IConfig interest_management_config = m_config.Configs["InterestManagement"];
if (interest_management_config != null) if (interest_management_config != null)
@ -1691,6 +1694,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public virtual void LoadPrimsFromStorage(UUID regionID) public virtual void LoadPrimsFromStorage(UUID regionID)
{ {
LoadingPrims = true;
m_log.Info("[SCENE]: Loading objects from datastore"); m_log.Info("[SCENE]: Loading objects from datastore");
List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID);
@ -1714,6 +1718,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
LoadingPrims = false;
} }

View File

@ -226,29 +226,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)
{ {

View File

@ -404,7 +404,7 @@ namespace OpenSim.Region.Framework.Scenes
if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
|| m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull()) && !IsAttachmentCheckFull() && (!m_scene.LoadingPrims))
{ {
m_scene.CrossPrimGroupIntoNewRegion(val, this, true); m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
} }

View File

@ -1359,9 +1359,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string xml = instance.GetXMLState(); string xml = instance.GetXMLState();
XmlDocument sdoc = new XmlDocument(); XmlDocument sdoc = new XmlDocument();
sdoc.LoadXml(xml); bool loadedState = true;
XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState"); try
XmlNode rootNode = rootL[0]; {
sdoc.LoadXml(xml);
}
catch (System.Xml.XmlException e)
{
loadedState = false;
}
XmlNodeList rootL = null;
XmlNode rootNode = null;
if (loadedState)
{
rootL = sdoc.GetElementsByTagName("ScriptState");
rootNode = rootL[0];
}
// Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"> // Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
@ -1377,8 +1391,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
stateData.Attributes.Append(engineName); stateData.Attributes.Append(engineName);
doc.AppendChild(stateData); doc.AppendChild(stateData);
XmlNode xmlstate = null;
// Add <ScriptState>...</ScriptState> // Add <ScriptState>...</ScriptState>
XmlNode xmlstate = doc.ImportNode(rootNode, true); if (loadedState)
{
xmlstate = doc.ImportNode(rootNode, true);
}
else
{
xmlstate = doc.CreateElement("", "ScriptState", "");
}
stateData.AppendChild(xmlstate); stateData.AppendChild(xmlstate);
string assemName = instance.GetAssemblyName(); string assemName = instance.GetAssemblyName();