Here are the 2 files needed to make this work for 3.x of Unity, you will need Visual Studio 2003 or above to build up the Master server code that you can obtain from Unity, this header file and cpp file is designed to allow you to run the master server and facilitator from one executable and have nat punch through that works natively. Second file is the compiled version, the Deploy folder contains the masterserver service along with a readme file, in that file it explains where to put the masterserver folder, what to run at the command line and where to run it. This will add the masterserver as a service on your windows server and then you can open up services and set the service to start up automatically. Since Unity does not change the packet descriptors except from major version to major version, this should be good for all 3.x releases.
The ports that I have in the compiled version are 25000 for the master and 25001 for the facilitator. You can use the M2H tutorials to connect up to your master server and host your games through it. Don’t worry about using the connection testers, they seem to be funky. I am the point of contact for this code, so any problems or concerns, questions etc, direct them to me, not Unity.
im facing the same issue, have followed all the instructions on the “Deploy.zip” file and everything is ok, but when i try to connect from unity it says Failed to connect to master server at xxx.xxx.xxx.xxx:25000
ok just a quick update… i finish the visual studio express 2008 c++ installation, just open the unity masterserver project and click build.
took some time but at the end got my masterserver.exe just perfect.
now, i tried with this one and voila! unity just connected and worked like a charm!
now, i realize that masterserver.exe is a 1.3mb file so im not sure about this one here in this post… but in the other hand, the unity one keeps a console window open, so you can check the connections status there, and this one generate a .txt file, so i dont know if thats the reason of the diference of filesize, however, just wanted to let you know guys that all you gotta do is install visual studio express c++ 2008 wich is free from microsoft and the download is like 200mb and build the master server files from unity page and you will get your masterserver.exe file.
The problem isn’t that I can’t build my own master server. The problem is I can’t build my own master server that runs as a service. I have the unity master server and facilitator running fine. I don’t have them combined as one, and running as a service… But, with software I found via Google, I was able to get them both running as services anyways. So in the end I am fine. But it would still be nice to have this source code work.
i see… well i havent been able to get them run as service aswell… i think ill have to keep those windows open and keep an eye on them… keep restarting those applications every… i dont know… 5 days?
Killer1390… one question… i have the facilitator and the master server running ok in the server, as separated processes windows… but i still not able to connect through internet in my multiplayer game…
checked ports and ips and are ok… im wondering… check this posted by leegod:
MasterServer.ipAddress = “127.0.0.1”; MasterServer.port = 23466; Network.natFacilitatorIP = “127.0.0.1”; Network.natFacilitatorPort = 50005; // your own port number
do you know what he meant with " your own port number" ? is that maybe i have to use the facilator port “50005” as the one to connect in the server port?
Hi zyndro. Since you built your own master server and facilitator, you are able to edit the C++ source code. In the code, you can change the port the master server, and facilitator connects to. Make sure they match what you code.
yes and i did it, the weird thing is i can see the server hosted game created, but i still get a different port number, so i cant join the match…
im so confused… i have facilator and masterserver apps workiing on the server, both report connections when i host games, but when i try to join i get a totally different port…
When someone hosts a game, they should be able to chose their own port for hosting. That doesn’t have much to do with the master server except that the master server contains the information on that. When you have a facilitator up and running, it doesn’t matter whether or not the port is forwarded, because it does… some sort of magic… and lets you connect through the router or what ever.
So, I guess what I am trying to say, is what exactly is the problem?
i host a game with out problems.
from the client through internet i can see the game created without problems, the problem is, the port is different so that avoid me stablish connection.
for example.
i create a game and my ip is 10.0.0.15:25005
when i search games with a client, i see hosted game created 10.0.0.15:46372 ( or some randome port ) so, i cant connect.
this happens only through internet, on wifi works ok.
as far as i know this happens because of a nat problem, and for that is the facilitator… but some how i dont know why mine is not working.
that was exactly what happened with the master server from unity, i was testing there and all was ok… suddendly one day the port just was different and i wasnt able to connect anymore to my hosted games.
dreamora said that could be because people was using the unity masterserver for production, and that is not the intention, so they turned off the facilitator, so the people cant connect anymore through internet.
i hope i have had explained myself, english is not my mother language!
thanks in advance!