コード例 #1
0
        private void RegisterUser(string wxopenid, string wxNickName, string clientIP, string userName, string nickName, string password, string alipayAccount, string alipayRealName, string IDCardNo, string email, string qq)
        {
            //invitationCode = Session["ic"] as string;
            string invitationCode = "";

            int result = WcfClient.Instance.RegisterUserFromWeiXin(wxopenid, wxNickName, clientIP, userName, nickName, password, alipayAccount, alipayRealName, IDCardNo, email, qq, invitationCode);

            if (result == OperResult.RESULTCODE_TRUE)
            {
                var player = WcfClient.Instance.GetPlayerByWeiXinOpenID(wxopenid);
                if (player != null)
                {
                    WebUserInfo userinfo = new WebUserInfo();
                    userinfo.xlUserID   = player.SimpleInfo.UserID;
                    userinfo.xlUserName = player.SimpleInfo.UserName;
                    userinfo.wxOpenID   = wxopenid;
                    // 登录状态100分钟内有效
                    MyFormsPrincipal <WebUserInfo> .SignIn(userinfo.xlUserName, userinfo, 100);

                    Session[userinfo.xlUserName] = player;
                }

                Response.Redirect("View/Index.aspx");
                //Response.Write("<script>alert('恭喜您成功加入灵币矿场!');this.location.href='View/Index.aspx';</script>");
            }
            else
            {
                Response.Write("<script>alert('注册失败, 原因为:" + OperResult.GetMsg(result) + "')</script>");
            }
        }
コード例 #2
0
        void Client_DeleteAwardItemCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("删除幸运大转盘奖项时,服务器返回异常。异常信息:" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("删除成功");
                    this.AsyncGetAllAwardItems();
                }
                else
                {
                    MyMessageBox.ShowInfo("删除奖项失败,可能是奖励被使用。" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("删除幸运大转盘奖项时,返回后处理异常。异常信息:" + exc.Message);
            }
        }
コード例 #3
0
        void Client_UpdateDiamondShoppingItemCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("保存钻石商品失败。原因为:" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("保存钻石商品成功");
                    _syn.Post((o) =>
                    {
                        this.Close();
                    }, null);
                }
                else
                {
                    MyMessageBox.ShowInfo("保存钻石商品失败。原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("保存钻石商品异常。原因为:" + exc.Message);
            }
        }
コード例 #4
0
        void Client_UpdateAwardItemCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("修改奖项服务器返回异常。异常信息为:" + e.Error);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("修改奖项成功");
                    this.IsOK = true;
                    this.Close();
                }
                else
                {
                    MyMessageBox.ShowInfo("修改奖项失败,原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("修改奖项回调处理异常。异常信息为:" + exc.Message);
            }
        }
コード例 #5
0
        void Client_PayWithdrawRMBRecordCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Cancelled)
                {
                    return;
                }

                if (e.Error != null)
                {
                    MessageBox.Show("操作失败,服务器返回异常,信息为:" + e.Error);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    IsOK = true;
                    MessageBox.Show("操作成功。");
                    _syn.Post(o =>
                    {
                        this.Close();
                    }, null);
                }
                else
                {
                    MessageBox.Show("操作失败。原因:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show("操作异常。原因:" + exc.Message);
            }
        }
コード例 #6
0
        void Client_CancelSellStoneCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Cancelled)
                {
                    return;
                }

                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("连接服务器失败。");
                    LogHelper.Instance.AddErrorLog("Client_LockSellStoneCompleted Exception。", e.Error);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("订单取消成功");
                }
                else
                {
                    MyMessageBox.ShowInfo("订单取消失败,原因:" + OperResult.GetMsg(e.Result));
                }

                App.UserVMObject.AsyncGetPlayerInfo();
                AsyncGetAllNotFinishedSellOrders();
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("服务器连接失败。");
                LogHelper.Instance.AddErrorLog("服务器连接失败。", exc);
            }
        }
コード例 #7
0
 void Client_FeedSlaveCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
 {
     try
     {
         App.BusyToken.CloseBusyWindow();
         if (e.Error != null)
         {
             MyMessageBox.ShowInfo("投喂苦力异常。原因为:" + e.Error.Message);
             return;
         }
         if (e.Result == OperResult.RESULTCODE_TRUE)
         {
             MyMessageBox.ShowInfo("投喂苦力成功");
             this.AsyncGetPlayerFactoryAccountInfo();
         }
         else
         {
             MyMessageBox.ShowInfo("投喂苦力失败。原因为:" + OperResult.GetMsg(e.Result));
         }
     }
     catch (Exception exc)
     {
         MyMessageBox.ShowInfo("投喂苦力返回处理异常。原因为:" + exc.Message);
     }
 }
コード例 #8
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var xlUserName = context.User.Identity.Name;

            if (string.IsNullOrEmpty(xlUserName) && context.Session == null)
            {
                context.Response.Write("登录失败");
                return;
            }

            //按服务器计算的临时产出收取
            var result = WcfClient.Instance.GatherStones(xlUserName, 10);

            if (result == null)
            {
                context.Response.Write("服务器连接失败");
                return;
            }

            if (result.OperResult == OperResult.RESULTCODE_TRUE)
            {
                context.Response.Write("OK," + result.GatherStoneCount);
            }
            else
            {
                string messag = OperResult.GetMsg(result.OperResult);
                context.Response.Write(messag);
            }
        }
コード例 #9
0
        void Client_TakeRouletteAwardCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                GlobalData.Client.TakeRouletteAwardCompleted -= Client_TakeRouletteAwardCompleted;
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("领取奖品服务器操作异常,请联系管理员领取。给您带来不便,敬请谅解。");
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("已经提交到服务器,管理员正在为您支付,请稍候。");
                    this.IsOK = true;
                    this.Close();
                }
                else
                {
                    MyMessageBox.ShowInfo("领取奖品失败。原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
            }
        }
コード例 #10
0
        void Client_HandlePlayerRemoteServiceCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                GlobalData.Client.HandlePlayerRemoteServiceCompleted -= Client_HandlePlayerRemoteServiceCompleted;
                App.BusyToken.CloseBusyWindow();

                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("提交玩家远程服务处理信息失败,服务器返回异常。异常信息为:" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("提交玩家远程服务处理信息成功");
                    this.Close();
                }
                else
                {
                    MyMessageBox.ShowInfo("提交玩家远程服务处理信息失败。错误信息为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("提交玩家远程服务处理信息失败,服务器回调异常。信息为:" + exc.Message);
            }
        }
コード例 #11
0
        void Client_StartRouletteCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <MetaData.Game.Roulette.RouletteWinAwardResult> e)
        {
            try
            {
                if (e.Error != null || e.Result == null)
                {
                    MyMessageBox.ShowInfo("连接服务器失败。");
                    return;
                }
                if (e.Result.OperResultCode != OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo(OperResult.GetMsg(e.Result.OperResultCode) + ", 无法抽奖。");
                    return;
                }

                this._winedAwardItemID = e.Result.WinAwardItemID;

                _startIndex          = new Random(1).Next(0, 11);
                _endIndex            = FindAwardIDIndex(e.Result.WinAwardItemID);
                _endTickIndex        = 4 * 12 + _endIndex;
                _downSpeedStartIndex = 3 * 12 + _endIndex;

                //MessageBox.Show(App.GameRouletteVMObject.ListAwardItems[e.Result.WinAwardItemIndex].AwardName);
                CreateRouletteThread();
            }
            catch (Exception exc)
            {
                this.btnStart.IsEnabled = true;
                MyMessageBox.ShowInfo(exc.Message);
            }
        }
コード例 #12
0
        ///// <summary>
        ///// 用于获取上一次登录时没有处理完的游戏
        ///// </summary>
        ///// <param name="roundInfo"></param>
        //void Client_OnPlayerJoinRaiderSucceed(MetaData.Game.RaideroftheLostArk.RaiderRoundMetaDataInfo roundInfo)
        //{
        //    this.CurrentRaiderRound.ParentObject = roundInfo;
        //    AsyncGetSelfCurrentRoundBetInfos();
        //}

        void Client_JoinRaiderCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    LogHelper.Instance.AddErrorLog("Client_JoinRaiderCompleted Server Return Exception", e.Error);
                    MyMessageBox.ShowInfo("下注夺宝奇兵服务器返回失败,原因为:" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("下注成功,请等待开奖");
                    AsyncGetSelfCurrentRoundBetInfos();
                    App.UserVMObject.AsyncGetPlayerInfo();
                }
                else if (e.Result == OperResult.RESULTCODE_GAME_RAIDER_WAITINGSECONDPLAYERJOIN_TOSTART)
                {
                    MyMessageBox.ShowInfo("下注成功," + OperResult.GetMsg(e.Result));
                    AsyncGetSelfCurrentRoundBetInfos();
                    App.UserVMObject.AsyncGetPlayerInfo();
                }
                else
                {
                    MyMessageBox.ShowInfo("下注失败,原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                LogHelper.Instance.AddErrorLog("Client_GetCurrentRaiderRoundInfoCompleted Exception", exc);
            }
        }
コード例 #13
0
        void Client_SetPlayerAsAgentCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Cancelled)
                {
                    return;
                }

                if (e.Error != null)
                {
                    MessageBox.Show("设置玩家为代理服务器操作异常。信息为:" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("设置玩家为代理成功。");
                    ISOK = true;
                }
                else
                {
                    MyMessageBox.ShowInfo("设置玩家为代理失败。原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("获取玩家信息,服务器回调异常。信息为:" + exc.Message);
            }
        }
コード例 #14
0
        void Client_ChangePlayerSimpleInfoCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Cancelled)
                {
                    return;
                }

                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("修改失败。原因为:" + e.Error);
                    return;
                }
                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("修改成功。");

                    App.UserVMObject.AsyncGetPlayerInfo();
                }
                else
                {
                    MyMessageBox.ShowInfo("修改失败。原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
            }
        }
コード例 #15
0
 void Client_AddStoneToFactoryCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
 {
     try
     {
         App.BusyToken.CloseBusyWindow();
         if (e.Error != null)
         {
             MyMessageBox.ShowInfo("向工厂中添加矿石异常。原因为:" + e.Error.Message);
             return;
         }
         if (e.Result == OperResult.RESULTCODE_TRUE)
         {
             MyMessageBox.ShowInfo("成功向工厂添加矿石");
             this.AsyncGetPlayerFactoryAccountInfo();
             App.UserVMObject.AsyncGetPlayerInfo();
         }
         else
         {
             MyMessageBox.ShowInfo("向工厂中添加矿石失败。原因为:" + OperResult.GetMsg(e.Result));
         }
     }
     catch (Exception exc)
     {
         MyMessageBox.ShowInfo("向工厂中添加矿石返回处理异常。原因为:" + exc.Message);
     }
 }
コード例 #16
0
        void Client_GambleStoneBetInCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <GambleStonePlayerBetInResult> e)
        {
            try
            {
                //App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("疯狂猜石下注失败。服务器返回错误。");
                    LogHelper.Instance.AddErrorLog("疯狂猜石下注失败。服务器返回错误。", e.Error);
                    return;
                }
                if (e.Result == null)
                {
                    MyMessageBox.ShowInfo("疯狂猜石下注失败。");
                    return;
                }
                if (e.Result.ResultCode != OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("赌石娱乐下注失败。原因为:" + OperResult.GetMsg(e.Result.ResultCode));
                    return;
                }

                this.CurrentInningPlayerBetRecord.ParentObject = e.Result.PlayerBetRecord;
                App.UserVMObject.AsyncGetPlayerInfo();
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("疯狂猜石下注失败。回调处理异常");
                LogHelper.Instance.AddErrorLog("疯狂猜石下注失败。回调处理异常。", exc);
            }
        }
コード例 #17
0
        void Client_RejectExceptionStoneOrderCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MessageBox.Show("拒绝矿石订单申诉失败。" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    _syn.Post(o =>
                    {
                        MessageBox.Show("拒绝矿石订单申诉成功。");
                        this.DialogResult = true;
                    }, null);
                }
                else
                {
                    MessageBox.Show("拒绝矿石订单申诉失败。原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show("拒绝矿石订单申诉回调操作异常。原因为:" + exc.Message);
            }
        }
コード例 #18
0
ファイル: Register.aspx.cs プロジェクト: sycomix/SuperMiners
        private void RegisterUser(string clientIP, string userLoginName, string nickName, string password, string alipayAccount, string alipayRealName, string IDCardNo, string email, string qq)
        {
            invitationCode = Session["ic"] as string;

            int result = WcfClient.Instance.RegisterUser(clientIP, userLoginName, nickName, password, alipayAccount, alipayRealName, IDCardNo, email, qq, invitationCode);

            if (result != OperResult.RESULTCODE_TRUE)
            {
                Response.Write("<script>alert('注册失败, 原因为:" + OperResult.GetMsg(result) + "')</script>");
                return;
            }

            var resultObj = WcfClient.Instance.Login(clientIP, userLoginName, password);

            if (resultObj.OperResultCode != OperResult.RESULTCODE_TRUE)
            {
                Response.Write("<script>alert('注册成功,但登录失败, 原因为:" + OperResult.GetMsg(resultObj.OperResultCode) + "')</script>");
                return;
            }

            string message = "";
            bool   isOK    = Controller.GetPlayerInfo(resultObj.Message, userLoginName, clientIP, Context, out message);

            if (!isOK)
            {
                Response.Write("<script>alert('" + message + "')</script>");
            }
            else
            {
                Response.Redirect("Index.aspx", false);
            }
        }
コード例 #19
0
        void Client_ChangePlayerCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Cancelled)
                {
                    return;
                }

                if (e.Error != null)
                {
                    MessageBox.Show("保存玩家信息服务器返回失败,错误信息为:" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MessageBox.Show("保存玩家信息成功。");
                }
                else
                {
                    MessageBox.Show("保存玩家信息失败。" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
            }
        }
コード例 #20
0
        void Client_PayAwardCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("提交幸运大转盘中奖支付,服务器返回异常。异常信息:" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("幸运大转盘中奖支付成功");
                    _syn.Post(o =>
                    {
                        this.DialogResult = true;
                    }, null);
                }
                else
                {
                    MyMessageBox.ShowInfo("幸运大转盘中奖支付失败,原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("提交幸运大转盘中奖支付,返回后处理异常。异常信息:" + exc.Message);
            }
        }
コード例 #21
0
        void Client_RejectExceptionStoneOrderCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            App.BusyToken.CloseBusyWindow();
            if (e.Cancelled)
            {
                return;
            }

            if (e.Error != null)
            {
                MessageBox.Show("操作失败。");
                return;
            }

            if (e.Result == OperResult.RESULTCODE_TRUE)
            {
                MessageBox.Show("操作成功。");
                _syn.Post(o =>
                {
                    this.DialogResult = true;
                }, null);
            }
            else
            {
                MessageBox.Show("操作失败。原因:" + OperResult.GetMsg(e.Result));
            }
        }
コード例 #22
0
        void Client_UpdateVirtualShoppingItemCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MessageBox.Show("修改虚拟商品失败。" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MessageBox.Show("虚拟商品修改成功。");
                    this._syn.Post((o) =>
                    {
                        this.Close();
                    }, null);
                }
                else
                {
                    MessageBox.Show("修改虚拟商品失败。原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show("修改虚拟商品回调处理异常。" + exc.Message);
            }
        }
コード例 #23
0
        void Client_DelegateSellStoneCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            App.BusyToken.CloseBusyWindow();
            if (e.Cancelled)
            {
                return;
            }

            if (e.Error != null)
            {
                MyMessageBox.ShowInfo("挂单出售矿石失败。");
                return;
            }
            if (e.Result != OperResult.RESULTCODE_TRUE)
            {
                MyMessageBox.ShowInfo("挂单出售矿石失败。原因为:" + OperResult.GetMsg(e.Result));
                return;
            }

            MyMessageBox.ShowInfo("挂单出售矿石成功。");
            App.UserVMObject.AsyncGetPlayerInfo();
            App.StackStoneVMObject.AsyncGetAllNotFinishedSellOrders();

            this._syn.Post((o) =>
            {
                this.Close();
            }, null);
        }
コード例 #24
0
        void Client_BuyDiamondShoppingItemCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MessageBox.Show("购买商品失败。" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MessageBox.Show("购买商品成功");
                    App.UserVMObject.AsyncGetPlayerInfo();
                }
                else
                {
                    MessageBox.Show("购买商品失败,原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show("购买商品失败,回调处理异常。" + exc.Message);
            }
        }
コード例 #25
0
        void Client_AdminSetStoneFactoryProfitRateCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("保存工厂昨日收益失败。原因为:" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("保存成功");
                    this.Close();
                }
                else
                {
                    MyMessageBox.ShowInfo("保存失败,原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("保存工厂昨日收益返回处理异常1。原因为:" + exc.Message);
            }
        }
コード例 #26
0
        void Client_MakeAVowToGodCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <MakeAVowToGodResult> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("神灵许愿失败。" + e.Error.Message);
                    return;
                }

                if (e.Result != null && e.Result.OperResultCode == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("许愿显灵,获取" + e.Result.GravelResult + "碎片");
                    this.AsyncGetPlayerInfo();
                }
                else
                {
                    MyMessageBox.ShowInfo("神灵许愿失败,原因为:" + OperResult.GetMsg(e.Result.OperResultCode));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("神灵许愿失败。原因为:" + exc.Message);
            }
        }
コード例 #27
0
        void Client_DeleteAddressCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("删除地址失败。" + e.Error.Message);
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("删除地址成功");
                    this.AsyncGetPostAddressList();
                }
                else
                {
                    MyMessageBox.ShowInfo("删除地址失败。原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("删除地址失败。信息为:" + exc.Message);
            }
        }
コード例 #28
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var    xlUserName      = context.User.Identity.Name;
            object objParam_number = context.Request["number"];
            int    number;

            if (objParam_number == null)
            {
                context.Response.Write("没有输入数值");
                return;
            }

            number = Convert.ToInt32(objParam_number);
            if (string.IsNullOrEmpty(xlUserName) && context.Session == null)
            {
                context.Response.Write("登录失败");
                return;
            }

            var result = WcfClient.Instance.SellStones(xlUserName, number);

            if (result == OperResult.RESULTCODE_TRUE)
            {
                context.Response.Write("OK");
            }
            else
            {
                context.Response.Write(OperResult.GetMsg(result));
            }
        }
コード例 #29
0
        void Client_CancelDelegateBuyStoneCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    LogHelper.Instance.AddErrorLog("Client_CancelDelegateBuyStoneCompleted server return Exception", e.Error);
                    MyMessageBox.ShowInfo("取消委托买单操作,服务返回异常");
                    return;
                }

                if (e.Result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("取消委托买单成功。");
                    AsyncGetAllNotFinishedBuyOrders();
                    App.UserVMObject.AsyncGetPlayerInfo();
                }
                else
                {
                    MyMessageBox.ShowInfo("取消委托买单失败。原因为:" + OperResult.GetMsg(e.Result));
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("取消委托买单操作,处理异常");
                LogHelper.Instance.AddErrorLog("Client_CancelDelegateBuyStoneCompleted Exception", exc);
            }
        }
コード例 #30
0
        void Client_GoldCoinRechargeCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <MetaData.Trade.TradeOperResult> e)
        {
            try
            {
                if (e.Cancelled)
                {
                    return;
                }

                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("访问服务器失败。");
                    return;
                }

                TradeOperResult result = e.Result;
                if (result.ResultCode != OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("金币充值失败。原因:" + OperResult.GetMsg(result.ResultCode));
                    return;
                }
                if (result.PayType == (int)PayType.Alipay)
                {
                    MyWebPage.ShowMyWebPage(result.AlipayLink);
                    MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");

                    if (!AlipayPaySucceed)
                    {
                        var payResult = MyMessageBox.ShowAlipayPayQuestion();
                        if (payResult == MessageBoxAlipayPayQuestionResult.Succeed)
                        {
                            if (!AlipayPaySucceed)
                            {
                                MyMessageBox.ShowInfo("没有接收到支付宝付款信息。如确实付款,请稍后查看购买记录,或联系客服。");
                            }
                        }
                        else if (payResult == MessageBoxAlipayPayQuestionResult.Failed)
                        {
                            MyWebPage.ShowMyWebPage(result.AlipayLink);
                            MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");
                            return;
                        }
                    }
                }

                App.UserVMObject.AsyncGetPlayerInfo();
                _syn.Post(p =>
                {
                    //this.DialogResult = true;
                    this.Close();
                }, null);
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("充值金币,服务器回调处理异常。" + exc.Message);
            }
        }