Пример #1
0
 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;
     }
 }
Пример #2
0
    private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data)
    {
        switch (code)
        {
        case WebServiceCode.Code.GetSlot25LineHistory:
            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
                {
                    UILayerController.Instance.ShowLayer(UILayerKey.LGameSlot25LineStatistic, _assetBundleConfig.name, (layer) =>
                    {
                        ((LGameSlot25LineStatistic)layer).InitHistory(_config, data);
                    });
                }
            }
            break;

        case WebServiceCode.Code.GetSlot25LineJackpot:
            UILayerController.Instance.HideLoading();
            if (status == WebServiceStatus.Status.OK)
            {
                if (VKCommon.StringIsNull(data))
                {
                    NotifyController.Instance.Open("Không có lịch sử trúng hũ", NotifyController.TypeNotify.Other);
                }
                else
                {
                    LGameSlot25LineStatistic layerStatistic = UILayerController.Instance.GetLayer <LGameSlot25LineStatistic>();

                    if (layerStatistic != null)
                    {
                        layerStatistic.LoadPageJackpotData(data);
                    }
                    else
                    {
                        UILayerController.Instance.ShowLayer(UILayerKey.LGameSlot25LineStatistic, _assetBundleConfig.name, (layer) =>
                        {
                            ((LGameSlot25LineStatistic)layer).InitJackpot(_config, data, (page) =>
                            {
                                UILayerController.Instance.ShowLoading();
                                SendRequest.SendGetSlot25LineJackpot(_config.urlApi, moneyType, page, _config.pageJackpotSize);
                            });
                        });
                    }
                }
            }
            break;
        }
    }
    private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data)
    {
        switch (code)
        {
        case WebServiceCode.Code.GetHistoryMiniPoker:
            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
                {
                    SRSMiniPokerHistory log = JsonUtility.FromJson <SRSMiniPokerHistory>(VKCommon.ConvertJsonDatas("data", data));
                    histories = log.data;

                    LoadData();
                }
            }
            break;

        case WebServiceCode.Code.GetTopMiniPoker:
            UILayerController.Instance.HideLoading();
            if (status == WebServiceStatus.Status.OK)
            {
                if (VKCommon.StringIsNull(data))
                {
                    NotifyController.Instance.Open("Không có dữ liệu", NotifyController.TypeNotify.Other);
                }
                else
                {
                    SRSMiniPokerRank log = JsonUtility.FromJson <SRSMiniPokerRank>(VKCommon.ConvertJsonDatas("data", data));
                    ranks = log.data;

                    LoadData();
                }
            }
            break;
        }
    }
Пример #4
0
    private void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data)
    {
        switch (code)
        {
        case WebServiceCode.Code.GetVuaBaoRank:
            UILayerController.Instance.HideLoading();
            if (status == WebServiceStatus.Status.OK)
            {
                if (VKCommon.StringIsNull(data))
                {
                    NotifyController.Instance.Open("Không có vinh danh", NotifyController.TypeNotify.Other);
                }
                else
                {
                    SRSVuaBaoRank log = JsonUtility.FromJson <SRSVuaBaoRank>(VKCommon.ConvertJsonDatas("data", data));
                    ranks = log.data;

                    LoadData();
                }
            }
            break;
        }
    }
Пример #5
0
    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;
        }
    }