Beispiel #1
0
        private static bool GetPayment(int game, int server, string account, string userID)
        {
            try
            {
                GameUser userInfo = new PersonalCacheStruct <GameUser>().FindKey(userID);
                if (userInfo == null)
                {
                    return(false);
                }
                var         chatService = new TjxChatService();
                OrderInfo[] model       = PayManager.getPayment(game, server, account);
                foreach (OrderInfo order in model)
                {
                    userInfo.PayGold = MathUtils.Addition(userInfo.PayGold, order.GameCoins, int.MaxValue);
                    //userInfo.Update();
                    PayManager.Abnormal(order.OrderNO);

                    DialHelper.ReturnRatioGold(userID, order.GameCoins);  //大转盘抽奖奖励充值返还
                    chatService.SystemSendWhisper(userInfo, string.Format(LanguageManager.GetLang().PaySuccessMsg, order.GameCoins));

                    DoGiff(userID, order);
                    FestivalHelper.GetPayReward(userInfo, order.GameCoins, FestivalType.PayReward);
                }
                return(true);
            }
            catch (Exception ex)
            {
                BaseLog log = new BaseLog("PaymentLog");
                log.SaveLog(ex);
                return(false);
            }
        }
Beispiel #2
0
        protected void Application_Start(object sender, EventArgs e)
        {
            BaseLog log = null;
            try
            {
                GameEnvironment.ClientDesDeKey = "j6=9=1ac";
                log = new BaseLog();
                int cacheInterval = 600;
                var assembly = Assembly.Load("ZyGames.Tianjiexing.Model");
                GameEnvironment.Start(cacheInterval, () =>
                {
                    SystemGlobal.Run();
                    log.SaveLog(PythonScriptManager.Current.PythonRootPath);
                    PythonContext pythonContext;
                    PythonScriptManager.Current.TryLoadPython(@"Lib/action.py", out pythonContext);
                    RouteItem routeItem;
                    PythonScriptManager.Current.TryGetAction(1008, out routeItem);
                    return true;
                }, 600, assembly);

                if (log != null)
                {
            #if(DEBUG)
                    log.SaveLog(new Exception("系统正使用Debug版本"));
            #else
                    log.SaveLog("系统正使用Release版本");
            #endif
                }
            }
            catch (Exception ex)
            {
                if (log != null)
                {
                    log.SaveLog(ex);
                }
            }
        }
Beispiel #3
0
        private static bool GetPayment(int game, int server, string account, string userID)
        {
            try
            {
                GameUser userInfo = new GameDataCacheSet<GameUser>().FindKey(userID);
                if (userInfo == null) return false;
                var chatService = new TjxChatService();
                OrderInfo[] model = PayManager.getPayment(game, server, account);
                foreach (OrderInfo order in model)
                {
                    userInfo.PayGold = MathUtils.Addition(userInfo.PayGold, order.GameCoins, int.MaxValue);
                    //userInfo.Update();
                    PayManager.Abnormal(order.OrderNO);

                    DialHelper.ReturnRatioGold(userID, order.GameCoins);  //大转盘抽奖奖励充值返还
                    chatService.SystemSendWhisper(userInfo, string.Format(LanguageManager.GetLang().PaySuccessMsg, order.GameCoins));

                    DoGiff(userID, order);
                    FestivalHelper.GetPayReward(userInfo, order.GameCoins, FestivalType.PayReward);
                }
                return true;
            }
            catch (Exception ex)
            {
                BaseLog log = new BaseLog("PaymentLog");
                log.SaveLog(ex);
                return false;
            }
        }