Exemple #1
0
 void CheckInputIsSuc(string roomId)
 {
     if (roomId.Length >= 10)
     {
         UIManagers.Instance.EnqueueTip("获取他人回放信息数据中");
         WWWForm info = new WWWForm();
         info.AddField("roomId", roomId);
         string url = GlobalData.mConstBaseServerUrl + ServerUrlTitle.Url_GetOtherRecordDetail;
         StartCoroutine(MsgContainer.GlobalData.SendPost(url, info, delegate(WWW www)
         {
             if (www.text != null)
             {
                 string text = www.text;
                 RecordDetailData detailData = JsonManager.GetRecordDetailData(text);
                 DetailDataToRecordData(detailData);
             }
             else
             {
                 UIManagers.Instance.EnqueueTip("获取他人回放信息错误");
             }
         }));
         if (roomId.Length > 10)
         {
             shareCode.Remove(shareCode.Length - 2, 2);
             numInputText.text = shareCode.ToString();
         }
     }
 }
Exemple #2
0
    public void DetailDataToRecordData(RecordDetailData detailData)
    {
        if (detailData == null)
        {
            return;
        }
        RecordData recordData = new RecordData();

        recordData.endTime  = detailData.endTime;
        recordData.gameType = detailData.gameType;
        recordData.num      = detailData.gameNum;
        recordData.roomCode = detailData.roomCode;
        recordData.roomid   = detailData.roomId;
        if (detailData.gameType > 2)
        {
            if (detailData.gameType != 6)
            {
                recordData.limitCard = detailData.gameType * 2;//3,4,5 >>6,8,10
            }
            else
            {
                recordData.limitCard = 14;//A
            }
        }
        List <Dictionary <string, string> > dicInfo = new List <Dictionary <string, string> >();

        if (detailData.players != null)//转蛋 其他玩家信息
        {
            for (int i = 0; i < detailData.players.Count; i++)
            {
                PlayBackFightData           fightData = detailData.players[i];
                Dictionary <string, string> dicStr    = new Dictionary <string, string>();
                dicStr.Add("pid", fightData.pid.ToString());
                dicStr.Add("allGoal", fightData.allGoal.ToString());
                for (int j = 0; j < detailData.player.Count; j++)
                {
                    if (detailData.player[j].pid == detailData.players[i].pid)
                    {
                        dicStr.Add("name", detailData.player[j].name);
                        break;
                    }
                }
                dicInfo.Add(dicStr);
            }
        }
        else if (detailData.endings != null) //掼蛋 其他玩家信息
        {
            List <PlayBackFightData> player  = detailData.player;
            List <PlayBackFightData> endings = detailData.endings;
            for (int i = 0; i < player.Count; i++)
            {
                PlayBackFightData           fightData = player[i];
                Dictionary <string, string> dicStr    = new Dictionary <string, string>();
                dicStr.Add("pid", fightData.pid.ToString());
                dicStr.Add("name", fightData.name);
                for (int j = 0; j < endings.Count; j++)
                {
                    bool         isBreak = false;
                    List <ulong> member  = endings[j].member;
                    for (int m = 0; m < member.Count; m++)
                    {
                        if (member[m] == player[i].pid)
                        {
                            dicStr.Add("level", endings[j].level.ToString());
                            isBreak = true;
                            break;
                        }
                    }
                    if (isBreak)
                    {
                        break;
                    }
                }
                dicInfo.Add(dicStr);
            }
        }
        recordData.info = dicInfo;
        RoomId_RoomInfo(recordData);
    }