Exemplo n.º 1
0
        public void SendNoEntryNotice(ScenePresence avatar, ParcelPropertiesStatus reason)
        {
            if (!AllowedForcefulBans)
            {
                avatar.ControllingClient.SendAlertMessage(
                    "You are not allowed on this parcel, however the grid administrator has disabled ban lines globally. Please respect the land owner's privacy, or you could be banned from the full region.");
                return;
            }

            if (reason == ParcelPropertiesStatus.CollisionBanned)
                avatar.ControllingClient.SendAlertMessage(
                    "You are not permitted to enter this parcel because you are banned.");
            else
                avatar.ControllingClient.SendAlertMessage(
                    "You are not permitted to enter this parcel due to parcel restrictions.");
        }
Exemplo n.º 2
0
        // Returns false and reason == ParcelPropertiesStatus.ParcelSelected if access is allowed, otherwise reason enum.
        public bool DenyParcelAccess(SceneObjectGroup group, bool checkSitters, out ParcelPropertiesStatus reason)
        {
            if (checkSitters)
            {
                // some voodo with reason variables to avoid compiler problems.
                ParcelPropertiesStatus reason2;
                ParcelPropertiesStatus sitterReason = 0;
                bool result = true;
                group.ForEachSittingAvatar((ScenePresence sp) =>
                {
                    if (sp.UUID != group.OwnerID)   // checked separately below
                    {
                        if (DenyParcelAccess(sp.UUID, out reason2))
                        {
                            sitterReason = reason2;
                            result = false;
                        }
                    }
                });
                if (!result)
                {
                    reason = sitterReason;
                    return false;
                }
            }

            return DenyParcelAccess(group.OwnerID, out reason);
        }
Exemplo n.º 3
0
        // Returns false and reason == ParcelPropertiesStatus.ParcelSelected if access is allowed, otherwise reason enum.
        public bool DenyParcelAccess(SceneObjectGroup group, bool checkSitters, out ParcelPropertiesStatus reason)
        {
            if (checkSitters)
            {
                List<ScenePresence> sitters = group.GetSittingAvatars();
                foreach (ScenePresence sp in sitters)
                {
                    if (sp.UUID == group.OwnerID)
                        continue;   // checked separately below
                    if (DenyParcelAccess(sp.UUID, out reason))
                        return false;
                }
            }

            return DenyParcelAccess(group.OwnerID, out reason);
        }
Exemplo n.º 4
0
        // Returns false and reason == ParcelPropertiesStatus.ParcelSelected if access is allowed, otherwise reason enum.
        public bool DenyParcelAccess(UUID avatar, out ParcelPropertiesStatus reason)
        {
            ScenePresence sp = m_scene.GetScenePresence(avatar);

            if (isBannedFromLand(avatar) || (sp != null && sp.IsBot && isBannedFromLand(sp.OwnerID)))
            {
                reason = ParcelPropertiesStatus.CollisionBanned;
                return true;
            }

            if (isRestrictedFromLand(avatar) || (sp != null && sp.IsBot && isRestrictedFromLand(sp.OwnerID)))
            {
                reason = ParcelPropertiesStatus.CollisionNotOnAccessList;
                return true;
            }

            reason = ParcelPropertiesStatus.ParcelSelected;   // we can treat this as the no error case.
            return false;
        }
Exemplo n.º 5
0
        public bool SendNoEntryNotice(ScenePresence avatar, ParcelPropertiesStatus reason)
        {
            if (!AllowedForcefulBans)
            {
                avatar.ControllingClient.SendAlertMessage(
                    "You are not allowed on this parcel, however the grid administrator has disabled ban lines globally. Please respect the land owner's privacy, or you could be banned from the full region.");
                return false;
            }

            if (reason == ParcelPropertiesStatus.CollisionBanned)
                avatar.ControllingClient.SendAlertMessage(
                    "You are not permitted to enter this parcel because you are banned.");
            else
                avatar.ControllingClient.SendAlertMessage(
                    "You are not permitted to enter this parcel due to parcel restrictions.");

            // If they are moving, stop them.  This updates the physics object as well.
            avatar.Velocity = Vector3.Zero;
            Vector3 pos;
            ParcelPropertiesStatus reason2;
            if (!avatar.lastKnownAllowedPosition.Equals(Vector3.Zero))
            {
                pos = new Vector3(avatar.lastKnownAllowedPosition.X, avatar.lastKnownAllowedPosition.Y, avatar.lastKnownAllowedPosition.Z);
            }
            else
            {
                // Still a forbidden parcel, they must have been above the limit or entering region for the first time.
                pos = new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z);
                // Let's put them up higher, over the restricted parcel.
                // We could add 50m to avatar.Scene.Heightmap[x,y] but then we need subscript checks, etc.
                // For now, this is simple and safer than TPing them home.
                pos.Z += 50.0f;
            }

            ILandObject parcel = landChannel.GetLandObject(pos.X, pos.Y);
            if (parcel.DenyParcelAccess(avatar.UUID, out reason2))
            {
                // Havent found anywhere safe to put the avatar, TP them home.
//              avatar.ControllingClient.SendTeleportLocationStart();
//              avatar.Scene.TeleportClientHome(avatar.UUID, avatar.ControllingClient);
//              return true;

                if (pos.Z < 150.0f)
                    pos.Z = 150.0f;
            }

            avatar.Teleport(pos);
            return true;
        }