private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
        {
            SceneObjectPart obj         = scene.GetSceneObjectPart(objectID);
            Vector3         oldPoint    = obj.GroupPosition;
            int             objectCount = obj.ParentGroup.PrimCount;
            ILandObject     oldParcel   = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
            ILandObject     newParcel   = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);

            int usedPrims         = newParcel.PrimCounts.Total;
            int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();

            // The prim hasn't crossed a region boundry so we don't need to worry
            // about prim counts here
            if (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);
            }

            // TODO: Add Special Case here for temporary prims

            if (objectCount + usedPrims > simulatorCapacity)
            {
                m_dialogModule.SendAlertToUser(obj.OwnerID, "Unable to move object because the destination parcel  is too full");
                return(false);
            }

            return(true);
        }
示例#2
0
        private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
        {
            if (newPoint.X < -1f || newPoint.X > (scene.RegionInfo.RegionSizeX + 1) ||
                newPoint.Y < -1f || newPoint.Y > (scene.RegionInfo.RegionSizeY))
            {
                return(true);
            }

            SceneObjectPart obj = scene.GetSceneObjectPart(objectID);

            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);
            }

            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 != null && oldParcel.Equals(newParcel))
            {
                return(true);
            }

            int objectCount       = obj.ParentGroup.PrimCount;
            int usedPrims         = newParcel.PrimCounts.Total;
            int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();

            // TODO: Add Special Case here for temporary prims

            string response = DoCommonChecks(objectCount, obj.OwnerID, newParcel, scene);

            if (response != null)
            {
                m_dialogModule.SendAlertToUser(obj.OwnerID, response);
                return(false);
            }
            return(true);
        }
示例#3
0
        private bool CanObjectEnter(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint)
        {
            float newX = newPoint.X;
            float newY = newPoint.Y;

            if (newX < -1.0f || newX > (m_scene.RegionInfo.RegionSizeX + 1.0f) ||
                newY < -1.0f || newY > (m_scene.RegionInfo.RegionSizeY + 1.0f))
            {
                return(true);
            }

            if (sog == null)
            {
                return(false);
            }

            ILandObject newParcel = m_scene.LandChannel.GetLandObject(newX, newY);

            if (newParcel == null)
            {
                return(true);
            }

            if (!enteringRegion)
            {
                Vector3     oldPoint  = sog.AbsolutePosition;
                ILandObject oldParcel = m_scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
                if (oldParcel != null && oldParcel.Equals(newParcel))
                {
                    return(true);
                }
            }

            int objectCount = sog.PrimCount;

            // TODO: Add Special Case here for temporary prims

            string response = DoCommonChecks(objectCount, sog.OwnerID, newParcel);

            if (response != null)
            {
                if (m_dialogModule != null)
                {
                    m_dialogModule.SendAlertToUser(sog.OwnerID, response);
                }
                return(false);
            }
            return(true);
        }
        private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
        {
            SceneObjectPart obj         = scene.GetSceneObjectPart(objectID);
            Vector3         oldPoint    = obj.GroupPosition;
            int             objectCount = obj.ParentGroup.PrimCount;
            ILandObject     oldParcel   = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
            ILandObject     newParcel   = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);

            // newParcel will be null only if it outside of our current region.  If this is the case, then the
            // receiving permissions will perform the check.
            if (newParcel == null)
            {
                return(true);
            }

            // The prim hasn't crossed a region boundary so we don't need to worry
            // about prim counts here
            if (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);
            }

            // TODO: Add Special Case here for temporary prims

            string response = DoCommonChecks(objectCount, obj.OwnerID, newParcel, scene);

            if (response != null)
            {
                m_dialogModule.SendAlertToUser(obj.OwnerID, response);
                return(false);
            }
            return(true);
        }