Can only ping the MasterServer after pinging it externally using command prompt, at the same time.

Been trying to get master server code working for some time now. Thought a straight up copy from the example would get things running. The example was working fine, but after changing the game name and some other minor parameters it no longer functions correctly.

It won’t even return a ping from the master server ip. We tried pinging the ip from command prompt and it was successful. Then I tried pinging the server from prompt, and quickly tried from within the game again, this caused the game to start pinging the master server successfully!

I have no clue what’s going on. :frowning:

Has anyone had any good luck with setting up some master server networking?

I use Photon for networking, so I’m not too familiar w/ Unity’s built in. But you say you can get it to work by pinging from command prompt first? Sounds like a firewall or router issue, but you could always use System.Diagnostics as a workaround and have Unity open command prompt w/ ping arguments, then place the code to actually connect to the masterserver after pinging w/ cmd. This would pretty much do what you’re already doing, but it would happen automatically. Hope this helps at least until you can connect without pinging first :slight_smile: Here is a simple example of how to do this in C#

using UnityEngine;
using System.Collections;
using System.Diagnostics;

public class PingTest : MonoBehaviour 
{
	string fileName = "cmd.exe";
	string arguments = "/c ping localhost"; //replace localhost with masterserver ip.
	ProcessStartInfo cmdping;
	
	void Awake()
	{
		cmdping = new ProcessStartInfo(fileName, arguments); 
		Process.Start(cmdping);
		//Put your code for connecting from within unity here, after the cmd opens and pings. 
	}
}