public override void OnResponse(string data) { List <UserData> userList = new List <UserData>(); if (data != "0") { string[] userDatas = data.Split('.'); foreach (string ud in userDatas) { string[] strs = ud.Split(','); userList.Add(new UserData(int.Parse(strs[0]), strs[1], int.Parse(strs[2]), int.Parse(strs[3]))); } } roomList.LoadRoomItemSync(userList); }
public override void OnResponse(string data) { Debug.LogWarning("这里什么情况" + data); List <UserData> udList = new List <UserData>(); if (data != "0") { string[] udArray = data.Split('|'); foreach (string ud in udArray) { string[] strs = ud.Split(','); udList.Add(new UserData(int.Parse(strs[0]), strs[1], int.Parse(strs[2]), int.Parse(strs[3]))); } } roomListPanel.LoadRoomItemSync(udList); }
public override void OnResponse(string data) { // base.OnResponse(data); List <UserData> udList = new List <UserData>(); if (data != "0") { string[] udArray = data.Split('|'); foreach (string room in udArray) { string[] strs = room.Split(','); udList.Add(new UserData(int.Parse(strs[0]), strs[1], int.Parse(strs[2]), int.Parse(strs[3]))); } } roomListPanel.LoadRoomItemSync(udList); }
public override void OnResponse(string data) { List <UserData> udList = new List <UserData>(); //產生一個空的玩家資料清單,用來把其中資訊放到房間資訊上 //房間會呈現玩家資訊,像是房主名稱、勝率等等 if (data != "0") { string[] udArray = data.Split('|'); //抓到的資料,放到陣列內 foreach (string ud in udArray) //陣列內每項資料轉成字串陣列,並用逗號分隔,把資料加到空的玩家資料清單 { string[] strs = ud.Split(','); udList.Add(new UserData(int.Parse(strs[0]), strs[1], int.Parse(strs[2]), int.Parse(strs[3]))); } } roomListPanel.LoadRoomItemSync(udList);//空的玩家資料清單被加入資料了,叫ui面板(房間列表)呈現出資料(房主資訊) }
public override void OnResponse(string data) { List <UserData> userDataList = new List <UserData>(); if (data != "0") { string[] roomArray = data.Split('|'); foreach (string userData in roomArray) { //分割房主信息和地图索引,strs[0]-房主ID,strs[1]-房主名字,strs[2]-房主游戏总局数,strs[3]-房主胜利局数,strs[4]-地图索引 string[] strs = userData.Split(','); userDataList.Add(new UserData(int.Parse(strs[0]), strs[1], int.Parse(strs[2]), int.Parse(strs[3]), int.Parse(strs[4]))); } } roomListPanel.LoadRoomItemSync(userDataList); }
public override void OnResponse(string data) { base.OnResponse(data); List <Room> roomList = new List <Room>(); //List<UserData> udList=new List<UserData>(); if (data != "0") { string[] roomArray = data.Split('|'); foreach (string roomInfo in roomArray) { string[] strs = roomInfo.Split('-'); roomList.Add(new Room(new UserData(strs[0]), int.Parse(strs[1]))); } } roomListPanel.LoadRoomItemSync(roomList); }