Beispiel #1
0
        private void WorkStart()
        {
            ProcessHelper.ClearProcess();
            if (ConfigObject.Instance.ClearLogOnReboot)
            {
                ResetText(new List <LogTextManager.LogItem>());//清除所有log
            }

            var nowPath = System.IO.Directory.GetCurrentDirectory();

            System.IO.Directory.SetCurrentDirectory(@"C:\Work\development\install");
            Environment.SetEnvironmentVariable("PYTHONPATH", @"C:\Work\development\server");
            var oldPath = Environment.GetEnvironmentVariable("PATH");

            Environment.SetEnvironmentVariable("PATH", oldPath + @";C:\Work\development\server_build_run");

            ProcessHelper.StartProcess("python", LogShowDevice.CET, " -m switcher.switcherSrv 60000 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m room.rmSrv 60700 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m db.dbSrv 60200 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m login.loginSrv 60300 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m gateway.gatewaySrv 60400 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m logic.logicSrv 60500 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m team.teamSrv 60600 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m sync.syncSrv 60800 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m gmserver.gmSrv 60900 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m iplocation.ipLocationSrv 61000 &");
            ProcessHelper.StartProcess("python", LogShowDevice.ROL, " -m monitor.monitorSrv  60100 &");

            System.IO.Directory.SetCurrentDirectory(nowPath);
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (isOpen)
            {
                button1.Text = "关闭";
                isOpen       = false;

                LogTextManager.AppendTextHandle = AppendText;
                LogTextManager.ResetTextHandle  = ResetText;
                LogTextManager.RemoveTextHandle = RemoveText;

                startupThread = new Thread(WorkStart); //为了不阻塞主线程,启动一个线程来帮助
                startupThread.IsBackground = true;
                startupThread.Start();
            }
            else
            {
                button1.Text = "开启";
                isOpen       = true;

                ProcessHelper.ClearProcess();
            }
            fastRefreshTickCount = 100;//5秒的快速刷新时间
        }
Beispiel #3
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     ProcessHelper.ClearProcess();
 }