Master Server - 0 rooms for some players

I have this game: www.ball3d.com
It works fine for 99% of the players. But some players (I had about 20 complains about this over the last year), can’t see rooms on the list. They can create their own room and it will be on the list. They can ping the master server.

I have made a simplest possible example for them to test and they have the same problem: Steam Developer: Unusualsoft

One player from Uruguay told me, that he can see rooms only if it’s very early in the morning.

I am trying to get some log files from these players, but they are mostly young, so I haven’t succeed yet.

These players are from different parts of the world. Maybe it has something to do with high ping to the master server.

I think it’s nothing in the code, because it works for 99% of the players all the time. Anyway here is the code from the simple test.

If you have any ideas, please post :slight_smile:

#pragma strict

private var gameTypeName : String = "REMOVED";

private var masterEventCounter : int = 0;
private var roomCounter : int = 0;

function Start()
{
	MasterServer.ipAddress = "REMOVED";
	MasterServer.port = 23466;
	Network.natFacilitatorIP = "REMOVED";
	Network.natFacilitatorPort = 50005;
	
	
	ListRefresh();
	
}

function Update()
{
	 if (MasterServer.PollHostList().Length != 0)
	 {
            var hostData : HostData[] = MasterServer.PollHostList();
            for (var i : int = 0; i < hostData.Length; i++)
            {
            	roomCounter++;
            }
            MasterServer.ClearHostList();
     }
}

function OnGUI()
{
	GUI.Label(Rect(20, 20, 300, 300), "Counter: " + masterEventCounter);
	GUI.Label(Rect(20, 50, 300, 300), "Rooms: " + roomCounter);
}


function ListRefresh()
{
	MasterServer.RequestHostList(gameTypeName);
}

function OnMasterServerEvent(msEvent : MasterServerEvent)
{
	if (msEvent == MasterServerEvent.HostListReceived)
	{	
		masterEventCounter++;
	}
}

Maybe it has something to do with proxies. If the people that want to connect normally use a proxy to browse the web and stuff but Unity isn’t set to use a proxy, that could be messing up the connection.

OK so another player from my game has this problem. Here is what he told me:

Here is the log file he gave me:

Do you have any clues what can be wrong? And what is this mysterious “Line 2480”?

Also it’s probably important to notice, that this player can ping the master server normally. My guess is that it’s something in the router configuration, since he tried to connect on the same PC from different connection and it was working.

Also this player told me, that the game was working for him properly in February.
I am trying to get some more logs from him. Maybe it will help.

Do you know any other games made in Unity that are using the built-in master server? I would like this player to see if it’s the same in other games.

A few days ago some other player had similar issues. And many others in the past.

Is it possible that the master server is banning some players by IP or something?

I am in desperation. Another player has the same problem (it’s about 0.01% of all players, but still…).
I was able to make a test example and find out, that one of the players is getting NetworkConnectionError.ConnectionFailed error from this function:
function OnFailedToConnectToMasterServer(info : NetworkConnectionError)
The other one doesn’t have this error.

So my questions are:

  1. Is there anyone with any clues what can be wrong?
  2. Where can I find log files from the master server?
  3. Do you know any other Unity games that are using the built-in master server (I would like to ask these players if they have the same problem in other games)?
  4. Is it possible that they have been banned on the master server (I have restarted it, but maybe informations about bans are stored on the hard drive somewhere)? As far as I remember, master server is giving “temporary bans” (I have seen it a few times when testing my game).

Any help is much appreciated :slight_smile:

Maybe someone could show this topic to some person from Unity Team? Would be nice.

I wish I could help but I am just now compiling my first test version of the master server myself (on linux), however, I did want to ask if you had checked Sequence’s suggestion about the proxies? I know that 1st world nations are spoiled with the latest greatest internet, bandwidth, etc. However, Some countries and even small or private Internet Service Providers will use Proxies to restrict everything from bandwidth to porn/spam to government censored information. Proxies, while they have their place, can be a nasty thing for network programmer. Try finding out what companies these players connect to the internet with and see if those companies have or force proxies on their clients. If you have already researched that line, then at least I bumped this for you.

Thank you for your interest Welias. I forgot to answer to Sequence. I have asked these players about proxies, but they told me they are not using anything like that. Most of the players are not even able to tell me what connection are they using. Since they are from different countries, it’s even harder to make any research.

I don’t know. I can’t even find any log files on the master server. In the source code of the master server, there is something about writing logs to files. Maybe I have to enable this somehow, but I don’t know how.

The only positive thing about this is that it’s a small number of players who are experiencing this. But still would be great to figure this out, because every player matters.

If you are compiling the master server as we speak, you may find this post useful (or maybe not): http://forum.unity3d.com/threads/143307-Master-Server-Bug?p=982324&viewfull=1#post982324

Hmm weird things with logs from WebPlayer. Players only see logs if the game is running and after they close the game, the log file is not there anymore.

Anyway, one player who can’t see rooms on the list, was able to give me some new log:

I don’t get it. There should be something about master server connection or some error. Hmm…

This one line looks suspicious: PlayerConnection initialized network socket : 0.0.0.0 55005
But this port number is used by facilitator.

I will try to get some more log files.

This is from the source code of the master server:

I would restart your master server with -e2 option to get full debugging. However, if this is your live server, you may want to keep an eye on it as the performance could be hit hard with writing out such detailed logs and you may not want to leave it running for very long with the full logging on.

It would not hurt to check out the proxies code that Sequence mentions above, it is just as important to have your game prepared for proxy systems just as it is prepared for punching through NAT systems. And honestly this sounds like what may be happening. Of course without logs it is hard to tell. So, try to get detailed logs from your master server and see what it is pushing out to your clients. If all of your clients are getting the same information and you see nothing odd in the master server then it is most likely on the client’s end.

Keep in mind that one of the posts that you quoted from your players stated that he could use the system fine in February and at a friend’s house but any computer at his house (his internet connection) can not be used. And even the game player thinks it is something to do with his connection. So it sounds like someone is either trying to restrict port traffic in his house or at his internet service provider or he has some firewall issues or proxy issues. Either way, other than preparing your code base to better handle proxies, there is not much you can do for these players that have network problems in their own house.

Did you use your test code above and have this player connect? Was it the same problem? Was it the same port?

Good luck!

By the way, I checked out your game. Looks good, worked great for me. Tried it last night and today.

Thank you. I am actually afraid that this may have a bad impact on the performance. On top of that it might be very hard to find anything about these particular players. I have run the server without any parameters, and after this I saw a lot of informations printed on the screen. But I didn’t use “screen” command to run the masterserver and I have no idea if there is a way to see the output form the MasterServer after re-login. I just run it this way: ./MasterServer . I don’t know Linux too much. Maybe you could give me some advice if there is a way to see the output from the MasterServer after the logout?

Also if I didn’t use any parameters, is the debug level equal to 2 (Informational)? Maybe I should then run it with -e0 to gain some performance.

I think this may not have anything to do with bans after all, since one of these players told me that his IP is not constant, so he couldn’t be banned by IP.

Correct, I missed that, but yes, the server defaults to -e2 so -e0 would give you gain in performance. As for the log file, just use your FTP program and look around in the masterserver directory for “masterserver.log”, from what I can tell it looks like it should be in the root directory but I didn’t dig too deep into the raknet code to see if it may be writing it out to a log folder. If you can’t find “masterserver.log” in one of the directories in or above where the masterserver is located on your linux box then check /var/logs and see if you can find it in there.

OK Thx. I will try to find it tomorrow. Maybe this -e parameter only tells about debug level and printing informations on the screen. Maybe I have to also use -l parameter to write to the file?

Here is another log from a player:

I have restarted the MasterServer and used -e 0 parameter to see only errors. I can see the output until I logout from the server.

Turned out that I am getting some errors all the time:

Any clues?

Side question: My game is using port 37004, but many connections in the log has some other ports next to it. Does it mean that someone else is using my master server?

Is there anyone who use their own Unity Master Server and can tell me if you are getting the same error over and over again?

I only have a second to response (busy day)… Are the malformed packets associated with clients that are experiencing problems? Confirm by getting their ip or by modifying the log output of the master server to show more details associated with the IP address (unfortunately that would require a source code mod and a compile of the master server). However, if the ip addresses are not associated with the clients that are experiencing what are looking for then they are simply just lost packets. Keep in mind that most games (if designed right) will experience and compensate for malformed packets… that is why we select reliable and unreliable packets during game design. It could be simply that someone is attempting to use your master server too, in a world of hacking this would not surprise me at all. However, that is a different problem all together and is another reason to learn the master server more intimately (and possibly learn to mod the code).

As for the other errors, ,they are all related to some database call. These may have nothing to do with your issue unless you have done something unique in the master server code to modify the database portion of the server.

Good luck!

Thx for the answer.

I don’t know if these errors have anything to do with the problem I am trying to solve. But still I wanted to know if it’s something important.

I guess at some point I will have to add some additional protection to prevent others from using my server. Do you have any experience with that or anyone else here?

Anyway I have one last hope to get some new information about the problem. One player agreed to open the simple test example in the Unity Editor, maybe some useful error will show up. We will see.

OK so one player who can’t see rooms, was able to tried the test program from the Unity Editor. He changed the Debug Level to full and all he can see in the console is this: “Connected to master server at …”. But the list still has not been downloaded.

When he tried to connect to the default Unity Master Server it was all OK.

Summary:

  • He can’t see rooms in my game Ball 3D (www.ball3d.com).
  • Other people can see his room on the list (:eyes:'). Same goes for other players with this problem.
  • He can ping the master server.
  • He can see rooms from his computer but on different Internet connection.
  • He can’t see rooms from other computer on the same Internet connection.
  • His IP is not constant, so he is not banned by IP (he told me and I can see on the forum).
  • He says that he has windows firewall and turned it off.
  • Unity says that he is “connected to the master server”.
  • OnMasterServerEvent() is not being called.
  • OnFailedToConnectToMasterServer() is not being called either (for some other player with this problem this function was at least called).

Is there anyone who could turn this mess into some logic :)? Maybe someone with more knowledge could come up with some logical explanation.

I have found something new. It turns out that the room list is working for this player only if there are only few rooms on the list (I don’t know the exact number yet). If the number of rooms become higher he can’t see the list.

So this player can’t see rooms only if there are more than 6 rooms or something like that on the list.

I don’t know if what I will say makes any sense, but maybe the master server is trying to send the whole list in one packet and this packet is too big and some old router in the player’s network is dropping this packet or some other weird thing occurs. Is something like that possible?

Come on, there is a puzzle to solve :slight_smile: Who will solve it?

One month later I am still waiting for someone who could tell me what is wrong :slight_smile: Anyone?