Exemplo n.º 1
0
    /// <summary>
    /// 客户端自己构造(活动开始前五分钟提示)
    /// </summary>
    public ChatInfo(int _id, string _name, int _type)
    {
        ChatTemplatesRef Ref = ConfigMng.Instance.GetChatTemplatesRef(_id);

        if (Ref != null)
        {
            isSystemInfo = true;
            chatTypeID   = 5;
            if (Ref.channel.Count > 0)
            {
                switch (Ref.channel[0])
                {
                case 1: chatTypeID = 5; break;

                case 3: chatTypeID = 3; break;

                default: chatTypeID = 5; break;
                }
            }
            else
            {
                Debug.LogError("ChatTemplatesRef 表中的channel字段数据异常  by黄洪兴");
            }
            string        st   = Ref.text;
            List <string> list = new List <string>();
            for (int i = 0; i < Ref.parameter.Count; i++)
            {
                switch (Ref.parameter[i])
                {
                case 27:
                    list.Add(_name);
                    break;

                default:
                    break;
                }
            }
            chatContent = UIUtil.Str2Str(st, list);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 收到系统信息
    /// </summary>
    public ChatInfo(pt_system_msg_d689 _pt)
    {
        ChatTemplatesRef Ref = ConfigMng.Instance.GetChatTemplatesRef(_pt.type);

        if (Ref != null)
        {
            isSystemInfo = true;
            chatTypeID   = 5;
            if (Ref.channel.Count > 0)
            {
                switch (Ref.channel[0])
                {
                case 1: chatTypeID = 5; break;

                case 3: chatTypeID = 3; break;

                default: chatTypeID = 5; break;
                }
            }
            else
            {
                Debug.LogError("ChatTemplatesRef 表中的channel字段数据异常  by黄洪兴");
            }
            string        st   = Ref.text;
            int           a    = 0;
            List <string> list = new List <string>();
            for (int i = 0; i < Ref.parameter.Count; i++)
            {
                switch (Ref.parameter[i])
                {
                case 1: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data); funcationList.Add(1);
                    }
                    break;

                case 2: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            EquipmentInfo item = new EquipmentInfo(Convert.ToInt32(_pt.nomal_list[i].data), EquipmentBelongTo.PREVIEW);
                            equipmentRefList.Add(item);
                            list.Add(item.ItemStrColor + item.ItemName + "[-]");
                            funcationList.Add(2);
                        }
                    }
                    break;

                case 3: if (_pt.item.Count > a)
                    {
                        EquipmentInfo item = new EquipmentInfo(_pt.item[a], true); equipmentList.Add(item); list.Add(item.ItemStrColor + item.ItemName + "[-]"); a++; funcationList.Add(3);
                    }
                    break;

                case 4: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            SceneRef SceneRef = ConfigMng.Instance.GetSceneRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (SceneRef != null)
                            {
                                list.Add(SceneRef.name);
                            }
                            funcationList.Add(4);
                        }
                    }
                    break;

                case 5: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            MonsterRef monsterRef = ConfigMng.Instance.GetMonsterRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (monsterRef != null)
                            {
                                list.Add(monsterRef.name);
                            }
                        }
                    }
                    break;

                case 6: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 7: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 8: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 9: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 10: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            MonsterRef monsterRef = ConfigMng.Instance.GetMonsterRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (monsterRef != null)
                            {
                                list.Add(monsterRef.name);
                            }
                        }
                    }
                    break;

                case 13: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 14: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            MountRef mountRef = ConfigMng.Instance.GetMountRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (mountRef != null)
                            {
                                list.Add(mountRef.mountName);
                            }
                        }
                    }
                    break;

                case 15: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            RidePropertyRef rideRef = ConfigMng.Instance.GetMountPropertyRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (rideRef != null)
                            {
                                list.Add(rideRef.name);
                            }
                        }
                    }
                    break;

                case 16: if (_pt.nomal_list.Count > i)
                    {
                        string s = string.Empty;
                        int    num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            switch (Convert.ToInt32(_pt.nomal_list[i].data))
                            {
                            case 1: s = ConfigMng.Instance.GetUItext(70); break;

                            case 2: s = ConfigMng.Instance.GetUItext(71); break;

                            case 3: s = ConfigMng.Instance.GetUItext(72); break;

                            case 4: s = ConfigMng.Instance.GetUItext(73); break;

                            case 5: s = ConfigMng.Instance.GetUItext(74); break;

                            default:
                                break;
                            }
                            if (s != string.Empty)
                            {
                                list.Add(s);
                            }
                        }
                    }
                    break;

                case 18: if (_pt.nomal_list.Count > i)
                    {
                        if (_pt.nomal_list[i].data != string.Empty)
                        {
                            list.Add(_pt.nomal_list[i].data);
                        }
                        else
                        {
                            list.Add(string.Empty);
                        }
                    }
                    break;

                case 19: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 20: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            list.Add(ConfigMng.Instance.GetLevelDes(Convert.ToInt32(_pt.nomal_list[i].data)));
                        }
                    }
                    break;

                case 23: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            playerID.Add(Convert.ToInt32(_pt.nomal_list[i].data));
                        }
                    }
                    break;

                case 24: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 25: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            CheckPointRef CKRef = ConfigMng.Instance.GetCheckPointRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (CKRef != null)
                            {
                                list.Add(CKRef.name);
                            }
                        }
                    }
                    break;

                case 26: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 27: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                default:
                    break;
                }
            }

            chatContent = UIUtil.Str2Str(st, list);

            if (Ref.channel.Count > 1)
            {
                MerryGoRoundDataInfo Info = new MerryGoRoundDataInfo(chatContent);
                if (GameCenter.chatMng.OnAddMerryGoRoundData != null)
                {
                    GameCenter.chatMng.OnAddMerryGoRoundData(Info);
                }
            }
        }
    }