Is Masterserver/ Nat-punch Through No Longer Working?

Hi, I have an 2 year old p2p game which uses the old masterserver system. I believe it may be using the developer server to set up connections by mistake. (yes bad, but only about 3 people a day use it so it’s not that bad).

Since about February it is not working.

Does anyone know if something’s changed? I can still ping the masterserver at 67.225.180.24. But now I always get this function called:

void OnFailedToConnectToMasterServer(NetworkConnectionError info) {
Debug.Log("Could not connect to master server: " + info);
}

With message “67.225.180.24:50005 failed. Are you sure the server can be connected to?”

(Actually if I try: InitializeServer(32,1234,false); This seems to work. i.e. set false for “use nat punchthrough”. So does this mean nat-punch through is not working???).

So if it is not working my options are:

  1. Set up my own masterserver on another server.
  2. Convert the networking code to another API like Steam Networking
  3. Something else.

The game uses a lot of [RPC] calls. Will this only work with the old masterserver code? Or will this also work with, say, Steam networking code.

What do you think would be easier. Deploy my own master server using the files. (I don’t know Linux and I would have to compile them). Or convert everything to Steam Networking API.

Currently I think I would like to go with the Steam Networking API, but then would I have to change all the [RPC] calls?

Well, that networking system was deprecated a lot more than 2 years ago, and doesn’t even exist in current versions of Unity. The networking system which replaced it was itself deprecated a year ago. I’d be surprised if Unity was hosting any servers for it any longer.

The server code to set up your own is below. It says it is compatible with Unity 3.x, though the documentation for it appears to either have been moved or no longer exists.
https://unity3d.com/master-server

If you swap networking API’s you’ll have to replace all of your networking related code in your entire project, except for any high level functionality you have added which you may be able to graft onto the alternative API. So it depends on how much you have abstracted your networking from the rest of your game as to how much work you’re looking at.

Yeah, they keep changing it. :face_with_spiral_eyes:. 2 years isn’t long in the life of a game.

But anyway, what I’m doing is disabling the nat punch through. And then going to host my own master server maybe using one of the php implementations of it. Not sure if nat punch through is absolutely vital unless people are trying to play the game on a public wifi or something. I mean it’s better at least some people can play it than none at all.

If they do another networking API (I see UNet is deprecated too!) I hope they make it easy to set up your own server, by providing some compiled files and some instructions on how to set them up on typical hosting platforms like Windows Azure or AWS or other VPS services.

If I make another multiplayer game it will be with the Steam Networking API.

You may want to look in to Noble Connect which has punchthrough built in. The paid versions also come with Match Up which replaces the Master Server.

You could also give NAT Traversal a try if you just want punchthrough.

Thanks, but thinking about it, the amount of time taken to rewrite the game for this would probably not be worth it. (This game was made pre-uNet).

Since uNet doesn’t seem to have nat punchthrough built in, it leads me to think that maybe it is not as important as I thought it was. I wonder what percent of users can connect to online games without it? If it is over 90% I will live without it.

You missunderstand. UNET didn’t have it because UNET was never completed.

Without NAT Punchthrough, UPnP and Relaying. You will be looking at a VERY close to 0 success rate.

1 Like

Unet replaced nat punchthrough with a monetized relay service operated by Unity. Though the asset previously linked above adds the functionality. Unet is deprecated and should not be something you are considering moving your project to.

Ah, I see. Well I was able to connect two players together with the nat punchthrough turned off. Mind you, the two players were both on my computer! So maybe not the best test.

There is a option for “has public ip address” so presumably some people must have a public ip address. TBH I don’t really understand any of it. I might just have to just disable the multiplayer functionality. :frowning: I think my ability to set up the master server and nat punch though files on a reasonably cheap VPS is beyond my ability.

One question. Would the master server be running 24 hours a day? Or does it boot up when someone joins your game. In other words if I put masterserver on a VPS will I be charged for 24x365 hours per year?

Well I’ve gone with the 12 month free trial of Windows Azure. Chosen the Windows 10 Pro image. And the B1S burst size. So I’ll try and install it on this. No idea what I’m doing though! So any tips welcome.

This is about the only type of connection that will work. As soon as you start trying to connect two computers behind different routers you will see the issue.

Yeah, generally it would be running 24/7. It would be too slow to wait for a server to boot up each time it is needed. Master server functionality requires very few resources (cpu / ram / bandwidth) though so you wouldn’t need a very powerful server (if all it is doing is running the master server).

P.S. NAT Traversal can work with any peer-hosted networking system, including the pre-UNet unity networking. It takes a little more coding than using it with UNet would, but there is an example included that demonstrates the basic principles needed to perform punchthrough and port forwarding with any networking system. It doesn’t support mobile or webgl though.

Thanks. I have chosen the cheapest VM from Azure which is about 1 (virtual) CPU and 1GB ram. Hopefully that will be enough. It works out about $70 a year if on full time. Which is quite good I think. Although it does seem a bit sluggish.

Then I can connect to the VM with a remote desktop. It might be easier than I thought.

Next, I’m wondering if I run the masterserver/facilitator as normal programs or as services. It would be good to have them start up as the Windows instance starts. So if I reset the instance it will start all these programs.

I wonder how reliable these programs are or if they will crash a lot during the year.

I will try and get it all working tomorrow!