コード例 #1
0
        public bool CanTeleport(UUID userID)
        {
            TeleportHandler handler = OnTeleport;

            if (handler != null)
            {
                Delegate[] list = handler.GetInvocationList();
                foreach (TeleportHandler h in list)
                {
                    if (h(userID, m_scene) == false)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Check to see whether the user is actually in this region
        /// and then figure out if they can be where they want to be
        /// </summary>
        /// <param name="userID">The user who is teleporting (can be either incoming from a remote region, or a local teleport)</param>
        /// <param name="Position">The position the user has requested</param>
        /// <param name="newPosition">The position the user is going to get</param>
        /// <param name="reason">If the check fails, this will tell why</param>
        /// <returns>Whether this user can teleport into/around this region</returns>
        public bool AllowedIncomingTeleport(UUID userID, Vector3 Position, out Vector3 newPosition, out string reason)
        {
            newPosition = Position;
            reason      = "";
            TeleportHandler handler = OnAllowedIncomingTeleport;

            if (handler != null)
            {
                Delegate[] list = handler.GetInvocationList();
                foreach (TeleportHandler h in list)
                {
                    if (h(userID, m_scene, Position, out newPosition, out reason) == false)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }