示例#1
0
        static void Main(string[] args)
        {
            Console.Title = CenterServerConfig.Configuration.ServerName;

            ResourceUtil.ExtractResourceSafe("LogConfig.xml", "LogConfig.xml", Assembly.GetAssembly(typeof(ResourceUtil)));

            //ServerUtil.DisabledCloseBtn();

            CommandMgr.Instance.SearchCommand(Assembly.GetAssembly(typeof(AssemblyHelper)));

            log.Info("指令系统初始化成功!!!");

            string[] list = CenterServerConfig.Configuration.StartupCmds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);


            foreach (string cmd in list)
            {
                if (CommandMgr.Instance.ExecuteCommand(cmd) == false)
                {
                    ServerUtil.PressKeyExit();
                    return;
                }
            }

            ServerUtil.ReceiveCmdEvent += new ServerUtil.CmdHandler(ServerUtil_ReceiveCmdEvent);

            Thread.Sleep(3000);

            Console.WriteLine("{0}启动成功!!!\r\n", CenterServerConfig.Configuration.ServerName);

            ServerUtil.WaitingCmd(CenterServerConfig.Configuration.ServerName);
        }
示例#2
0
        static void Main(string[] args)
        {
            ResourceUtil.ExtractResourceSafe("LogConfig.xml", "LogConfig.xml", Assembly.GetAssembly(typeof(ResourceUtil)));

            //Console.Write(WinServiceConfig.WinConfig.ControlPort);

            Console.ReadKey();
        }
示例#3
0
        public void Startup()
        {
            //禁用关闭按钮
            ServerUtil.DisabledCloseBtn();

            //SerializationUtil.Save(new ModuleInfo { ID="Module1", File="Command.dll", CLS="CommandModule", Startup=false}, "module.mod");

            //导出日志配置文件
            ResourceUtil.ExtractResourceSafe("LogConfig.xml", "LogConfig.xml", Assembly.GetAssembly(typeof(JLauncher)));

            //启动模块环境
            ModuleStartup.Startup();

            //注册应用程序关闭系统钩子
            AppUtil.AddApplicationExitHandler(ServerExitHandler);

            //挂起线程
            ServerUtil.WaitingCmd("JTest");
        }
示例#4
0
 static void ExportResources()
 {
     log.Info("Exporting resources...");
     ResourceUtil.ExtractResourceSafe("LogConfig.xml", "LogConfig.xml", Assembly.GetAssembly(typeof(CoreStartup)));
 }