62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
|
using Newtonsoft.Json;
|
|||
|
using System;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using UnityEngine;
|
|||
|
//5.2.4<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD>ɱ
|
|||
|
public class queryKnightKill524 : MonoBehaviour
|
|||
|
{
|
|||
|
//<2F><><EFBFBD>صģ<D8B5><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
public KnightKill knightKill;
|
|||
|
|
|||
|
//async void Start()
|
|||
|
//{
|
|||
|
// KnightKill result = await queryKnightKill(39592); // =============================== ʾ<><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// if (result != null)
|
|||
|
// {
|
|||
|
// Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>Code: " + result.Code);
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
public async Task<KnightKill> queryKnightKill(int KnightId) // 5.2.2//<2F>贫<EFBFBD><E8B4AB>KightId
|
|||
|
{
|
|||
|
// <><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> head524 = new Dictionary<string, string>
|
|||
|
{
|
|||
|
{ "Authorization", Global.global.serverResponse.data.token }
|
|||
|
};
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
QueryKnightRoomListBody queryKnightRoomListBody = new QueryKnightRoomListBody
|
|||
|
{
|
|||
|
userId = Global.global.serverResponse.data.userId,
|
|||
|
knightId = KnightId
|
|||
|
};
|
|||
|
Debug.Log(queryKnightRoomListBody);
|
|||
|
// <20>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//string response524 = await web.SendRequest(web.URL + "/snail/gameKnight/queryKill", "POST", JsonUtility.ToJson(queryKnightRoomListBody), head524);
|
|||
|
string response524 = await web.SendRequest(web.URL + "/snail/gameKnight/queryKill", "POST", JsonConvert.SerializeObject(queryKnightRoomListBody), head524);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
|||
|
Debug.Log("5.2.4<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD>ɱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿ<EFBFBD><EFBFBD>:=============== " + response524);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Ϊ KnightRoomList <20><><EFBFBD><EFBFBD>
|
|||
|
try
|
|||
|
{
|
|||
|
knightKill = JsonConvert.DeserializeObject<KnightKill>(response524);
|
|||
|
if (knightKill != null && knightKill.data != null)//==================================================<3D><><EFBFBD><EFBFBD>֮ǰ<D6AE><C7B0><EFBFBD>пգ<D0BF>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD>ʱ<EFBFBD>䣬data[]Ϊ<><CEAA>
|
|||
|
{
|
|||
|
Debug.Log(knightKill.data.beansCoinFee + "=524========");
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
Debug.LogError("<22><><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD>Ӧʧ<D3A6><CAA7>: " + ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> KnightKill <20><><EFBFBD><EFBFBD>
|
|||
|
return knightKill;//knightKill;
|
|||
|
}
|
|||
|
}
|