Game Development Community

The master server

by Arko · in Torque 3D Beginner · 12/21/2012 (12:23 am) · 13 replies

Looking through the documentation, I'm not sure how this works.

My game works well on lan, I'd like to make a master server that anyone with the client can use.

I'd like to hire a server for a month and run the master server on it so the clients can connect to it.

Anyone know how to go about this in the simplest way? Thanks

#1
12/21/2012 (6:29 am)
Have a look at this C# master server resource, or you can try the version from Altered Reality Software, but they charge $50 for theirs after a 30 day trial.

Or you can search the site - there are a few other resources out there. The "master server" is just a match-making service. You can write one using PHP and drop it on just about any web server - there are some examples here on the site if you search around a bit.
#2
12/26/2012 (9:15 pm)
Thanks for that, I've had a look- I'm wondering is there an alternative to the master server that still lets people play online?

Is there a way to make it so that any client can "host" a game, and all the other clients can see that game and connect to it?

When I try this, the game never shows up.. It only works on LAN, but not on 2 seperate computers trying to play together online.

Also, is the Garage Games test master server still running? Is there a page with a tutorial on how to set this up? Thanks

#3
12/27/2012 (8:47 am)
The GG master server has been MIA for a little while.

Here is a link to a c# master server I am using to test my game with.

C# master server

#4
12/27/2012 (10:30 am)
Our master server should still be up though it may have gone down over the break, but know that it is intended for testing purposes only. It can go down with no notice at any time and never return or take some time before it comes back up.
#5
12/27/2012 (10:42 am)
If you're on a LAN clients will just be able to see your host. Across the internet this is not as easy - you can directly connect to an address, but the master server's purpose is to marshal servers that are available so that clients can find them on the internet (basically just a directory service).

The thing about connecting directly to an address on the internet is that it might not be (and most probably is not) the actual address of the computer hosting the game - it's most likely the address of a router behind which the host resides. So that router needs to have the game ports forwarded to the host so that you can connect through it.

So, all of the master server solutions presented above are viable options - you have to ensure that your network is set up to allow access to your master server once you have it running. You can run it any time you like from your own home if you desire - as long as you're set up for it. You can even run it on the same computer you're running your host on.

Also, in this thread I posted my own method for directly connecting to another address. Remember to make a back-up of your current art/gui/joinServerDlg.gui file before making this change. If all of your network settings are correct this will (mostly) work - please read the notes I posted in that thread.
#6
12/27/2012 (11:38 am)
I think the the whole master server implementation needs a rethink.

I think a php/asp master server that could be accessed by the HTTPObject may be more indie friendly.

A formatted query incorporated into the url, something like

http://masterserver.garagegames.com:80/Query.php?Region=2&MaxPlayers=64&Version=1.2&game=mygame

and then the results can be parsed by the engine to populate the server list.
This has the benefit of being able to be deployed on any hosting service that supports php/asp and databases like Godaddy and the like.

Just a thought.
#7
12/28/2012 (12:04 pm)
One could always use my Resource.. ;)

http://www.garagegames.com/community/resources/view/21921

That should have what you're looking for.
#8
01/02/2013 (5:10 pm)
In T3D 1.2 Commercial I found that at line 831 in source/app/net/serverQuery.cpp the system is using $pref::Net::RegionMask for the region, but the prefs files all set $pref::Server::RegionMask. So no servers will match your selected region unless you're setting it to 0....

Still digging through this - since I'm looking at this from work I think our firewall is probably preventing me from connecting to myself through the address provided by the master server I have set up at home. I'll try it from home (where I know I have ports forwarded to myself) and see how that goes. Hopefully the discrepancy noted above is the cause of all of this irritation. I don't know when that sneaked in though.
#9
01/02/2013 (6:18 pm)
That seems to have done something promising - now if I can just fix the rest of my project....
#10
01/02/2013 (8:53 pm)
on my script:
"$Pref::Server::RegionMask = 2;"

if master server was On then i was getting info request but if i try with a client from same pc it never got a list from master server.

do u think it was for setting "$Pref::Server::RegionMask" to a non zero value?
or for not using a router?
is there anyway to not to use a router?
#11
01/03/2013 (8:49 am)
What I was getting at is that the script value we're setting is "$pref::Server::RegionMask" and the source is actually looking for "$pref::Net::RegionMask" - so it doesn't matter what you set $pref::Server::RegionMask to, it is never looked at by the engine.

Two solutions - in script set $pref::Net::RegionMask to your desired region, or change the source to look for $pref::Server::RegionMask and recompile.
#12
01/03/2013 (11:42 am)
richard,
thanks to point on that.

"$pref::Net::RegionMask=0;" did the trick.
i hosted a game. got info request from master server.
then started a client from same pc.
and for the 1st time it shows me now.

and it found my hosted game from same pc.
#13
01/03/2013 (11:51 am)
i am getting 2 sever ip from master server.

Quote:
Requesting the server list from master server IP:209.90.70.74:28002 (2 tries left)...
Received server list packet 1 of 1 from the master server (2 servers).
Pinging Server IP:58.97.224.54:28000 (3)...
Pinging Server IP:50.112.216.154:28000 (3)...

1st one my ip.
and it failed to connect for timed out.my net connection very unstable.
so is there any console function/value to change timeout value on server?


2nd IP Issue:
Quote:
Querying Server IP:50.112.216.154:28000 (3)...
ServerQuery: query Querying servers: 0 left... 1
Server IP:50.112.216.154:28000 filtered out by player count.

what means player count? is that the value " $Server::PlayerCount" from createServer()?
if yes,then how i can pass this check?


[edit]
i tried to connect on 2nd server by "connect("50.112.216.154:28000");"
but it shows:
"Connection error. Please try another server. Error code: (CHR_GAME)".

may be game name is not same.