// event public void HandleLobbyInfo(object[] data) { string json = BestHTTP.JSON.Json.Encode(data[0]); roomData = JsonConvert.DeserializeObject <SRSSamLobby>(VKCommon.ConvertJsonDatas("rooms", json)); LoadRoom(); }
public void AddPlayerBets(string data) { playerBets = new SRSBauCuaPlayerBet(); if (!string.IsNullOrEmpty(data) && data.Length > 2) { playerBets = JsonUtility.FromJson <SRSBauCuaPlayerBet>(VKCommon.ConvertJsonDatas("playerBets", data)); } }
public void HubBetSuccess(object[] data) { SRSBauCuaBetSuccess bcBetSuccess = new SRSBauCuaBetSuccess(); bcBetSuccess = JsonUtility.FromJson <SRSBauCuaBetSuccess>(VKCommon.ConvertJsonDatas("bets", JsonMapper.ToJson(data[0]))); bcBetSuccess.balance = double.Parse(data[1].ToString()); bcBetSuccess.moneyType = int.Parse(data[2].ToString()); // show info Database.Instance.UpdateUserMoney(bcBetSuccess.moneyType, bcBetSuccess.balance); foreach (var item in bcBetSuccess.bets) { uiGates[(int)item.Gate - 1].ShowMeBetDone(item.Amount); uiGates[(int)item.Gate - 1].RemoveChip(vkChipPool, uiChips, tranWorld, false); } }
private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GetHistoryMiniHightlow: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (string.IsNullOrEmpty(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { SRSHighLowHistory log = JsonUtility.FromJson <SRSHighLowHistory>(VKCommon.ConvertJsonDatas("data", data)); histories = log.data; LoadData(); } } break; case WebServiceCode.Code.GetTopMiniHightlow: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (string.IsNullOrEmpty(data)) { NotifyController.Instance.Open("Không có dữ liệu", NotifyController.TypeNotify.Other); } else { SRSHighLowRank log = JsonUtility.FromJson <SRSHighLowRank>(VKCommon.ConvertJsonDatas("data", data)); ranks = log.data; LoadData(); } } break; } }
public void HandleLobby(object[] data) { string json = BestHTTP.JSON.Json.Encode(data[0]); roomData = JsonUtility.FromJson <SRSXocXocLobby>(VKCommon.ConvertJsonDatas("rooms", json)); roomData.rooms = roomData.rooms.OrderByDescending(a => a.MaxPlayer).ToList(); LoadRoom(); if (isClickChoiNhanh) { isClickChoiNhanh = false; foreach (var room in roomData.rooms) { if (room.TotalPlayer < room.MaxPlayer) { _server.HubCallJoin(room.RoomID); } } } }
private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GetBauCuaTransactionHistory: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (string.IsNullOrEmpty(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { SRSBauCuaLog log = JsonUtility.FromJson <SRSBauCuaLog>(VKCommon.ConvertJsonDatas("logs", data)); logs = log.logs; LoadData(); } } break; } }
private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GetBauCuaRank: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (string.IsNullOrEmpty(data)) { NotifyController.Instance.Open("Không có dữ liệu", NotifyController.TypeNotify.Other); } else { SRSBauCuaRank log = JsonUtility.FromJson <SRSBauCuaRank>(VKCommon.ConvertJsonDatas("ranks", data)); ranks = log.ranks; LoadData(); } } break; } }
private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GetVuaBaoHistory: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (VKCommon.StringIsNull(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { SRSVuaBaoHistory log = JsonUtility.FromJson <SRSVuaBaoHistory>(VKCommon.ConvertJsonDatas("data", data)); histories = log.data; LoadData(); } } break; } }
private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GetBauCuaHistory: if (status == WebServiceStatus.Status.OK) { if (VKCommon.StringIsNull(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { SRSBauCuaHistory bcHistory = JsonUtility.FromJson <SRSBauCuaHistory>(VKCommon.ConvertJsonDatas("histories", data)); _baucua.histories = bcHistory.histories; LoadHistory(); } } else { SendRequest.SendGetBauCuaHistory(_API, _baucua.moneyType); } break; } }
public void HandleGetMessage(object[] data) { if (data != null && data.Length > 0) { SRSTaiXiuChatAll txChats = JsonConvert.DeserializeObject <SRSTaiXiuChatAll>(VKCommon.ConvertJsonDatas("data", BestHTTP.JSON.Json.Encode(data[0]))); for (int i = 0; i < txChats.data.Count; i++) { AddChat(txChats.data[i]); } if (gChatContent.activeSelf) { txtChatContent.text = chatData; } } }
private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GetTaiXiuHistory: if (status == WebServiceStatus.Status.OK) { if (VKCommon.StringIsNull(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { _taixiu.Histories = JsonConvert.DeserializeObject <List <SRSTaiXiuDice> >(data); _taixiu.Histories = _taixiu.Histories.OrderByDescending(a => a.SessionId).ToList(); LoadHistory(); } } else { SendRequest.SendGetTaiXiuHistory(_API, _taixiu.MoneyType); } break; case WebServiceCode.Code.GetTaiXiuTransactionHistory: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (VKCommon.StringIsNull(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { SRSTaiXiuTransactionHistory trans = JsonConvert.DeserializeObject <SRSTaiXiuTransactionHistory>(VKCommon.ConvertJsonDatas("data", data)); var layerTemp = UILayerController.Instance.GetLayer <LGameTaiXiuBetInfo>(); if (layerTemp != null) { layerTemp.LoadData(trans.data); } else { UILayerController.Instance.ShowLayer(UILayerKey.LGameTaiXiuBetInfo, _assetBundleConfig.name, (layer) => { ((LGameTaiXiuBetInfo)layer).Init(trans.data, _taixiu.MoneyType, SendGetTransactionHistory); }); } } } break; case WebServiceCode.Code.GetTaiXiuSessionInfo: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (VKCommon.StringIsNull(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { SRSTaiXiuSessionLog log = JsonConvert.DeserializeObject <SRSTaiXiuSessionLog>(data); var layerTemp = UILayerController.Instance.GetLayer <LGameTaiXiuGameInfo>(); if (layerTemp != null) { layerTemp.LoadData(log); } else { UILayerController.Instance.ShowLayer(UILayerKey.LGameTaiXiuGameInfo, _assetBundleConfig.name, (layer) => { ((LGameTaiXiuGameInfo)layer).Init(log, _taixiu, _taixiu.MoneyType, SendGetSessionInfo); }); } } } break; case WebServiceCode.Code.GetTaiXiuRank: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (VKCommon.StringIsNull(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { SRSTaiXiuRank rankData = JsonConvert.DeserializeObject <SRSTaiXiuRank>(VKCommon.ConvertJsonDatas("data", data)); var layerTemp = UILayerController.Instance.GetLayer <LGameTaiXiuRank>(); if (layerTemp != null) { layerTemp.LoadData(rankData.data); } else { UILayerController.Instance.ShowLayer(UILayerKey.LGameTaiXiuRank, _assetBundleConfig.name, (layer) => { ((LGameTaiXiuRank)layer).Init(rankData.data, _taixiu.MoneyType, SendGetRank); }); } } } break; case WebServiceCode.Code.CheckTaiXiuEvent: if (status == WebServiceStatus.Status.OK) { if (VKCommon.StringBoolIsTrue(data)) { if (string.IsNullOrEmpty(strEventTime)) { SendRequest.SendGetTaiXiuEventTime(_APIEVENT); } SendRequest.SendGetTaiXiuEventAccount(_APIEVENT); } else { _event.Hide(); } } else { _event.Hide(); } break; case WebServiceCode.Code.GetTaiXiuEventAccount: if (status == WebServiceStatus.Status.OK) { if (!VKCommon.StringIsNull(data)) { SRSTaiXiuEvent taiXiuEvent = JsonConvert.DeserializeObject <SRSTaiXiuEvent>(data); _event.Show(taiXiuEvent); } } break; case WebServiceCode.Code.GetTaiXiuEventTime: if (status == WebServiceStatus.Status.OK) { if (!VKCommon.StringIsNull(data)) { _taixiu.AddEventTime(JsonConvert.DeserializeObject <SRSTaiXiuEventTime>(data)); strEventTime = _taixiu.taiXiuEventTime.Time; } } break; case WebServiceCode.Code.GetTaiXiuEventTop: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { if (VKCommon.StringIsNull(data)) { NotifyController.Instance.Open("Không có lịch sử", NotifyController.TypeNotify.Other); } else { var log = JsonConvert.DeserializeObject <List <SRSTaiXiuEventTopItem> >(data); var layerTemp = UILayerController.Instance.GetLayer <LGameTaiXiuEventTop>(); if (layerTemp != null) { layerTemp.LoadData(log); } else { UILayerController.Instance.ShowLayer(UILayerKey.LGameTaiXiuEventTop, _assetBundleConfig.name, (layer) => { ((LGameTaiXiuEventTop)layer).Init(log, _taixiu, SendGetEventTop); }); } } } break; } }