diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ee61de6505..e94eceeb6c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -112,7 +112,7 @@ namespace OpenSim.Region.Framework.Scenes private long timeLastChanged = 0; private long m_maxPersistTime = 0; private long m_minPersistTime = 0; - private Random m_rand; +// private Random m_rand; private List m_linkedAvatars = new List(); /// @@ -130,6 +130,7 @@ namespace OpenSim.Region.Framework.Scenes { if (value) { + if (m_isBackedUp) { m_scene.SceneGraph.FireChangeBackup(this); @@ -139,19 +140,21 @@ namespace OpenSim.Region.Framework.Scenes timeFirstChanged = DateTime.Now.Ticks; if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null) { +/* if (m_rand == null) { byte[] val = new byte[16]; m_rootPart.UUID.ToBytes(val, 0); m_rand = new Random(BitConverter.ToInt32(val, 0)); } - + */ if (m_scene.GetRootAgentCount() == 0) { //If the region is empty, this change has been made by an automated process //and thus we delay the persist time by a random amount between 1.5 and 2.5. - float factor = 1.5f + (float)(m_rand.NextDouble()); +// float factor = 1.5f + (float)(m_rand.NextDouble()); + float factor = 2.0f; m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor); m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor); } @@ -159,8 +162,10 @@ namespace OpenSim.Region.Framework.Scenes { //If the region is not empty, we want to obey the minimum and maximum persist times //but add a random factor so we stagger the object persistance a little - m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5 - m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0 +// m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5 +// m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0 + m_maxPersistTime = m_scene.m_persistAfter; + m_minPersistTime = m_scene.m_dontPersistBefore; } } } diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 59ff9b8a19..39cabb52b6 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs @@ -121,34 +121,40 @@ namespace OpenSim.Region.OptionalModules private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) { - if ((newPoint.X > 257f || newPoint.X < -1f || newPoint.Y > 257f || newPoint.Y < -1f)) + if (newPoint.X < -1f || newPoint.X > (float)(Constants.RegionSize + 1) || + newPoint.Y < -1f || newPoint.Y > (float)(Constants.RegionSize + 1)) return true; SceneObjectPart obj = scene.GetSceneObjectPart(objectID); - Vector3 oldPoint = obj.GroupPosition; - int objectCount = obj.ParentGroup.PrimCount; - ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); + + if (obj == null) + return false; + + // Prim counts are determined by the location of the root prim. if we're + // moving a child prim, just let it pass + if (!obj.IsRoot) + { + return true; + } + ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); if (newParcel == null) return true; - int usedPrims = newParcel.PrimCounts.Total; - int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); + Vector3 oldPoint = obj.GroupPosition; + ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); // The prim hasn't crossed a region boundry so we don't need to worry // about prim counts here - if(oldParcel.Equals(newParcel)) + if(oldParcel != null && oldParcel.Equals(newParcel)) { return true; } - // Prim counts are determined by the location of the root prim. if we're - // moving a child prim, just let it pass - if(!obj.IsRoot) - { - return true; - } + int objectCount = obj.ParentGroup.PrimCount; + int usedPrims = newParcel.PrimCounts.Total; + int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); // TODO: Add Special Case here for temporary prims diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 76e42d4417..dc247a9fa2 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs @@ -1403,8 +1403,8 @@ namespace OpenSim.Region.Physics.OdePlugin if (vertexCount == 0 || indexCount == 0) { - m_log.WarnFormat("[PHYSICS]: Invalid mesh data on OdePrim {0}, mesh {1}", - Name, _pbs.SculptEntry ? _pbs.SculptTexture.ToString() : "primMesh"); + m_log.WarnFormat("[PHYSICS]: Invalid mesh data on OdePrim {0}, mesh {1} at {2}", + Name, _pbs.SculptEntry ? _pbs.SculptTexture.ToString() : "primMesh",_position.ToString()); m_hasOBB = false; m_OBBOffset = Vector3.Zero;