diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 47 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 32 |
4 files changed, 59 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 221eb47..8af7514 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -145,6 +145,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
145 | 145 | ||
146 | protected SceneCommunicationService m_sceneGridService; | 146 | protected SceneCommunicationService m_sceneGridService; |
147 | public bool LoginsDisabled = true; | 147 | public bool LoginsDisabled = true; |
148 | public bool LoadingPrims = false; | ||
149 | public bool CombineRegions = false; | ||
148 | 150 | ||
149 | public new float TimeDilation | 151 | public new float TimeDilation |
150 | { | 152 | { |
@@ -655,6 +657,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
655 | } | 657 | } |
656 | 658 | ||
657 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); | 659 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); |
660 | CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); | ||
658 | 661 | ||
659 | IConfig interest_management_config = m_config.Configs["InterestManagement"]; | 662 | IConfig interest_management_config = m_config.Configs["InterestManagement"]; |
660 | if (interest_management_config != null) | 663 | if (interest_management_config != null) |
@@ -1691,6 +1694,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1691 | /// </summary> | 1694 | /// </summary> |
1692 | public virtual void LoadPrimsFromStorage(UUID regionID) | 1695 | public virtual void LoadPrimsFromStorage(UUID regionID) |
1693 | { | 1696 | { |
1697 | LoadingPrims = true; | ||
1694 | m_log.Info("[SCENE]: Loading objects from datastore"); | 1698 | m_log.Info("[SCENE]: Loading objects from datastore"); |
1695 | 1699 | ||
1696 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); | 1700 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); |
@@ -1714,6 +1718,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1714 | } | 1718 | } |
1715 | 1719 | ||
1716 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); | 1720 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); |
1721 | LoadingPrims = false; | ||
1717 | } | 1722 | } |
1718 | 1723 | ||
1719 | 1724 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 5a1922a..1d126b6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -226,30 +226,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
226 | protected internal bool AddRestoredSceneObject( | 226 | protected internal bool AddRestoredSceneObject( |
227 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) | 227 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) |
228 | { | 228 | { |
229 | // KF: Check for out-of-region, move inside and make static. | 229 | if (!m_parentScene.CombineRegions) |
230 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, | 230 | { |
231 | sceneObject.RootPart.GroupPosition.Y, | 231 | // KF: Check for out-of-region, move inside and make static. |
232 | sceneObject.RootPart.GroupPosition.Z); | 232 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, |
233 | 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 || | 233 | sceneObject.RootPart.GroupPosition.Y, |
234 | npos.X > Constants.RegionSize || | 234 | sceneObject.RootPart.GroupPosition.Z); |
235 | npos.Y > Constants.RegionSize)) | 235 | 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 || |
236 | { | 236 | npos.X > Constants.RegionSize || |
237 | if (npos.X < 0.0) npos.X = 1.0f; | 237 | npos.Y > Constants.RegionSize)) |
238 | if (npos.Y < 0.0) npos.Y = 1.0f; | ||
239 | if (npos.Z < 0.0) npos.Z = 0.0f; | ||
240 | if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f; | ||
241 | if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f; | ||
242 | |||
243 | foreach (SceneObjectPart part in sceneObject.Children.Values) | ||
244 | { | 238 | { |
245 | part.GroupPosition = npos; | 239 | if (npos.X < 0.0) npos.X = 1.0f; |
240 | if (npos.Y < 0.0) npos.Y = 1.0f; | ||
241 | if (npos.Z < 0.0) npos.Z = 0.0f; | ||
242 | if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f; | ||
243 | if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f; | ||
244 | |||
245 | foreach (SceneObjectPart part in sceneObject.Children.Values) | ||
246 | { | ||
247 | part.GroupPosition = npos; | ||
248 | } | ||
249 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
250 | sceneObject.RootPart.AngularVelocity = Vector3.Zero; | ||
251 | sceneObject.RootPart.Acceleration = Vector3.Zero; | ||
252 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
246 | } | 253 | } |
247 | sceneObject.RootPart.Velocity = Vector3.Zero; | 254 | } |
248 | sceneObject.RootPart.AngularVelocity = Vector3.Zero; | 255 | |
249 | sceneObject.RootPart.Acceleration = Vector3.Zero; | ||
250 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
251 | } | ||
252 | |||
253 | if (!alreadyPersisted) | 256 | if (!alreadyPersisted) |
254 | { | 257 | { |
255 | sceneObject.ForceInventoryPersistence(); | 258 | sceneObject.ForceInventoryPersistence(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 93f45e0..54b27b2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -404,7 +404,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
404 | 404 | ||
405 | if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) | 405 | if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) |
406 | || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) | 406 | || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) |
407 | && !IsAttachmentCheckFull()) | 407 | && !IsAttachmentCheckFull() && (!m_scene.LoadingPrims)) |
408 | { | 408 | { |
409 | m_scene.CrossPrimGroupIntoNewRegion(val, this, true); | 409 | m_scene.CrossPrimGroupIntoNewRegion(val, this, true); |
410 | } | 410 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 3bdbdfb..c8f6559 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1359,9 +1359,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1359 | string xml = instance.GetXMLState(); | 1359 | string xml = instance.GetXMLState(); |
1360 | 1360 | ||
1361 | XmlDocument sdoc = new XmlDocument(); | 1361 | XmlDocument sdoc = new XmlDocument(); |
1362 | sdoc.LoadXml(xml); | 1362 | bool loadedState = true; |
1363 | XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState"); | 1363 | try |
1364 | XmlNode rootNode = rootL[0]; | 1364 | { |
1365 | sdoc.LoadXml(xml); | ||
1366 | } | ||
1367 | catch (System.Xml.XmlException e) | ||
1368 | { | ||
1369 | loadedState = false; | ||
1370 | } | ||
1371 | |||
1372 | XmlNodeList rootL = null; | ||
1373 | XmlNode rootNode = null; | ||
1374 | if (loadedState) | ||
1375 | { | ||
1376 | rootL = sdoc.GetElementsByTagName("ScriptState"); | ||
1377 | rootNode = rootL[0]; | ||
1378 | } | ||
1365 | 1379 | ||
1366 | // Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"> | 1380 | // Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"> |
1367 | XmlDocument doc = new XmlDocument(); | 1381 | XmlDocument doc = new XmlDocument(); |
@@ -1377,8 +1391,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1377 | stateData.Attributes.Append(engineName); | 1391 | stateData.Attributes.Append(engineName); |
1378 | doc.AppendChild(stateData); | 1392 | doc.AppendChild(stateData); |
1379 | 1393 | ||
1394 | XmlNode xmlstate = null; | ||
1395 | |||
1380 | // Add <ScriptState>...</ScriptState> | 1396 | // Add <ScriptState>...</ScriptState> |
1381 | XmlNode xmlstate = doc.ImportNode(rootNode, true); | 1397 | if (loadedState) |
1398 | { | ||
1399 | xmlstate = doc.ImportNode(rootNode, true); | ||
1400 | } | ||
1401 | else | ||
1402 | { | ||
1403 | xmlstate = doc.CreateElement("", "ScriptState", ""); | ||
1404 | } | ||
1405 | |||
1382 | stateData.AppendChild(xmlstate); | 1406 | stateData.AppendChild(xmlstate); |
1383 | 1407 | ||
1384 | string assemName = instance.GetAssemblyName(); | 1408 | string assemName = instance.GetAssemblyName(); |