Esempio n. 1
0
        /// <summary>
        /// Remove a player from the given channel
        /// </summary>
        /// <param name="player"></param>
        /// <param name="id"></param>
        public static void RemovePlayerFromChannel(Player player, ChannelID id)
        {
            Channel channel = Channels.getChannelById(id);

            if (channel != null)
            {
                channel.RemovePlayer(player);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Player talks to the given channel
        /// </summary>
        /// <param name="player"></param>
        /// <param name="id"></param>
        /// <param name="message"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static bool PlayerTalkToChannel(Player player, ChannelID id, string message, TalkType type)
        {
            Channel channel = Channels.getChannelById(id);

            if (channel != null)
            {
                if (type != TalkType.RuleViolationAnswer)
                {
                    type = TalkType.ChannelYellow;
                }

                channel.PlayerTalk(player, type, message);
                return(true);
            }

            return(false);
        }