private void ServerExited(object sender, EventArgs e) { DateTime datTimeStamp = DateTime.Now; Database.AddLog(datTimeStamp, "Server Exited", "server", "warn", false, this.ServerID); this.Running = false; Util.RemovePID(this.PID); //Close firewall if (Database.GetSetting("EnableOpenFirewall", "YAMS") == "true") { Networking.CloseFirewallPort(this.Port); } if (Database.GetSetting("EnablePortForwarding", "YAMS") == "true") { Networking.CloseUPnP(this.Port); } //Server has stopped, so clear out any entries in the user list this.Players.Clear(); //Did the server stop safely? if (!this.SafeStop) { System.Threading.Thread.Sleep(10000); this.Start(); } }
public static void Stop() { //Close firewall ports and forward via UPnP Networking.CloseFirewallPort(Convert.ToInt32(YAMS.Database.GetSetting("AdminListenPort", "YAMS"))); Networking.CloseFirewallPort(Convert.ToInt32(YAMS.Database.GetSetting("PublicListenPort", "YAMS"))); Networking.CloseUPnP(Convert.ToInt32(YAMS.Database.GetSetting("AdminListenPort", "YAMS"))); Networking.CloseUPnP(Convert.ToInt32(YAMS.Database.GetSetting("PublicListenPort", "YAMS"))); adminServerThread.Abort(); publicServerThread.Abort(); }
public static void Stop() { //Close firewall ports and forward via UPnP if (Database.GetSetting("EnableOpenFirewall", "YAMS") == "true") { Networking.CloseFirewallPort(Convert.ToInt32(YAMS.Database.GetSetting("AdminListenPort", "YAMS"))); Networking.CloseFirewallPort(Convert.ToInt32(YAMS.Database.GetSetting("PublicListenPort", "YAMS"))); } if (Database.GetSetting("EnablePortForwarding", "YAMS") == "true") { Networking.CloseUPnP(Convert.ToInt32(YAMS.Database.GetSetting("AdminListenPort", "YAMS"))); Networking.CloseUPnP(Convert.ToInt32(YAMS.Database.GetSetting("PublicListenPort", "YAMS"))); } adminServerThread.Abort(); }
public static void Stop() { stoppingServer = true; listenThread.Abort(); tcpListener.Stop(); //Close firewall ports and forward via UPnP if (Database.GetSetting("EnableOpenFirewall", "YAMS") == "true") { Networking.CloseFirewallPort(Convert.ToInt32(YAMS.Database.GetSetting("TelnetPort", "YAMS"))); } if (Database.GetSetting("EnablePortForwarding", "YAMS") == "true") { Networking.CloseUPnP(Convert.ToInt32(YAMS.Database.GetSetting("TelnetPort", "YAMS"))); } }
private void ServerExited(object sender, EventArgs e) { DateTime datTimeStamp = DateTime.Now; Database.AddLog(datTimeStamp, "Server Exited", "server", "warn", false, this.ServerID); this.Running = false; Util.RemovePID(this.PID); //Close firewall if (Database.GetSetting("EnableOpenFirewall", "YAMS") == "true") { Networking.CloseFirewallPort(this.Port); } if (Database.GetSetting("EnablePortForwarding", "YAMS") == "true") { Networking.CloseUPnP(this.Port); } //Server has stopped, so clear out any entries in the user list this.Players.Clear(); //Did the server stop safely? if (!this.SafeStop) { System.Threading.Thread.Sleep(10000); if (this.AgreeEULA) { //It's the EULA message, let's clear it. string strPathToRead = this.ServerDirectory + @"\eula.txt"; IniParser parser = new IniParser(strPathToRead); parser.AddSetting("ROOT", "eula", "true"); parser.SaveSettings(this.ServerDirectory + @"\eula.txt", "#Minecraft EULA file\r\n#Generated by YAMS " + DateTime.Now.ToString() + "\r\n"); } this.Start(); } }
public static void Stop() { //Kill all the clients foreach (TelnetClient client in lstClients) { client.Stop(); } stoppingServer = true; listenThread.Abort(); tcpListener.Stop(); //Close firewall ports and forward via UPnP if (Database.GetSetting("EnableOpenFirewall", "YAMS") == "true") { Networking.CloseFirewallPort(Convert.ToInt32(YAMS.Database.GetSetting("TelnetPort", "YAMS"))); } if (Database.GetSetting("EnablePortForwarding", "YAMS") == "true") { Networking.CloseUPnP(Convert.ToInt32(YAMS.Database.GetSetting("TelnetPort", "YAMS"))); } Running = false; }