예제 #1
0
    public static bool IsChannelReceiveChat(ChatInfoLogic.CHANNEL_TYPE playerChannel, GC_CHAT.CHATTYPE chatChannel)
    {
        int playerSetup = 0;

        //         if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_WORLD)
        //         {
        //             playerSetup = PlayerPreferenceData.ChannelConfig_World;
        //         }
        //         else if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_TELL)
        //         {
        //             playerSetup = PlayerPreferenceData.ChannelConfig_Tell;
        //         }
        //         else if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_NORMAL)
        //         {
        //             playerSetup = PlayerPreferenceData.ChannelConfig_Normal;
        //         }
        //         else if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_TEAM)
        //         {
        //             playerSetup = PlayerPreferenceData.ChannelConfig_Team;
        //         }
        //         else if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_GUILD)
        //         {
        //             playerSetup = PlayerPreferenceData.ChannelConfig_Guild;
        //         }
        //         else if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_MASTER)
        //         {
        //             playerSetup = PlayerPreferenceData.ChannelConfig_Master;
        //         }
        //         else if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_FRIEND)
        //         {
        //             playerSetup = PlayerPreferenceData.ChannelConfig_Friend;
        //         }
        //         else if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_SYSTEM)
        //         {
        //             playerSetup = PlayerPreferenceData.ChannelConfig_System;
        //         }

        //
        if (playerChannel == ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_VARIOUS)
        {
            playerSetup = PlayerPreferenceData.ChannelConfig_Various;
        }
        else // 不是综合频道
        {
            //直接判断发送的数据频道与当前频道是不是一个频道

            //回来的是小喇叭,就返回了,所有频道都显示
            if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_LOUDSPEAKER)
            {
                return(true);
            }

            //是当前频道
            if (playerChannel == ChatInfoLogic.ConvertCGChannelToChatInfo(chatChannel))
            {
                return(true);
            }

            return(false);
        }

        int chatSetupIndex = (int)SETUPTOGGLE_INDEX.INVALID;

        if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_LOUDSPEAKER)
        {
            // 小喇叭直接返回true
            //return true;
            // 小喇叭频道改为可选择接收
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.LOUDSPEAKER;
        }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_WORLD)
        {
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.WORLD;
        }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_TELL)
        {
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.TELL;
        }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_NORMAL)
        {
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.NORMAL;
        }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_TEAM)
        {
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.TEAM;
        }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_GUILD)
        {
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.GUILD;
        }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_MASTER)
        {
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.MASTER;
        }
//         else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_FRIEND)
//         {
//             chatSetupIndex = (int)SETUPTOGGLE_INDEX.FRIEND;
//         }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_SYSTEM)
        {
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.SYSTEM;
        }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_VARIOUS)
        {
            return(true);
        }
        else if (chatChannel == GC_CHAT.CHATTYPE.CHAT_TYPE_PROPAGATE)
        {
            chatSetupIndex = (int)SETUPTOGGLE_INDEX.PROPAGATE;
        }

        if (chatSetupIndex != (int)SETUPTOGGLE_INDEX.INVALID)
        {
            int nIsReceive = playerSetup % (int)Mathf.Pow(10, chatSetupIndex + 1) / (int)Mathf.Pow(10, chatSetupIndex);
            return(nIsReceive == 1 ? true : false);
        }
        return(false);
    }