Exemplo n.º 1
0
 //事件-服务器回显消息通知
 void Server_serverMessage(object sender, Event.MCSEvent e)
 {
     if (textBox_serverInfo.InvokeRequired)
     {
         Invoke(new MCServer_API.serverEventHandler(Server_serverMessage), new object[] { sender, e });
     }
     else
     {
         if (textBox_serverInfo.Text.Length >= 30000)
         {
             textBox_serverInfo.Text = "";
         }
         textBox_serverInfo.Text           = textBox_serverInfo.Text + e.cmd + "\r\n";
         textBox_serverInfo.SelectionStart = textBox_serverInfo.Text.Length - 1;
         textBox_serverInfo.ScrollToCaret();
     }
 }
Exemplo n.º 2
0
 //事件-服务器被关闭
 void Server_serverStop(object sender, Event.MCSEvent e)
 {
     button_serverRun.Invoke(new MCServer_API.opEventHandler(safe_opButton), new object[] { button_serverRun, true });
     button_serverStop.Invoke(new MCServer_API.opEventHandler(safe_opButton), new object[] { button_serverStop, false });
     button_serverRest.Invoke(new MCServer_API.opEventHandler(safe_opButton), new object[] { button_serverRest, false });
     if (e != null)
     {
         if (e.exitCode == 0)
         {
             Server_serverMessage(null, new Event.MCSEvent("[提示]服务器已正常关闭", 0));
         }
         else
         {
             Server_serverMessage(null, new Event.MCSEvent("[提示]服务器已被强制关闭或崩溃", 0));
         }
         logs.Log_write(e.exitCode.ToString());
     }
 }
Exemplo n.º 3
0
 //事件-服务器重启完毕
 void Server_serverRestart(object sender, Event.MCSEvent e)
 {
     button_serverRun.Invoke(new MCServer_API.opEventHandler(safe_opButton), new object[] { button_serverRun, false });
     button_serverStop.Invoke(new MCServer_API.opEventHandler(safe_opButton), new object[] { button_serverStop, true });
     button_serverRest.Invoke(new MCServer_API.opEventHandler(safe_opButton), new object[] { button_serverRest, true });
 }