[Tutorial] Hosting your own masterserver

Hello people from Unity3D!
I have seen that many people are having trouble with setting up their own masterserver!
So this is a tutorial i made special for you guys!

Okay, first we need the masterserver software.
I already compiled it and i will be updating it!
So just download this:

And extract everything in a folder.

Now open: start facilitator.bat
And if everything goes well you will see this line at the top of the command window:
Sent 4 bytes to port 50005

Now open: start masterserver.bat
And again you must see this at the top of the command window:
Sent 4 bytes to port 23466

You can choose to portforward them but i can’t give a tutorial for that…
Becouse every router is different!

Ok now open your script where the server browser is and add:

MasterServer.ipAddress = "your ip";
MasterServer.port = port masterserver;
Network.natFacilitatorIP = "your ip";
Network.natFacilitatorPort = port facilitator;

And you are done! Congrats! You are now hosting your own masterserver. That wasn’t so hard wasn’t it?

1 Like

Thank you for putting this together.

I’ll try to fix it myself but just so you know, when I first start up start facilitator.bat I get a System Error asking for a file called MSVCR100D.dll.

Yes! It worked. Piece of cake. Thank you so much!

Nice to hear it works :slight_smile:

Alguien que hable español me podría explicar que tengo que hacer??

subo los archivos al host o que hago?

And plz test port forwarding for them also. Because on my router I have some problems with forwarding the ports to my local ip. The router is ok and ports are shown in forwarded list, but In action the external game can not connect! And besides I used telnet command to connect to these ports. And the result was negative. I’m afraid if something’s wrong!

Port forwarding often doesn’t work for internally-sourced packets, i.e. packets from your LAN addressed to your router’s external IP address enter the router through the wrong port and don’t go through the same forwarding rules.

The facilitator is also not going to work properly behind a NAT, at least not if one of the devices trying to connect is behind the same NAT. It needs to be out in the cloud, where it can get a proper unbiased view of each client trying to connect.

gfoot, you’re gr8! After hours of trying hard to make it work, now you’re saying it wont work:o
I think you’re right anyway but It’s so pity then.

//Edited:
So what if I use 127.0.0.1 within my local connection (for starting the server) and then on the published version on the web site I use My public IP? In this situation and with Port forwarding it might work?

Within your LAN, use your LAN address to access it, and you’ll be able to connect to other devices on your LAN. From outside your LAN, use your public IP address and port forwarding rules, and you’ll be able to connect to other devices outside your LAN. But it’s unlikely that anything will let you connect a device inside your LAN to a device outside your LAN.

LAN. :smile:

That’s all I saw from that entire post :stuck_out_tongue:

Anyways good tutorial! (I wish I’d have seen this before I went through hours staring at the computer screen like an idiot :slight_smile: )

If you use 127.0.0.1 then you won’t be able to connect with other machines, even on your LAN. It would be fine for local testing though, with multiple clients all running on one PC.

If you have other devices on your LAN that you want to connect then you need to refer to the facilitator using its LAN address, which will start with 10, 172, or 192. So long as you do that, devices on your LAN will be able to talk to each other.

1 Like

which IP should I use?
the IP from www.whatismyip.com???
the IP from www.whatismyip.com is good?

Thanks , it is awesome ! :slight_smile:

Has anyone ever found a solution to this problem reported by JohnyZuper?
I am facing the same. I guess this is because I haven’t compiled the server on my own machine, and that there’s some mismatch between my environment and the one it was compiled on.

According to this thread, it seems to me like it could either be caused by the way it has been compiled, or by the Visual C++ 2010 SP1 Redistributable Package missing locally on my side.

I have already made sure that the latter is properly installed (both for x64 and x86), but to no outcome (still the same error).

Anything else I am missing?
Anyone else still having that problem?

He fixed the problem himself; I’m sure if you PM him the fix he will be happy to assist.

I already did so, but he hasn’t replied. Don’t want to to be too impatient though - it’s just 3 days ago :wink:
I only hope that he’s not gone for good. So I’d still be happy to learn whether anyone else has faced this problem.

Hi! I fix the problem with MSVCR100D.dll downloading this file and put it into Debug folder of Facilitator. You can find this file on google.

Thanks!

1 Like

Excellent, thanks for the reply, DjEmix!
I’ll give this a try asap. Might take me a couple of weeks, though, because I am currently absorbed by other issues related to my game.
But I’ll post the result here.

Well, I did as DjEmix recommended, and I got it running indeed!
Nice to know, thanks for the hint!!

Anyway, to anyone interested - according to the following MSDN thread, this issue might be caused by the way the MasterServer has been compiled (though I am not sure whether it re).
As I understand it, it should be compiled in “Release Mode” and not in “Debug Mode”. Otherwise it would be necessary to distribute some dll files (likes the missing one) along with the application, but this is against Microsoft’s License Agreement:
http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/73921400-35e5-4f10-9632-16da98d7f165

Apart from that, I still understand why installing the C++ redistributable package (as described) didn’t help in my case. The thread linked above is a bit confusing to me… :frowning:

How can i use this for mobile devices…??