Beispiel #1
0
    /// <summary>
    /// 查询角色信息回调
    /// </summary>
    /// <param name="playerEntity"></param>
    private void OnAgentRequestPlayerInfoCallBack(NetWorkHttp.CallBackArgs args)
    {
        m_isBusy = false;
        if (args.HasError)
        {
            ShowMessage("错误", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("错误", args.Value.msg);
                return;
            }

            int    playerId   = args.Value.data["id"].ToString().ToInt();
            string nickName   = args.Value.data["nickname"].ToString();
            int    cardsCount = args.Value.data["cards"].ToString().ToInt();

            if (m_UIPlayerInfoView != null)
            {
                m_UIPlayerInfoView.SetPlayerInfo(AccountProxy.Instance.CurrentAccountEntity.passportId, playerId, nickName, cardsCount);
            }
        }
    }
    /// <summary>
    /// 当注册完毕后的回调
    /// </summary>
    /// <param name="obj"></param>
    private void OnRegCallback(NetWorkHttp.CallBackArgs obj)
    {
        if (obj.HasError)
        {
            LogError(obj.ErrorMsg);
        }
        else
        {
            ReturnValue      returnValue      = LitJson.JsonMapper.ToObject <ReturnValue>(obj.Value);
            RetAccountEntity retAccountEntity = LitJson.JsonMapper.ToObject <RetAccountEntity>(returnValue.Value.ToString());
            GlobalInit.Instance.m_currentAccountEntity = retAccountEntity;
            Log("注册成功" + retAccountEntity.LastServerName);
            Stat.Reg(retAccountEntity.Id, resiterView.txt_AccountInpField.text);

            //本地缓存玩家的帐号和密码
            PlayerPrefs.SetInt(ConstDefine.LogOn_AccountID, retAccountEntity.Id);

            PlayerPrefs.SetString(ConstDefine.LogOn_AccountID, resiterView.txt_AccountInpField.text);

            PlayerPrefs.SetString(ConstDefine.LogOn_AccountID, resiterView.txt_PwdInpField.text);


            WindowUIMgr.Instance.CloseWindow(WindowUIType.Reg);

            GameServerCtrl.Instance.OpenView(WindowUIType.GameServerEnter);
        }
    }
Beispiel #3
0
    /// <summary>
    /// 账号登录回调
    /// </summary>
    /// <param name="args"></param>
    private void OnLoginCallBack(NetWorkHttp.CallBackArgs args)
    {
        m_isBusy = false;
        UIViewManager.Instance.CloseWait();
        if (args.HasError)
        {
            ShowMessage("错误提示", args.ErrorMsg, MessageViewType.Ok);
            if (PlayerPrefs.HasKey("passportId"))
            {
                PlayerPrefs.DeleteKey("passportId");
                PlayerPrefs.DeleteKey("token");
            }
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("错误提示", args.Value.msg, MessageViewType.Ok);
                if (PlayerPrefs.HasKey("passportId"))
                {
                    PlayerPrefs.DeleteKey("passportId");
                    PlayerPrefs.DeleteKey("token");
                }
                return;
            }
            AccountProxy.Instance.CurrentAccountEntity = LitJson.JsonMapper.ToObject <AccountEntity>(LitJson.JsonMapper.ToJson(args.Value.data));
            PlayerPrefs.SetInt("passportId", AccountProxy.Instance.CurrentAccountEntity.passportId);
            PlayerPrefs.SetString("token", AccountProxy.Instance.CurrentAccountEntity.token);

            GameCtrl.Instance.RequestGameServer();
        }
    }
Beispiel #4
0
 private void OnAgentServiceConfigCallBack(NetWorkHttp.CallBackArgs args)
 {
     if (args.HasError)
     {
         ShowMessage("提示", "网络连接失败");
     }
     else
     {
         if (args.Value.code < 0)
         {
             ShowMessage("错误", args.Value.msg);
             return;
         }
         List <TransferData> lstData = new List <TransferData>();
         if (args.Value.data == null || args.Value.data.Count == 0)
         {
             return;
         }
         for (int i = 0; i < args.Value.data.Count; i++)
         {
             LitJson.JsonData jsonData    = args.Value.data[i];
             string           id          = jsonData["id"].ToString();     //ID
             string           textWX      = jsonData["wx"].ToString();     //微信号
             string           phoneNumber = jsonData["tel"].ToString();    //电话
             string           remark      = jsonData["remark"].ToString(); //地区
             string           status      = jsonData["status"].ToString(); //状态
             TransferData     data        = new TransferData();
             data.SetValue("wx", textWX);
             data.SetValue("tel", phoneNumber);
             lstData.Add(data);
         }
         m_UIAgentServiceWindow.SetUI(lstData, OnBtnInfoClick);
     }
 }
Beispiel #5
0
    private void OnInitCallBack(NetWorkHttp.CallBackArgs obj)
    {
        if (!obj.HasError)
        {
            string           item = obj.Value;
            LitJson.JsonData data = LitJson.JsonMapper.ToObject(obj.Value);

            bool hasError = (bool)data["HasError"];
            if (!hasError)
            {
                LitJson.JsonData config = LitJson.JsonMapper.ToObject(data["Value"].ToString());

                Debug.Log("config==" + data["Value"].ToString());

                CurrChannelInitConfig.ServerTime  = long.Parse(config["ServerTime"].ToString());
                CurrChannelInitConfig.SourceUrl   = config["SourceUrl"].ToString();
                CurrChannelInitConfig.RechargeUrl = config["RechargeUrl"].ToString();
                CurrChannelInitConfig.TDAppId     = config["TDAppId"].ToString();
                CurrChannelInitConfig.IsOpenTD    = int.Parse(config["IsOpenTD"].ToString()) == 1;

                Debug.Log("ServerTime==" + CurrChannelInitConfig.ServerTime);
                Debug.Log("SourceUrl==" + CurrChannelInitConfig.SourceUrl);

                if (DelegateDefine.Instance.ChannelInitOK != null)
                {
                    DelegateDefine.Instance.ChannelInitOK();
                }
            }
            else
            {
                string msg = data["ErrorMsg"].ToString();
                MessageCtrl.Instance.ShowMessageView(msg);
            }
        }
    }
Beispiel #6
0
    /// <summary>
    /// 绑定手机号回调
    /// </summary>
    /// <param name="args"></param>
    private void OnBindPhoneCallBack(NetWorkHttp.CallBackArgs args)
    {
        m_isBusy = false;
        if (args.HasError)
        {
            ShowMessage("错误", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("错误", args.Value.msg);
                return;
            }

            int    cards = args.Value.data["cards"].ToString().ToInt();
            string phone = args.Value.data["phone"].ToString();
            AccountProxy.Instance.SetCards(cards);
            AccountProxy.Instance.SetPhone(phone);
            if (m_UIBindView != null)
            {
                m_UIBindView.SetUI(phone);
            }
            ShowMessage("成功", "绑定成功");
        }
    }
Beispiel #7
0
    /// <summary>
    /// 请求发送获得礼品玩家的相关信息回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestSendMessageCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg);
                return;
            }
            //if (args.Value.data == null || args.Value.data.Count == 0) return;

            ExchangeRecordCallBackEntity exchangeRecordCallBackEntity = LitJson.JsonMapper.ToObject <ExchangeRecordCallBackEntity>(args.Value.data.ToJson());;

            string wxCustonmerService = exchangeRecordCallBackEntity.wx_kf;

            TransferData data = new TransferData();

            data.SetValue("wxCustonmerService", wxCustonmerService);

            data.SetValue("id", exchangeRecordCallBackEntity.id);

            if (m_UIExchangeRecordWindow)
            {
                m_UIExchangeRecordWindow.SetExchangeRecord(data);
            }
            UIViewUtil.Instance.LoadWindow("ApplySuccessdMessage").GetComponent <UIApplySuccessdMessageView>().SetUI(data);

            RequestExchangeRecordInfo();
        }
    }
Beispiel #8
0
    /// <summary>
    /// 获取下载地址回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestDownloadURLCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            UIViewManager.Instance.ShowMessage("错误", "网络连接失败,请重新尝试", MessageViewType.OkAndCancel, RequestDownloadURL, Application.Quit);
        }
        else
        {
            if (args.Value.code < 0)
            {
                UIViewManager.Instance.ShowMessage("提示", args.Value.msg, MessageViewType.OkAndCancel, RequestDownloadURL, Application.Quit);
                return;
            }

            string url           = args.Value.data["downloadUrl"].ToString();
            bool   isOpenPresent = args.Value.data["isGive"].ToString().ToBool();
            bool   isWXLogin     = args.Value.data["isWxLogin"].ToString().ToBool();
            bool   isOpenInvite  = args.Value.data["isInvite"].ToString().ToBool();

            SystemProxy.Instance.IsOpenPresent = isOpenPresent;
            SystemProxy.Instance.IsOpenWXLogin = isWXLogin;
            SystemProxy.Instance.IsOpenInvite  = isOpenInvite;

            DownloadManager.Instance.DownloadBaseUrl = url;

            CheckNewPackage();
        }
    }
    /// <summary>
    /// 请求福利宝箱界面回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestTreasureCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg);
                return;
            }
            if (args.Value.data == null || args.Value.data.Count == 0)
            {
                return;
            }

            //TreasureWindowEntity treasureWindowEntity = LitJson.JsonMapper.ToObject<TreasureWindowEntity>(args.Value.data.ToJson());
            TreasureKeyNum TreasureKyeNum = LitJson.JsonMapper.ToObject <TreasureKeyNum>(args.Value.data.ToJson());

            TransferData data = new TransferData();

            //data.SetValue("treasureKeyNum", treasureWindowEntity.treasureKeyNum);
            //data.SetValue("lstBoxIndex", treasureWindowEntity.lstBoxIndex);

            data.SetValue("treasureKeyNum", TreasureKyeNum.key_num);

            if (m_UIWelfareActivitiesWindow)
            {
                //m_UIWelfareActivitiesWindow.SetUI(data);
                m_UIWelfareActivitiesWindow.SetTreasure(data);
            }
        }
    }
    /// <summary>
    /// 请求福利活动界面回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestWelfareActivitiesCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg);
                return;
            }
            if (args.Value.data == null || args.Value.data.Count == 0)
            {
                return;
            }

            WelfareActivitiesEntity welfareActivitiesEntity = LitJson.JsonMapper.ToObject <WelfareActivitiesEntity>(args.Value.data.ToJson());

            TransferData data = new TransferData();

            data.SetValue("treasureKeyNum", welfareActivitiesEntity.treasureKeyNum);
            data.SetValue("surPlusTimeCount", welfareActivitiesEntity.surPlusTimeCount);
            data.SetValue("lstBoxIndex", welfareActivitiesEntity.lstBoxIndex);
            data.SetValue("totalTimeCount", welfareActivitiesEntity.totalTimeCount);
            data.SetValue("lstLotteryWheelEntity", welfareActivitiesEntity.lstLotteryWheelEntity);

            if (m_UIWelfareActivitiesWindow)
            {
                m_UIWelfareActivitiesWindow.SetUI(data);
            }
        }
    }
Beispiel #11
0
 /// <summary>
 /// 发送收据回调
 /// </summary>
 /// <param name="args"></param>
 private void OnReceiptCallBack(NetWorkHttp.CallBackArgs args)
 {
     UIViewManager.Instance.CloseWait();
     if (args.HasError)
     {
         ShowMessage("错误", "网络连接失败,正在重新请求服务器");
         if (PlayerPrefs.HasKey("Receipt"))
         {
             Receipt(PlayerPrefs.GetString("OrderId"), PlayerPrefs.GetString("Receipt"));
         }
     }
     else
     {
         if (args.Value.code < 0)
         {
             ShowMessage("错误", args.Value.msg);
             return;
         }
         m_isHasOrder = false;
         PlayerPrefs.DeleteKey("OrderId");
         PlayerPrefs.DeleteKey("Receipt");
         int cardsCount = args.Value.data["cards"].ToString().ToInt();
         AccountProxy.Instance.SetCards(cardsCount);
     }
 }
    /// <summary>
    /// 请求按下大转盘按钮回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestDrawGiftCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg);
                return;
            }
            if (args.Value.data == null || args.Value.data.Count == 0)
            {
                return;
            }

            LotteryWheelGiftCallBackEntity lotteryWheelGiftEntity = LitJson.JsonMapper.ToObject <LotteryWheelGiftCallBackEntity>(args.Value.data.ToJson());

            TransferData data = new TransferData();

            data.SetValue("giftIndex", lotteryWheelGiftEntity.id);
            data.SetValue("time", lotteryWheelGiftEntity.useable);
            data.SetValue("timeTotal", lotteryWheelGiftEntity.total);
            //data.SetValue("giftType", lotteryWheelGiftEntity.giftType);
            //data.SetValue("giftCallBackNum", lotteryWheelGiftEntity.giftCount);
            //data.SetValue("message", lotteryWheelGiftEntity.message);

            if (m_UIWelfareActivitiesWindow)
            {
                m_UIWelfareActivitiesWindow.StartTurn(data);
            }
        }
    }
Beispiel #13
0
    /// <summary>
    /// 请求商店配置回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestShopConfigCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg);
                return;
            }
            TransferData        data    = new TransferData();
            List <TransferData> lstShop = new List <TransferData>();

            m_GoodsList.Clear();

            for (int i = 0; i < args.Value.data.Count; ++i)
            {
                LitJson.JsonData jsonData = args.Value.data[i];
                int    id        = jsonData["id"].ToString().ToInt();
                string name      = jsonData["name"].ToString();
                string iosCode   = jsonData["iosCode"].ToString();
                int    money     = jsonData["money"].ToString().ToInt();
                int    amount    = jsonData["amount"].ToString().ToInt();
                int    giveCount = jsonData["give"].ToString().ToInt();
                bool   isHot     = jsonData["isHot"].ToString().ToBool();
                string icon      = jsonData["icon"].ToString();

                TransferData shopData = new TransferData();
                shopData.SetValue("ShopId", id);
                shopData.SetValue("ShopName", name);
                shopData.SetValue("IosCode", iosCode);
                shopData.SetValue("Money", money);
                shopData.SetValue("Amount", amount);
                shopData.SetValue("GiveCount", giveCount);
                shopData.SetValue("IsHot", isHot);
                shopData.SetValue("Icon", icon);
                lstShop.Add(shopData);

                GoodsEntity goods = new GoodsEntity()
                {
                    amount    = amount,
                    giveCount = giveCount,
                    icon      = icon,
                    id        = id,
                    iosCode   = iosCode,
                    isHot     = isHot,
                    money     = money,
                    name      = name
                };

                m_GoodsList.Add(goods);
            }
            data.SetValue("ShopList", lstShop);
            data.SetValue("BindCode", AccountProxy.Instance.CurrentAccountEntity.codebind);
            m_UIShopWindow.SetUI(data, OnPropClick, OnBtnInfoClick);
        }
    }
Beispiel #14
0
    /// <summary>
    /// 获取个人排行回调
    /// </summary>
    /// <param name="args"></param>
    private void RequestOwnerRankingCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg);
                return;
            }

            RankingEntity entity = LitJson.JsonMapper.ToObject <RankingEntity>(args.Value.data.ToJson());
            if (entity == null)
            {
                return;
            }

            TransferData data = new TransferData();
            data.SetValue("Score", entity.value);
            m_UIRankingView.SetOwnerRanking(data);
        }
    }
Beispiel #15
0
    /// <summary>
    /// 获取公告回调
    /// </summary>
    /// <param name="args"></param>

    private void OnRequestNoticeCallBack(NetWorkHttp.CallBackArgs args)
    {
        //RequestNotice的回调又调用了OpenView

        m_isBusy = false;
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("错误", args.Value.msg);
                return;
            }

            List <NoticeEntity> lst = LitJson.JsonMapper.ToObject <List <NoticeEntity> >(args.Value.data.ToJson());
            // UIViewManager.Instance.OpenWindow(UIWindowType.Notice);
            AppDebug.Log("服务器给的公告数据:" + args.Value.data.ToJson());
            if (m_UIMailView != null)
            {
                //ShowMessage("提示", "这里需要打开");
                m_UIMailView.SetBtnLeft(lst);//在公告面板初始化时,生成按钮
            }
        }
    }
 private void OnGetDataCallback(NetWorkHttp.CallBackArgs args)
 {
     if (args.HasError)
     {
         Debug.Log(args.ErrorMsg);
         return;
     }
     Debug.Log(args.Value);
 }
    private void OnRequestGiftReceiveCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg);
                return;
            }
            if (args.Value.data == null || args.Value.data.Count == 0)
            {
                return;
            }

            ExchangeRecordCallBackEntity exchangeRecordCallBackEntity = LitJson.JsonMapper.ToObject <ExchangeRecordCallBackEntity>(args.Value.data.ToJson());

            int status = exchangeRecordCallBackEntity.status;

            string address = exchangeRecordCallBackEntity.contact_address;

            string name = exchangeRecordCallBackEntity.contact_name;

            string phone = exchangeRecordCallBackEntity.contact_phone;

            int index = exchangeRecordCallBackEntity.id;

            Action requst = null;

            if (prizeType == PrizeType.LotteryWheel)
            {
                requst = CallRequestExchangeLotteryWheelRecordInfo;
            }
            else
            {
                requst = CallRequestExchangeTreasureRecordInfo;;
            }

            if (status == 1)
            {
                ShowMessage("", "领取成功", MessageViewType.Ok, requst);
                AccountCtrl.Instance.RequestCards();
            }
            else if (status == 2)
            {
                if (!m_UIPlayerReceiveRecordInfoView)
                {
                    m_UIPlayerReceiveRecordInfoView = m_UIExchangeRecordWindow.OpenPrompt(name, phone, address, index, requst, PrizeType.Treasure);
                }
            }
        }
    }
Beispiel #18
0
 private void OnUpdateLastLogServerCallback(NetWorkHttp.CallBackArgs args)
 {
     if (args.HasError)
     {
         LogError(args.ErrorMsg);
     }
     else
     {
         Log("更新最后登录服务器完毕。");
     }
 }
Beispiel #19
0
 /// <summary>
 /// 当从服务器获取到时间戳之后的回调处理
 /// </summary>
 /// <param name="obj"></param>
 private void OnGetTimeCallback(NetWorkHttp.CallBackArgs obj)
 {
     if (obj.HasError)
     {
         Debug.Log(obj.ErrorMsg);
     }
     else
     {
         ServerTime = long.Parse(obj.Value.Trim('\"'));
     }
 }
Beispiel #20
0
 private void PostCallBack(NetWorkHttp.CallBackArgs obj)
 {
     if (obj.HasError)
     {
         Debug.Log(obj.ErrorMsg);
     }
     else
     {
         RetValue entity = LitJson.JsonMapper.ToObject <RetValue>(obj.Json);
         Debug.Log(entity.RetData);
     }
 }
Beispiel #21
0
 private void GetCallBack(NetWorkHttp.CallBackArgs obj)
 {
     if (obj.HasError)
     {
         Debug.Log(obj.ErrorMsg);
     }
     else
     {
         AccountEntity entity = LitJson.JsonMapper.ToObject <AccountEntity>(obj.Json);
         Debug.Log(entity.UserName);
     }
 }
    private void OnPostDataCallback(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            Debug.Log(args.ErrorMsg);
            return;
        }

        ReturnValue value = JsonMapper.ToObject <ReturnValue>(args.Value);

        Debug.Log(value.Value);
    }
Beispiel #23
0
    /// <summary>
    /// 请求比赛列表回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestBattleListCallBack(NetWorkHttp.CallBackArgs args)
    {
        m_isBusy = false;
        if (args.HasError)
        {
            ShowMessage("错误", args.ErrorMsg);
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("错误", args.Value.msg);
                return;
            }
            string json = args.Value.data.ToJson();
            List <MatchHTTPEntity> lst = null;
            if (!string.IsNullOrEmpty(json))
            {
                lst = LitJson.JsonMapper.ToObject <List <MatchHTTPEntity> >(json);
            }
            if (m_UIBattleView != null)
            {
                m_UIBattleView.SetUI(lst);
            }

            if (m_CurrentId != 0)
            {
                m_isRebuild = true;
                Debug.Log(m_CurrentId);
                for (int i = 0; i < lst.Count; ++i)
                {
                    if (m_CurrentId == lst[i].id)
                    {
                        m_CurrentSelectMatchEntity = lst[i];
                    }
                    Debug.Log(lst[i].id);
                }

                m_CurrentId = 0;
                if (m_CurrentRoomId == 0)
                {
                    if (NetWorkSocket.Instance.Connected(GameCtrl.Instance.SocketHandle))
                    {
                        NetWorkSocket.Instance.Close(GameCtrl.Instance.SocketHandle);
                    }
                    UIViewManager.Instance.ShowWait();
                    GameCtrl.Instance.SocketHandle = NetWorkSocket.Instance.BeginConnect(m_CurrentSelectMatchEntity.ipaddr, m_CurrentSelectMatchEntity.port, onConnectedCallBack);
                }
            }
        }
    }
Beispiel #24
0
    /// <summary>
    /// 微信支付订单回调
    /// </summary>
    /// <param name="args"></param>
    private void OnWXPayOrderCallBack(NetWorkHttp.CallBackArgs args)
    {
        m_isBusy = false;
        UIViewManager.Instance.CloseWait();
        if (args.HasError)
        {
            ShowMessage("错误", "网络连接失败");
            m_isHasOrder = false;
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("错误", args.Value.msg);
                m_isHasOrder = false;
                return;
            }
            string channel = m_Channel.ToString();

            if (SystemProxy.Instance.IsInstallWeChat && SystemProxy.Instance.IsOpenWXLogin)
            {
                channel = "1";
            }
            if (m_CurrentSelectChannel != 0)
            {
                channel = m_CurrentSelectChannel.ToString();
                m_CurrentSelectChannel = 0;
            }

#if UNITY_IPHONE
            if (GlobalInit.Instance.PaymentType == PaymentType.Official)
            {
                SDK.Instance.ApplePay(args.Value.data.ToJson(), channel);
            }
            else
            {
                if (SystemProxy.Instance.IsOpenWXLogin && SystemProxy.Instance.IsInstallWeChat)
                {
                    SDK.Instance.WXPay(args.Value.data.ToJson(), channel);
                }
                else
                {
                    SDK.Instance.ApplePay(args.Value.data.ToJson(), channel);
                }
            }
#else
            SDK.Instance.WXPay(args.Value.data.ToJson(), channel);
#endif
        }
    }
Beispiel #25
0
 /// <summary>
 /// 账号登录回调
 /// </summary>
 /// <param name="args"></param>
 private void OnLoginCallBack(NetWorkHttp.CallBackArgs args)
 {
     if (args.HasError)
     {
         LogSystem.LogError("网络炸了");
         return;
     }
     if (args.Value.code < 0)
     {
         LogSystem.LogError(args.Value.msg);
         return;
     }
     m_Account      = LitJson.JsonMapper.ToObject <AccountEntity>(LitJson.JsonMapper.ToJson(args.Value.data));
     m_SocketHandle = NetWorkSocket.Instance.BeginConnect("192.168.1.165", 8188, CallBack);
 }
Beispiel #26
0
 private void OnRequesRealNameConfigCallBack(NetWorkHttp.CallBackArgs args)
 {
     if (args.HasError)
     {
         ShowMessage("提示", "网络连接失败");
     }
     else
     {
         if (args.Value.code == 1)
         {
             ShowMessage("提示", args.Value.msg);
             return;
         }
         OpenRealNameView();
     }
 }
Beispiel #27
0
    /// <summary>
    /// 请求分享数据回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestShareCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败", MessageViewType.Ok);
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg, MessageViewType.Ok);
                return;
            }

            m_ListShare = LitJson.JsonMapper.ToObject <List <ShareEntity> >(args.Value.data.ToJson());
        }
    }
Beispiel #28
0
 /// <summary>
 /// 分享奖励回调
 /// </summary>
 /// <param name="args"></param>
 private void OnSharedRewardCallBack(NetWorkHttp.CallBackArgs args)
 {
     if (args.HasError)
     {
         ShowMessage("错误", "网络连接失败");
     }
     else
     {
         if (args.Value.code < 0)
         {
             ShowMessage("提示", args.ErrorMsg);
             return;
         }
         AccountProxy.Instance.SetCards(args.Value.data["cards"].ToString().ToInt());
         AccountProxy.Instance.CurrentAccountEntity.shared = true;
     }
 }
Beispiel #29
0
 /// <summary>
 /// 请求花费积分换取礼物相关相关回调
 /// </summary>
 /// <param name="args"></param>
 private void OnRequestSpendIntegralExchangeGiftlCallBack(NetWorkHttp.CallBackArgs args)
 {
     if (args.HasError)
     {
         ShowMessage("提示", "网络连接失败");
     }
     else
     {
         if (args.Value.code < 0)
         {
             ShowMessage("提示", args.Value.msg);
             return;
         }
         ShowMessage("", "兑换成功\n\n请在兑换记录中领取您的豪礼");
         RequestIntegralInfo();
     }
 }
Beispiel #30
0
    /// <summary>
    /// 游客登陆回调
    /// </summary>
    /// <param name="args"></param>
    private void OnGuestCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            LogSystem.LogError("网络炸了");
            return;
        }
        if (args.Value.code < 0)
        {
            LogSystem.LogError(args.Value.msg);
            return;
        }
        int    passportId = args.Value.data["passportId"].ToString().ToInt();
        string token      = args.Value.data["token"].ToString();

        AccountLogin(passportId, token);
    }