예제 #1
0
파일: Chat.cs 프로젝트: Herhangi/HerhangiOT
        public static bool TalkToChannel(Player player, SpeakTypes type, string text, ushort channelId)
        {
            ChatChannel channel = GetChannel(player, channelId);

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

            if (channelId == Constants.ChatChannelGuild)
            {
                //if (player.getGuildLevel() > 1) { //TODO: GUILD
                //    type = TALKTYPE_CHANNEL_O;
                //} else if (type != TALKTYPE_CHANNEL_Y) {
                //    type = TALKTYPE_CHANNEL_Y;
                //}
            }
            else if (type != SpeakTypes.ChannelY && (channelId == Constants.ChatChannelPrivate || channelId == Constants.ChatChannelParty))
            {
                type = SpeakTypes.ChannelY;
            }

            if (!channel.OnSpeak(player, ref type, text))
            {
                return(false);
            }

            return(channel.Talk(player, type, text));
        }