[problem or doubt]Nostale Laucher

09/13/2017 23:01 MANUEL PERES#1
Hello epvp I wanted to know how it will be to make a laucher detect if the server is off on the ports and ip thanks:handsdown::handsdown:
09/13/2017 23:12 0Lucifer0#2
a simple telnet or tcp connection from your launcher on the server.
09/14/2017 23:45 MANUEL PERES#3
Quote:
Originally Posted by 0Lucifer0 View Post
a simple telnet or tcp connection from your launcher on the server.
THANKS IT'S WORKING :D

Code:
private void Button4_Click(object sender, EventArgs e)
		{
			TcpClient tcpClient = new TcpClient();
			TcpClient tcpClient2 = new TcpClient();
			try
			{
				tcpClient.Connect("127.0.0.1", 6005);
			}
			catch (Exception expr_21)
			{
				ProjectData.SetProjectError(expr_21);
				this.Label3.Text = "OFFLINE";
				this.Label3.ForeColor = Color.Red;
				this.Button1.Enabled = false;
				ProjectData.ClearProjectError();
			}
			try
			{
				tcpClient2.Connect("127.0.0.1", 3825);
			}
			catch (Exception expr_74)
			{
				ProjectData.SetProjectError(expr_74);
				this.Label4.Text = "OFFLINE";
				this.Label4.ForeColor = Color.Red;
				this.Button1.Enabled = false;
				ProjectData.ClearProjectError();
			}
			bool connected = tcpClient.Connected;
			if (connected)
			{
				this.Label3.ForeColor = Color.Green;
				this.Label3.Text = "ONLINE";
				this.Button1.Enabled = true;
				tcpClient.Close();
			}
			connected = tcpClient2.Connected;
			if (connected)
			{
				this.Label4.ForeColor = Color.Green;
				this.Label4.Text = "ONLINE";
				this.Button1.Enabled = true;
				tcpClient2.Close();
			}
		}