Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BaseLog log = new BaseLog("OfficialService");
     try
     {
         string result = "";
         int gameId;
         string gameParam = Request["gid"];
         if (!string.IsNullOrEmpty(gameParam) && int.TryParse(gameParam, out gameId))
         {
             result = DoComboWrite(gameId);
         }
         else
         {
             result = "FAILURE";
             log.SaveLog("OfficialService param error.");
         }
         Response.Write(result);
     }
     catch (Exception ex)
     {
         Response.Write("FAILURE");
         log.SaveLog(ex);
     }
 }
Exemplo n.º 2
0
        protected override void OnStartAffer()
        {
            //时间间隔更新库
            int     cacheInterval = 600;
            BaseLog log           = null;

            try
            {
                log = new BaseLog();
                GameEnvironment.ProductDesEnKey = "BF3856AD";
                GameEnvironment.ClientDesDeKey  = "SC3U9T8G";

                GameEnvironment.Start(cacheInterval, () =>
                {
                    SystemGlobal.Run();
                    PythonContext pythonContext;
                    PythonScriptManager.Current.TryLoadPython(@"Lib/action.py", out pythonContext);
                    RouteItem routeItem;
                    PythonScriptManager.Current.TryGetAction(1008, out routeItem);
                    return(true);
                });

                if (log != null)
                {
#if (DEBUG)
                    log.SaveLog(new Exception("系统正使用Debug版本"));
#else
                    log.SaveLog("系统正使用Release版本");
#endif
                }
            }
            catch (Exception ex)
            {
                if (log != null)
                {
                    log.SaveLog(ex);
                }
            }
        }
Exemplo n.º 3
0
 public static UserPlotPackage Get(string userId)
 {
     if (string.IsNullOrEmpty(userId))
     {
         throw new ArgumentNullException("UserID为空");
     }
     var cacheSet = new GameDataCacheSet<UserPlotPackage>();
     var data = cacheSet.FindKey(userId);
     if (data != null)
     {
         return data;
     }
     BaseLog log = new BaseLog();
     log.SaveLog(new NullReferenceException(string.Format("User:{0} UserPlot package is null.", userId)));
     return null;
 }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpResponse response = HttpContext.Current.Response;
            response.Charset = "unicode";// "unicode";
            HttpGet httpGet = new HttpGet(HttpContext.Current.Request);
            IGameResponse gameResponse = new HttpGameResponse(response);
            String ActionID = string.Empty;
            if (httpGet.GetString("ActionID", ref ActionID))
            {
                try
                {
                    string actionName = string.Concat("Action", ActionID);
                    string sname = string.Concat("ZyGames.DirCenter.Action." + actionName);
                    object[] args = new object[1];
                    args[0] = response;

                    BaseStruct obj = (BaseStruct) Activator.CreateInstance(Type.GetType(sname), new object[] { httpGet });
                    obj.DoInit();
                    if (obj.ReadUrlElement() && obj.DoAction() && !obj.GetError())
                    {
                        obj.BuildPacket();
                        obj.WriteAction(gameResponse);
                    }
                    else
                    {
                        obj.WriteErrorAction(gameResponse);
                        return;
                    }
                }
                catch (Exception ex)
                {
                    BaseLog oBaseLog = new BaseLog("DirCenterErrMain");
                    oBaseLog.SaveLog(ex);
                }
            }
        }
Exemplo n.º 5
0
        protected override void OnStartAffer()
        {
            //时间间隔更新库
            int cacheInterval = 600;
            BaseLog log = null;
            try
            {
                GameEnvironment.ClientDesDeKey = "j6=9=1ac";
                log = new BaseLog();
                var assembly = Assembly.Load("ZyGames.Doudizhu.Model");
                GameEnvironment.Start(cacheInterval, () =>
                {
                    ScriptEngines.AddReferencedAssembly(new string[] {
                        "ZyGames.Doudizhu.Lang.dll",
                        "ZyGames.Doudizhu.Model.dll",
                        "ZyGames.Doudizhu.Bll.dll"
                    });
                    ActionFactory.SetActionIgnoreAuthorize(1012, 9001, 9203);

                    AppstoreClientManager.Current.InitConfig();
                    LoadUnlineUser();
                    InitRanking();

                    ////todo 广播
                    //var list = new ShareCacheStruct<GameNotice>().FindAll(
                    //    s => (s.IsBroadcast &&
                    //            (s.ExpiryDate <= MathUtils.SqlMinDate) ||
                    //                (s.ExpiryDate > MathUtils.SqlMinDate && s.ExpiryDate >= DateTime.Now))
                    //          );
                    //foreach (var notice in list)
                    //{
                    //    DdzBroadcastService.Send(notice.Content);
                    //}
                    return true;
                }, 600, assembly);

                //HttpGet httpGet = new HttpGet("d=", "11", "127.0.0.1");
                //var script = (CSharpFileInfo)ScriptEngines.LoadScript("action1004.cs");
                //var scriptType = script.Assembly.GetType("ZyGames.Doudizhu.Script.Action.Action1004", false, true);
                //if (scriptType.CreateInstance<BaseStruct>(httpGet) == null)
                //{

                //}
                //todo test
                //CacheFactory.RemoveToDatabase("ZyGames.Doudizhu.Model.UserNickName_1380003");
                //UserNickName u = new ShareCacheStruct<UserNickName>().FindKey(1380003);
                //if (u == null)
                //{

                //}
            }
            catch (Exception ex)
            {
                if (log != null)
                {
                    log.SaveLog(ex);
                }
            }
        }
Exemplo n.º 6
0
        protected override void OnStartAffer()
        {
            //时间间隔更新库
            int cacheInterval = 600;
            BaseLog log = null;
            try
            {
                GameEnvironment.ClientDesDeKey = "j6=9=1ac";
                log = new BaseLog();
                var assembly = Assembly.Load("ZyGames.Doudizhu.Model");
                GameEnvironment.Start(cacheInterval, () =>
                {
                    PythonContext pythonContext;
                    PythonScriptManager.Current.TryLoadPython(@"Lib/action.py", out pythonContext);
                    PythonScriptManager.Current.TryLoadPython(@"Lib/lang.py", out pythonContext);
                    PythonScriptManager.Current.TryLoadPython(@"Logic/cardAILogic.py", out pythonContext);

                    AppstoreClientManager.Current.InitConfig();
                    RouteItem routeItem;
                    PythonScriptManager.Current.TryGetAction(1008, out routeItem);
                    PythonScriptManager.Current.TryGetAction(9202, out routeItem);
                    LoadUnlineUser();
                    InitRanking();

                    ////todo 广播
                    //var list = new ShareCacheStruct<GameNotice>().FindAll(
                    //    s => (s.IsBroadcast &&
                    //            (s.ExpiryDate <= MathUtils.SqlMinDate) ||
                    //                (s.ExpiryDate > MathUtils.SqlMinDate && s.ExpiryDate >= DateTime.Now))
                    //          );
                    //foreach (var notice in list)
                    //{
                    //    DdzBroadcastService.Send(notice.Content);
                    //}
                    return true;
                }, 600, assembly);

                //todo test
                //CacheFactory.RemoveToDatabase("ZyGames.Doudizhu.Model.UserNickName_1380003");
                //UserNickName u = new ShareCacheStruct<UserNickName>().FindKey(1380003);
                //if (u == null)
                //{

                //}
            }
            catch (Exception ex)
            {
                if (log != null)
                {
                    log.SaveLog(ex);
                }
            }
        }
Exemplo n.º 7
0
        protected override void OnStartAffer()
        {
            //时间间隔更新库
            int cacheInterval = 600;
            BaseLog log = null;
            try
            {
                log = new BaseLog();
                GameEnvironment.ProductDesEnKey = "BF3856AD";
                GameEnvironment.ClientDesDeKey = "SC3U9T8G";

                GameEnvironment.Start(cacheInterval, () =>
                {
                    SystemGlobal.Run();
                    PythonContext pythonContext;
                    PythonScriptManager.Current.TryLoadPython(@"Lib/action.py", out pythonContext);
                    RouteItem routeItem;
                    PythonScriptManager.Current.TryGetAction(1008, out routeItem);
                    return true;
                });

                if (log != null)
                {
            #if(DEBUG)
                    log.SaveLog(new Exception("系统正使用Debug版本"));
            #else
                    log.SaveLog("系统正使用Release版本");
            #endif
                }
            }
            catch (Exception ex)
            {
                if (log != null)
                {
                    log.SaveLog(ex);
                }
            }
        }
Exemplo n.º 8
0
        protected override void OnStartAffer()
        {
            //时间间隔更新库
            int cacheInterval = 600;
            BaseLog log = null;
            try
            {
                log = new BaseLog();
                var assembly = Assembly.Load("ZyGames.Doudizhu.Model");
                GameEnvironment.Start(cacheInterval, () =>
                {
                    PythonContext pythonContext;
                    PythonScriptManager.Current.TryLoadPython(@"Lib/action.py", out pythonContext);
                    AppstoreClientManager.Current.InitConfig();
                    //RouteItem routeItem;
                    //PythonScriptManager.Current.TryGetAction(1008, out routeItem);
                    LoadUnlineUser();
                    InitRanking();

                    ////todo 广播
                    //var list = new ShareCacheStruct<GameNotice>().FindAll(
                    //    s => (s.IsBroadcast &&
                    //            (s.ExpiryDate <= MathUtils.SqlMinDate) ||
                    //                (s.ExpiryDate > MathUtils.SqlMinDate && s.ExpiryDate >= DateTime.Now))
                    //          );
                    //foreach (var notice in list)
                    //{
                    //    DdzBroadcastService.Send(notice.Content);
                    //}
                    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);
                }
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="identityID">标识ID</param>
        /// <param name="providerType">数据驱动连接提供者类型</param>
        /// <param name="connectingStr"></param>
        /// <param name="aCommandType"></param>
        /// <param name="aCommandText"></param>
        /// <param name="aParamters"></param>
        public void SendSqlCmd(int identityID, string providerType, string connectingStr, CommandType aCommandType, String aCommandText, DbParameter[] aParamters)
        {
            try
            {
                if (System.Threading.Monitor.TryEnter(SourceText.StLockMsmq, 3000))
                {

                    try
                    {
                        this.msmqCmd = MSMQCmd.SendSQLCmd;
                        this.oSqlMessageQueue = new SqlMessageQueue();
                        this.oSqlMessageQueue.CreateBody(identityID, providerType, connectingStr, aCommandType, aCommandText, aParamters);
                        this.SendMessage(MSMQCmd.SendSQLCmd, this.oSqlMessageQueue);
                    }
                    finally
                    {
                        System.Threading.Monitor.Exit(SourceText.StLockMsmq);
                    }
                }
                else
                {
                    throw new Exception("SendTimeOut");
                }
            }
            catch (Exception ex)
            {
                BaseLog baselog = new BaseLog("ActionMsmq");
                baselog.SaveLog(aCommandText, ex);
            }
        }