Making a master server?
by Dreamer · in Torque Game Engine · 06/20/2004 (11:24 pm) · 21 replies
Hello, we got a great deal on a nice server, we have dowloaded and compiled TGE, as dedicated and have it running with the standard command line options.
We have then edited the scripts included in the CVS for starter.fps, to look to our server as the master server.
When we compile and run a client under windows, then go to Join Server and click the "Query Master" button. We get an error of "No master server found"
We thought at first that this may be a firewall issue, so we completely disabled the firewalls on both the client and the server. However the issue is still there.
We have tried using both ports 28000 and 28002, in the defaults.cs file
Here is what we are getting from console output...
*** Load Main Menu
ServerQuery: start Querying master server 0
No master servers found in this region, trying IP:69.60.111.194:28000.
Requesting the server list from master server IP:69.60.111.194:28000 (2 tries left)...
Requesting the server list from master server IP:69.60.111.194:28000 (1 tries left)...
ServerQuery: update Retrying the master server... 0
Requesting the server list from master server IP:69.60.111.194:28000 (0 tries left)...
ServerQuery: update Retrying the master server... 0
Server list request to IP:69.60.111.194:28000 timed out.
There are no more master servers to try!
ServerQuery: done No master servers found. 0
Here is the exact command used to launch the server, note that we renamed torquedemod_DEBUG to server.bin
./server.bin -dedicated -mission starter.fps/data/missions/stronghold.mis
Is there something we are missing? And why wouldn't the server respond to queries?
We have then edited the scripts included in the CVS for starter.fps, to look to our server as the master server.
When we compile and run a client under windows, then go to Join Server and click the "Query Master" button. We get an error of "No master server found"
We thought at first that this may be a firewall issue, so we completely disabled the firewalls on both the client and the server. However the issue is still there.
We have tried using both ports 28000 and 28002, in the defaults.cs file
Here is what we are getting from console output...
*** Load Main Menu
ServerQuery: start Querying master server 0
No master servers found in this region, trying IP:69.60.111.194:28000.
Requesting the server list from master server IP:69.60.111.194:28000 (2 tries left)...
Requesting the server list from master server IP:69.60.111.194:28000 (1 tries left)...
ServerQuery: update Retrying the master server... 0
Requesting the server list from master server IP:69.60.111.194:28000 (0 tries left)...
ServerQuery: update Retrying the master server... 0
Server list request to IP:69.60.111.194:28000 timed out.
There are no more master servers to try!
ServerQuery: done No master servers found. 0
Here is the exact command used to launch the server, note that we renamed torquedemod_DEBUG to server.bin
./server.bin -dedicated -mission starter.fps/data/missions/stronghold.mis
Is there something we are missing? And why wouldn't the server respond to queries?
#2
06/21/2004 (8:55 am)
I assume that TGE comes with source for a master server, but I can't find it... ?
#3
There is also one at www.opentnl.org, as part of the sample apps. It's not Torque compatible, though it is a lot nicer than what Torque supports.
06/21/2004 (10:11 am)
TGE doesn't come with the source. There is source available for third party implementations, though. One such is at www.pblabs.com/download.php. There are others.There is also one at www.opentnl.org, as part of the sample apps. It's not Torque compatible, though it is a lot nicer than what Torque supports.
#4
06/21/2004 (10:37 am)
Ben: is everyone allowed to use the GG master servers then? I could imagine that GG would find it less cool if a lot of games that are not published by GG use the GG master servers and thus cost GG money (because a server costs resources).
#5
Here is what I need to do.
We have right now a single server, we have the option to buy as many as we want at an extremely reasonable price.
I need the client to connect directly to a server, load a zone and go into multiplayer mode.
I would very much like for all of my dedicated servers to be able to talk to one another, or at least obtain information from a single centralized point, something like this.
Say I have a game with 3 missions, I place mission A on master.mydomain.com, mission b on slave1.mydomain.com, mission c on slave2.mydomain.com
How do I get the client to connect first to master.mydomain.com and enter multiplayer mode, then after something has been achieved, say a trigger has been set, have it connect to slave1.mydomain.com or slave2.mydomain.com, depeding on the results of the trigger?
Or lets make this question even simpler... I have a game right now with one mission and one server, how on earth do I configure the client and server to talk to each other?
06/21/2004 (11:46 am)
Ok then maybe I have my concepts wrong here on exactly what a master server is or does.Here is what I need to do.
We have right now a single server, we have the option to buy as many as we want at an extremely reasonable price.
I need the client to connect directly to a server, load a zone and go into multiplayer mode.
I would very much like for all of my dedicated servers to be able to talk to one another, or at least obtain information from a single centralized point, something like this.
Say I have a game with 3 missions, I place mission A on master.mydomain.com, mission b on slave1.mydomain.com, mission c on slave2.mydomain.com
How do I get the client to connect first to master.mydomain.com and enter multiplayer mode, then after something has been achieved, say a trigger has been set, have it connect to slave1.mydomain.com or slave2.mydomain.com, depeding on the results of the trigger?
Or lets make this question even simpler... I have a game right now with one mission and one server, how on earth do I configure the client and server to talk to each other?
#6
06/21/2004 (12:23 pm)
You could do that by writing some scripts that connect to the new server. Check out this resource: www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2421. It's old, but shows the general idea.
#7
in a nutshell:
on the client, you could use commandToServer(FunctionName [,arg1,...argn]) to call the function "FunctionName" on the server with arg1...argn as parameters. On the server you would have the function implemented with the prefix "serverCmd":
The same goes for commandToClient(client, FunctionNname [,arg1,...argn]), except that the client-side functions are prefixed with the string "clientCmd":
I hope this makes sense.
Edit: fixed typo.
06/21/2004 (12:32 pm)
Oh and about the "client/server" talk functions:in a nutshell:
on the client, you could use commandToServer(FunctionName [,arg1,...argn]) to call the function "FunctionName" on the server with arg1...argn as parameters. On the server you would have the function implemented with the prefix "serverCmd":
function serverCmdFunctionName(%client,%arg1) {
// do something here, %client is the GameConnection object handle of the client that sent the message
}The same goes for commandToClient(client, FunctionNname [,arg1,...argn]), except that the client-side functions are prefixed with the string "clientCmd":
function clientCmdFunctionName(%arg1) {
}I hope this makes sense.
Edit: fixed typo.
#8
One would think this would be very straighforward, and I'm getting the feeling it's so simple I'll be smacking myself in the forehead when it's done.
Update*
Ok I just read the tutorial listed above, and that does solve the issue of switching to a new server when conditions are met, but how about configuring the client and server for the initial login?
06/21/2004 (1:44 pm)
Yeah but since modifying the Master server in the default.cs file is not really an option, how the heck do I tell the dedicated "Hey buddy you ARE the primary server, so please respond directly to the client" and second how the heck to tell the client "You need to connect to myserver.mydomain.com NOT master.garagegames.com"One would think this would be very straighforward, and I'm getting the feeling it's so simple I'll be smacking myself in the forehead when it's done.
Update*
Ok I just read the tutorial listed above, and that does solve the issue of switching to a new server when conditions are met, but how about configuring the client and server for the initial login?
#9
What exactly are you trying to accomplish? To have the game connect to your own master server that lists other game servers so you can list them in the dialog popup that follows the "join game" button? Or to have the game connect to a game server and once in-game, redirect the player to another server when "conditions are met"?
06/21/2004 (1:51 pm)
Euhm, I'm a bit confused here.What exactly are you trying to accomplish? To have the game connect to your own master server that lists other game servers so you can list them in the dialog popup that follows the "join game" button? Or to have the game connect to a game server and once in-game, redirect the player to another server when "conditions are met"?
#10
Think of a game like ThinkTanks or something. There are game servers (not master) all over the place. Anyone who has ThinkTanks and the right firewall hole can set up a server. But for somebody to find a game to play, there needs to be a master list of all current game servers, what mission each server is playing, and what players are on each server. It is the master server that has that master list.
In ThinkTanks, the client queries the master server and populates a list control for the user to pick from.
This isn't quite what you want, but it might help you with the basic mindset.
So starting with this mindset, think of some kind of RPG or something. You want everybody to start in a "Town" mission. From there, you might go on various quests that actually lead to other missions running on other game servers (for load balancing or whatever). So, you'd set up your master server and pool of "Town" game servers just like usual. However, each "Town" game server would know which "quest" game servers go with it ([edit:] but none of those would register with the master). Then when a user enters a particular trigger (say, leaving town via a particular gate or even just picking a quest from a GUI control), the "Town" game server tells the client to connect to a particular "quest" game server (and those might even have some trigger that tells the client to connect to the "Town" game server again). Note that only at the very beginning is the master server involved.
Hope that helps.
06/21/2004 (2:00 pm)
This may be too basic, but just in case it helps...Think of a game like ThinkTanks or something. There are game servers (not master) all over the place. Anyone who has ThinkTanks and the right firewall hole can set up a server. But for somebody to find a game to play, there needs to be a master list of all current game servers, what mission each server is playing, and what players are on each server. It is the master server that has that master list.
In ThinkTanks, the client queries the master server and populates a list control for the user to pick from.
This isn't quite what you want, but it might help you with the basic mindset.
So starting with this mindset, think of some kind of RPG or something. You want everybody to start in a "Town" mission. From there, you might go on various quests that actually lead to other missions running on other game servers (for load balancing or whatever). So, you'd set up your master server and pool of "Town" game servers just like usual. However, each "Town" game server would know which "quest" game servers go with it ([edit:] but none of those would register with the master). Then when a user enters a particular trigger (say, leaving town via a particular gate or even just picking a quest from a GUI control), the "Town" game server tells the client to connect to a particular "quest" game server (and those might even have some trigger that tells the client to connect to the "Town" game server again). Note that only at the very beginning is the master server involved.
Hope that helps.
#11
Yeah I'm really getting the feeling, I'm going to have one of those Eureka moments, when everything begins to fall back into place in a completely unexpected way.
Update*
Bingo! Eric you hit the nail right on the head!
Yes this is an RPG, everyone (at least initially) starts in a particular town, and as they move around the world, they need to move from one server to another.
The problem I am having is that we are starting with starter.fps and would like the starting town to be stronghold.mis
Our server right now should be loading stronghold.mis and basically hosting that town for everyone who has our version of the client, which only right now has a modification to look at that server as the "master server"
So basically the mod is wrong. We want this to be as seemless as possible, and have people basically load the game, and have it take them to the server for the first town.
The problem we are having, is that I have misunderstood the basic concept of master server, when in fact it should be thought of as just the first server.
What do I need to modify to make the default client connect to our servers. I think that is the crux of what we are trying to accomplish, sorry for not making it clearer sooner, I have just been to close to the issue, and not able to see the forest for the trees so to speak :D
06/21/2004 (2:02 pm)
Ideally the second option would be the best. However and maybe I'm a little dumb, but I'm not seeing the way to do it.Yeah I'm really getting the feeling, I'm going to have one of those Eureka moments, when everything begins to fall back into place in a completely unexpected way.
Update*
Bingo! Eric you hit the nail right on the head!
Yes this is an RPG, everyone (at least initially) starts in a particular town, and as they move around the world, they need to move from one server to another.
The problem I am having is that we are starting with starter.fps and would like the starting town to be stronghold.mis
Our server right now should be loading stronghold.mis and basically hosting that town for everyone who has our version of the client, which only right now has a modification to look at that server as the "master server"
So basically the mod is wrong. We want this to be as seemless as possible, and have people basically load the game, and have it take them to the server for the first town.
The problem we are having, is that I have misunderstood the basic concept of master server, when in fact it should be thought of as just the first server.
What do I need to modify to make the default client connect to our servers. I think that is the crux of what we are trying to accomplish, sorry for not making it clearer sooner, I have just been to close to the issue, and not able to see the forest for the trees so to speak :D
#12
Set up a couple of main servers. These main servers run a mission in Torque and redirect the user to the quest server they want to play.
Set up a couple of quest servers which implement the actual quest gameplay.
I guess that's something you want to do?
06/21/2004 (2:10 pm)
Set up a master server, which allows a client to connect to one of the main servers.Set up a couple of main servers. These main servers run a mission in Torque and redirect the user to the quest server they want to play.
Set up a couple of quest servers which implement the actual quest gameplay.
I guess that's something you want to do?
#13
More to the point, how to do the first thing, setup a server and configure the server to recognize the client, and the client to connect to the server.
06/21/2004 (2:20 pm)
Yeah basically, but how to do this is the question.More to the point, how to do the first thing, setup a server and configure the server to recognize the client, and the client to connect to the server.
#14
Change the master server in all the .cs files from "master.garagegames.com" or whatever it is to your own master servers (where you installed the forementioned master server).
Have all your main servers register themselves on the master server (which they should do automatically) and implement scripts on those main servers that conenct users to other servers which aren't registered with the master server.
Requires a bit of custom code but nothing too complicated as far as i can tell.
06/21/2004 (2:43 pm)
Torque already supports master servers. Use the free master server Ben Garney mentioned:Quote:TGE doesn't come with the source. There is source available for third party implementations, though. One such is at www.pblabs.com/download.php. There are others.
Change the master server in all the .cs files from "master.garagegames.com" or whatever it is to your own master servers (where you installed the forementioned master server).
Have all your main servers register themselves on the master server (which they should do automatically) and implement scripts on those main servers that conenct users to other servers which aren't registered with the master server.
Requires a bit of custom code but nothing too complicated as far as i can tell.
#15
06/21/2004 (3:26 pm)
Good Idea, I will look into it a little further and tell ya what I find. Thanks!
#16
06/21/2004 (3:27 pm)
Good luck! :)
#17
Store your server IP/port in $ServerInfo::Address then call the above function.
Note: I'm a bit rusty on the IP / port format (should be in the format:
To be sure in starter.fps edit joinServerGui.gui and edit the "function JoinServerGui::join(%this)" function to echo out the $ServerInfo::Address after the "if (setServerInfo(%index)) {" line.
06/21/2004 (3:41 pm)
function staticServerConnect()
{
%conn = new GameConnection(ServerConnection);
%conn.setConnectArgs($pref::Player::Name);
%conn.setJoinPassword($Client::Password);
%conn.connect($ServerInfo::Address);
}Store your server IP/port in $ServerInfo::Address then call the above function.
Note: I'm a bit rusty on the IP / port format (should be in the format:
$ServerInfo::Address = "127.0.0.1:28000";
To be sure in starter.fps edit joinServerGui.gui and edit the "function JoinServerGui::join(%this)" function to echo out the $ServerInfo::Address after the "if (setServerInfo(%index)) {" line.
#18
Just one question though...
What file would that first function go in?
Also I noticed this in the sourcecode and tried it, but keep getting an error about not finding connect in init.cs
torqueDemo -connect 69.60.111.194:28000
According to the source code in main.cs this looks like it should work, am I missing something here?
06/21/2004 (3:57 pm)
Thank you! Labrat I think this is exactly what is needed.Just one question though...
What file would that first function go in?
Also I noticed this in the sourcecode and tried it, but keep getting an error about not finding connect in init.cs
torqueDemo -connect 69.60.111.194:28000
According to the source code in main.cs this looks like it should work, am I missing something here?
#19
What would I edit, and how should it look?
Sorry if my questions are extremely basic, but I really don't want to miss anything here.
06/21/2004 (4:30 pm)
Oh and another question, this is probably too basic, but I want to be absolutely sure, you said "To be sure in starter.fps edit joinServerGui.gui and edit the "function JoinServerGui::join(%this)" function to echo out the $ServerInfo::Address after the "if (setServerInfo(%index)) {" line."What would I edit, and how should it look?
Sorry if my questions are extremely basic, but I really don't want to miss anything here.
#20
07/28/2004 (4:11 pm)
Did anyone find the cuase of this? I'm having the same problem, the demo's work and such, but my game is doing the same thing. (As the first post). I'm trying to use the GarageGames master server too.
Associate Kyle Carter