Beispiel #1
0
        static void Main(string[] args)
        {
            LogManager.inst.Init();
            PathExt.InitPath();

            AssemblyParser.AssemblyParse(PathExt.codePath);
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            PathExt.InitPath();
            TestXml();

            string str = "";

            if (string.IsNullOrWhiteSpace(str))
            {
                Console.WriteLine("{0}", str);
            }

            Console.ReadKey();
        }
Beispiel #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            LogManager.inst.Init(this);

            PathExt.InitPath();
            InitXml();
            LoadXml();
            if (bIsAssembly)
            {
                if (ParseInit())
                {
                    msgApi = new AssemblyProtoMsg();
                }
            }
            else
            {
                msgApi = new ProtoMsg();
            }
            if (msgApi == null)
            {
                Log.ErrorLine("msgApi is null");
                return;
            }
            msgApi.BindMsgId();
            msgApi.BindParser();
            Connect();

            AssemblyHandler handler;
            AssemblyResult  result;

            AssemblyParser.GetAsseblyResult(out handler, out result);
            if (result == null)
            {
                Log.ErrorLine("AssemblyResult is null");
            }
            foreach (var item in result.ClassList)
            {
                if (item.Value.Contains("Message") && item.Key.Contains("MSG_CG"))
                {
                    AssemblyClassInfo classInfo = handler.GetClassInfo(ConstData.ClientMsgDll, item.Value);
                    list.Add(classInfo.ClassName, classInfo);
                    comboBox2.Items.Add(classInfo.ClassName);
                }
            }
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                Id = int.Parse(args[0]);
            }
            LogManager.inst.Init(Id);
            PathExt.InitPath();
            TimeManager.inst.Init();
            InitXml();
            ConsoleInputHandler.inst.Init();
            CryptoManage.inst.Init();
            MovePatchManager.inst.Init();
            ProtocolGroupManager.inst.Init();
            ClientManager.inst.Init(Id);

            new Thread(ConsoleInputHandler.inst.Run).Start();
            Console.WriteLine("Ready to work ...");

            FrameManager fps = new FrameManager();

            fps.Init();
            fps.SetFPS(50);
            while (bWorked)
            {
                fps.SetFrameBegin();
                ClientManager.inst.Update();
                TimeManager.inst.RefreshTime();
                if (fps.GetFPSAndCpuInfo() != null && fps.GetFPSAndCpuInfo().fps < 10)
                {
                    if ((FrameManager.Now - FrameManager.FlagStartTime).TotalSeconds > 1)
                    {
                        Log.Error("fps warning!");
                    }
                }
                fps.SetFrameEnd();
            }
        }
 /// <summary>
 /// 初始化路径
 /// </summary>
 private void InitPath()
 {
     PathExt.InitPath();
     Log.Info("InitPath successed");
 }