Esempio n. 1
0
 void AddMerryGoRound(MerryGoRoundDataInfo _data)
 {
     merryList.Add(_data);
     if (!isStart)
     {
         isStart = true;
     }
     if (tatget != null)
     {
         tatget.SetActive(true);
     }
 }
Esempio n. 2
0
    /// <summary>
    /// 接收聊天内容
    /// </summary>
    protected void S2C_NewRecieveChatContent(Pt _pt)
    {
        pt_chat_content_d325 chat = _pt as pt_chat_content_d325;

        if (chat != null)
        {
            //Debug.Log("收到聊天数据" + chat.type + ":" + chat.send_uid + ":" + chat.name + ":" + chat.receive_name + ":" + chat.vip_lev);
            if ((int)chat.type == 6)
            {
                MerryGoRoundDataInfo Info = new MerryGoRoundDataInfo("[u][FF7FEE]" + chat.name + "[/u][-]" + " : " + chat.content);
                if (OnAddMerryGoRoundData != null)
                {
                    OnAddMerryGoRoundData(Info);
                }
            }
            else
            {
                ChatInfo info = new ChatInfo(chat);
                {
                    UpdateChatContent(info);
                }
                if (info.chatTypeID == (int)ChatInfo.Type.Private)
                {
                    UpdateChatPlayer(info);
                }
                UpdateUnReadNum(info);
                AddOneVoiceToMianChat(info);
                AddOneVoiceToMnd(info);
                if ((int)CurChatType == info.chatTypeID || CurChatType == (int)ChatInfo.Type.All && info.chatTypeID != (int)ChatInfo.Type.Private)
                {
                    if (SelectChatTypeEvent != null)
                    {
                        SelectChatTypeEvent((int)CurChatType);
                    }
                }
                //聊天默认的频道为None
                // if (ChatInfoEvent != null && (info.chatTypeID == (int)curChatType || (int)curChatType == (int)ChatInfo.Type.World || (int)curChatType == (int)ChatInfo.Type.All)) ChatInfoEvent(info);
                if (ChatInfoOutEvent != null)
                {
                    ChatInfoOutEvent(info);
                }
                if (OnVoiceUpdate != null)
                {
                    OnVoiceUpdate();
                }
            }
        }
    }
Esempio n. 3
0
    protected void S2C_AddMerryGoRound(Pt _info)
    {
        pt_system_notic_d802 info = _info as pt_system_notic_d802;

        if (info == null)
        {
            return;
        }
        //Debug.Log("info.body  " + info.body);
        MerryGoRoundDataInfo dataInfo = new MerryGoRoundDataInfo(1, info.body);

        if (OnAddMerryGoRoundData != null)
        {
            OnAddMerryGoRoundData(dataInfo);
        }
    }
Esempio n. 4
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);
                }
            }
        }
    }