_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs

77 lines
3.1 KiB
C#
Raw Normal View History

using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
//526<32><36>ѯ<EFBFBD>û<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>¼
public class queryKnightRecord526 : MonoBehaviour
{
KnightRecord knightRecord = new KnightRecord();
public async Task<KnightRecord> queryKnightBetResult(int orderByDesc) // 5.2.6
{
// ׼<><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> head526 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
QueryKnightRecordBody queryKnightRecordBody = new QueryKnightRecordBody
{
userId = Global.global.serverResponse.data.userId,
orderByDesc = orderByDesc
};
// <20><EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
string response526 = await web.SendRequest(web.URL + "/snail/gameKnight/queryUserRecord", "POST", JsonUtility.ToJson(queryKnightRecordBody), head526);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
Debug.Log("5.2.6<EFBFBD><EFBFBD>ѯ<EFBFBD>û<EFBFBD>ս<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼ =====================" + response526);
// <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Ϊ KnightRoomList <20><><EFBFBD><EFBFBD>
KnightRecord knightRecord = JsonConvert.DeserializeObject<KnightRecord>(response526);
// <20><><EFBFBD><EFBFBD><E9B7B4><EFBFBD>л<EFBFBD><D0BB>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD>
if (knightRecord != null && knightRecord.data != null)
{
// <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
Debug.Log("Code: " + knightRecord.code);
Debug.Log("Message: " + knightRecord.message);
Debug.Log("Total Beans Coin Bet: " + knightRecord.data.beansCoinBet);
Debug.Log("Total Beans Coin Win: " + knightRecord.data.beansCoinWin);
// <20><>ȡս<C8A1><D5BD><EFBFBD><EFBFBD>¼<EFBFBD>б<EFBFBD>
List<GameKnightModelRecord> gameList = knightRecord.data.gameKnightModelList;
if (gameList != null && gameList.Count > 0)
{
foreach (GameKnightModelRecord game in gameList)
{
Debug.Log("Game ID: " + game.id);
Debug.Log("Game No: " + game.gameNo);
Debug.Log("Game Session: " + game.gameSession);
Debug.Log("Start Time: " + game.startTime);
Debug.Log("Bet Time: " + game.betTime);
Debug.Log("Count Time: " + game.countTime);
Debug.Log("Settle Time: " + game.settleTime);
Debug.Log("Status: " + game.status);
Debug.Log("Horse No All: " + game.horseNoAll);
Debug.Log("Horse No Kill: " + game.horseNoKill);
Debug.Log("Horse No Remain: " + game.horseNoRemain);
Debug.Log("Beans Coin All: " + game.beansCoinAll);
Debug.Log("Beans Coin Kill: " + game.beansCoinKill);
Debug.Log("Beans Coin Remain: " + game.beansCoinRemain);
Debug.Log("Beans Coin Fee: " + game.beansCoinFee);
Debug.Log("Beans Coin Divide: " + game.beansCoinDivide);
}
}
}
else
{
Debug.LogError("KnightRecord or KnightRecord data is null");
}
return knightRecord;
}
}