57 lines
1.9 KiB
C#
57 lines
1.9 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using Newtonsoft.Json;
|
|||
|
using System;
|
|||
|
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3>ʿ<EFBFBD><CABF>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
|
|||
|
public class queryClosestKnight521 : MonoBehaviour
|
|||
|
{
|
|||
|
//<2F><><EFBFBD>صģ<D8B5><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
public ClosestKnight closestKnight;
|
|||
|
|
|||
|
|
|||
|
public async Task<ClosestKnight> queryClosestKnight() // 5.2.1
|
|||
|
|
|||
|
{
|
|||
|
// <><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>
|
|||
|
Dictionary<string, string> head521 = new Dictionary<string, string>
|
|||
|
{
|
|||
|
{ "Authorization", Global.global.serverResponse.data.token }
|
|||
|
};
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ն<EFBFBD><D5B6><EFBFBD> "{}"<22><>
|
|||
|
string requestBody = "{}";
|
|||
|
|
|||
|
// <20>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>ţ<EFBFBD><C5A3>ʿ<EFBFBD><CABF>Ϣ
|
|||
|
string response521 = await web.SendRequest(web.URL + "/snail/gameKnight/queryLatest", "POST", requestBody, head521);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
|||
|
Debug.Log("5.2.1<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD><EFBFBD>ʿ" + response521);
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Ϊ ClosestKnight <20><><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD> JSON <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Ϊ ClosestKnight <20><><EFBFBD><EFBFBD>
|
|||
|
ClosestKnight closestKnight = JsonConvert.DeserializeObject<ClosestKnight>(response521);
|
|||
|
|
|||
|
//if (closestKnight != null && closestKnight.Data != null)
|
|||
|
//{
|
|||
|
// Debug.Log("Я<><D0AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: " + closestKnight.Data.CarrySeconds);
|
|||
|
// Debug.Log("<22><>ϷID: " + closestKnight.Data.GameKnightModel.Id);
|
|||
|
// Debug.Log("<22><>Ϸ<EFBFBD><CFB7>ʼʱ<CABC><CAB1>: " + closestKnight.Data.GameKnightModel.StartTime);
|
|||
|
|
|||
|
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>б<EFBFBD>
|
|||
|
// foreach (var room in closestKnight.Data.GameKnightRoomResponseVoList)
|
|||
|
// {
|
|||
|
// Debug.Log("<22><>ʿID: " + room.KnightId);
|
|||
|
// Debug.Log("<22><>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>: " + room.HorseNo);
|
|||
|
// Debug.Log("<22><>ƥ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>: " + room.HorseUserNo);
|
|||
|
// Debug.Log("<22><>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>: " + room.HorseBeansCoin);
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
// <20><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> closestKnight <20><><EFBFBD><EFBFBD>
|
|||
|
return closestKnight;
|
|||
|
}
|
|||
|
|
|||
|
}
|