2024-11-26 00:07:12 +08:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
//5.2.3<EFBFBD><EFBFBD>ע
|
2024-11-28 04:40:30 +08:00
|
|
|
|
public class SnailKnightBet523 : Base
|
2024-11-26 00:07:12 +08:00
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD>صģ<D8B5><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>====================
|
|
|
|
|
//public KnightRoomBetList knightRoomBetList;
|
|
|
|
|
|
|
|
|
|
//async void Start()
|
|
|
|
|
//{
|
|
|
|
|
// await SnailKnightBet(39592, 1, 3); // =============================== ʾ<><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//}
|
|
|
|
|
|
2024-11-28 04:40:30 +08:00
|
|
|
|
public async Task<bool> SnailKnightBet(int KnightId,float bet,int horseNo)
|
2024-11-26 00:07:12 +08:00
|
|
|
|
{
|
|
|
|
|
// <><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> head523 = new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "Authorization", Global.global.serverResponse.data.token }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
KnightBetBody knightBetBody = new KnightBetBody
|
|
|
|
|
{
|
|
|
|
|
userId = Global.global.serverResponse.data.userId,
|
|
|
|
|
knightId = KnightId,
|
|
|
|
|
bet = bet,
|
|
|
|
|
horseNo = horseNo
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// <20>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string response523 = await web.SendRequest(web.URL + "/snail/gameKnight/userBet", "POST", JsonConvert.SerializeObject(knightBetBody), head523);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD>"+ JsonConvert.SerializeObject(knightBetBody) + "5.2.3<EFBFBD><EFBFBD>ע: " + response523);
|
2024-11-28 04:40:30 +08:00
|
|
|
|
KnightBetResponse knightResponse = new KnightBetResponse();
|
2024-11-26 00:07:12 +08:00
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
|
|
|
|
try
|
|
|
|
|
{
|
2024-11-28 04:40:30 +08:00
|
|
|
|
knightResponse = JsonConvert.DeserializeObject<KnightBetResponse>(response523);
|
2024-11-26 00:07:12 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("<22><><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD>Ӧʧ<D3A6><CAA7>: " + ex.Message);
|
|
|
|
|
}
|
2024-11-28 04:40:30 +08:00
|
|
|
|
bool isSucceed;
|
|
|
|
|
if (knightResponse.code == 200)
|
|
|
|
|
{
|
|
|
|
|
isSucceed = true;
|
|
|
|
|
addEventPopUp(knightResponse.message);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
isSucceed = false;
|
|
|
|
|
addEventPopUp(knightResponse.message);
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-26 00:07:12 +08:00
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> KnightRoomBetList <20><><EFBFBD><EFBFBD>
|
2024-11-28 04:40:30 +08:00
|
|
|
|
return isSucceed;
|
2024-11-26 00:07:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|