Python Master Server
by Andy Rollins · 04/28/2008 (11:55 am) · 55 comments
Download Code File
When a game client wants to connect to a game server it can scan the network to look for servers on a particular port, this is quite an effective solution when on a small network such as a Home/Office LAN but consider trying to scan the entire Internet looking for a game server, you'd be there for quite some time!!
Instead we employ a Master Server which is hosted at a fixed known address, for example the standard Garagegames master server used in the Starter FPS can be found at master.garagegames.com on port 28002. As each game server starts up it registers itself with the master server which then maintains a list of known servers, when a game client wishes to connect it requests the list of available servers from the master server.
The basic process flow for game servers is:
1. Game server sends a heartbeat to the master server to register itself (packet type 22)
2. Master server sends an Info Request (packet type 10) to the game server requesting more information i.e. game type, mission, number of players, number of bots, etc.
3. Game server Responds with info data and is added to the list of available servers. (packet type 12)
4. Master server drops server from it's list if it hasn't had a heartbeat in about 180 seconds.
5. About every 180 seconds game server sends another heartbeat and the process starts from step 1.
The basic flow for game clients is:
1. Game client sends a list request to the master server (packet type:6)
2. Master server responds with the list of available servers (packet type:8)
3. Game client then pings the game server
4. game server responds to ping request
5. Game client sends request for information to game server
6. Game server responds to information request.
7. The list of available game servers appears in the GUI (see script joinServerGui.gui in the starter.fps)
Ideally the master server filters the results based on game type, mission, num players, etc before responding to the client in step 2 - this is currently not implemented in this version of the master server although I do store all the data so you could easily add a function to do it.
I've tested this version using Python 2.5 and both TGE 1.5.2 and TGEA 1.7 so you should have any problems with those versions, to use it you should just edit the Configuration section at the top of the Masterserver.py and set the port to whichever number you require.
Then in your game edit the server\defaults.cs file where you should see a line that looks like:
to point at your master server (remember to alter the port number to also match the one you set in the masterserver.py file. Examples:
Note the "2:" before the hostname/ip address needs to be there it's an old thing from tribes and the engine expects it to be there.
I've been coding Python for the sum total of 4 days now so there are no doubt bugs within the code, let me know if/as you find them and I'll endeavour to update the resource with any fixes or improvements that people come up with.
Please feel free to use the code however you wish without restriction, although it would be nice to receive some credit if you do use it.
When a game client wants to connect to a game server it can scan the network to look for servers on a particular port, this is quite an effective solution when on a small network such as a Home/Office LAN but consider trying to scan the entire Internet looking for a game server, you'd be there for quite some time!!
Instead we employ a Master Server which is hosted at a fixed known address, for example the standard Garagegames master server used in the Starter FPS can be found at master.garagegames.com on port 28002. As each game server starts up it registers itself with the master server which then maintains a list of known servers, when a game client wishes to connect it requests the list of available servers from the master server.
The basic process flow for game servers is:
1. Game server sends a heartbeat to the master server to register itself (packet type 22)
2. Master server sends an Info Request (packet type 10) to the game server requesting more information i.e. game type, mission, number of players, number of bots, etc.
3. Game server Responds with info data and is added to the list of available servers. (packet type 12)
4. Master server drops server from it's list if it hasn't had a heartbeat in about 180 seconds.
5. About every 180 seconds game server sends another heartbeat and the process starts from step 1.
The basic flow for game clients is:
1. Game client sends a list request to the master server (packet type:6)
2. Master server responds with the list of available servers (packet type:8)
3. Game client then pings the game server
4. game server responds to ping request
5. Game client sends request for information to game server
6. Game server responds to information request.
7. The list of available game servers appears in the GUI (see script joinServerGui.gui in the starter.fps)
Ideally the master server filters the results based on game type, mission, num players, etc before responding to the client in step 2 - this is currently not implemented in this version of the master server although I do store all the data so you could easily add a function to do it.
I've tested this version using Python 2.5 and both TGE 1.5.2 and TGEA 1.7 so you should have any problems with those versions, to use it you should just edit the Configuration section at the top of the Masterserver.py and set the port to whichever number you require.
Then in your game edit the server\defaults.cs file where you should see a line that looks like:
$pref::Master0 = "2:master.garagegames.com:28002";
to point at your master server (remember to alter the port number to also match the one you set in the masterserver.py file. Examples:
using the local machine i.e. your own pc/laptop: $pref::Master0 = "2:localhost:28002"; or via IP address: $pref::Master0 = "2:192.168.0.200:28666"; or even an external site: $pref::Master0 = "2:my_cool_domain.com:27531";
Note the "2:" before the hostname/ip address needs to be there it's an old thing from tribes and the engine expects it to be there.
I've been coding Python for the sum total of 4 days now so there are no doubt bugs within the code, let me know if/as you find them and I'll endeavour to update the resource with any fixes or improvements that people come up with.
Please feel free to use the code however you wish without restriction, although it would be nice to receive some credit if you do use it.
#22
I haven't added a check to see if user is logged in but it should be simple enough. Just add a flag somewhere that gets checked on login.
09/09/2008 (3:51 pm)
Well right now my login is tied into the Join Server gui. What I did was remove the ability to launch the mission until the username and password are verified. Once it is verified it starts the mission.I haven't added a check to see if user is logged in but it should be simple enough. Just add a flag somewhere that gets checked on login.
#23
At some point I'll tidy up my python patching system and post that as a resource too.
09/10/2008 (2:51 am)
@Eric - Yeah that'd be great if you want to provide a link to this, I'm working on a python based character server too that will eventually be submitted as a resource.. Login and Account registrations are done, along with User levels (i.e. Admin, Superuser, user, etc) just need to add things like password changing - drop me an email if you want to compare ideas. How is your version different to the Persistant Character Server resource that exists already and is PHP based??At some point I'll tidy up my python patching system and post that as a resource too.
#24
My resource is a bit more laid out nicely also. It just isn't a gut and move into game.cs. I did move the game connection out of common but created several functions on the server side to authenticate and then load up the mission.
As for the python based character server are you using tscript to communicate with python or did you installed pytorque?
09/10/2008 (9:18 am)
I couldn't get that to work. I tried and it wouldn't work. Eventually I went and looked at some old Dreamer MMO Tutorials. Took some of that along with MD5 resource to send passwords over encrypted I was able to get it to work.My resource is a bit more laid out nicely also. It just isn't a gut and move into game.cs. I did move the game connection out of common but created several functions on the server side to authenticate and then load up the mission.
As for the python based character server are you using tscript to communicate with python or did you installed pytorque?
#25
If I have the master server script going on 2 servers it looks like when someone creates a game and users try to connect, then both master servers are processing info. Is there some way to specify which master server to use when starting a multiplayer game? I think the Ideal situation would be to always balance the 2 servers with equal number of games. So as soon as 1 game is started the next game will be on server 2. I haven't looked to deaply into the python script, but is there a way to keep track of the number of games currently active? And if so, how would you go about making the call to the master server to get the current number of games?
Thx.
09/16/2008 (10:01 am)
Hidy Ho,If I have the master server script going on 2 servers it looks like when someone creates a game and users try to connect, then both master servers are processing info. Is there some way to specify which master server to use when starting a multiplayer game? I think the Ideal situation would be to always balance the 2 servers with equal number of games. So as soon as 1 game is started the next game will be on server 2. I haven't looked to deaply into the python script, but is there a way to keep track of the number of games currently active? And if so, how would you go about making the call to the master server to get the current number of games?
Thx.
#26
So I've been running this script on a windows machine and a mac, the mac hasn't had any problems at all. (of course, it's a mac) but on the windows machine sometimes the MasterServer will stop and give out this error message:
//------------------------
FATAL ERROR OCCURED
Traceback (most recent call last):
File "C:\Python25\MasterServer.py", line 218, in
data, client = g_socket.recvfrom(buf)
socket.error: (10040, 'Message too long')
//-------------------------
I think I added a line or 2 saying "Welcome to the Server" and that's it, no other changes. So in case the line number is off from the original, the line in code is this:
data, client = g_socket.recvform(buf)
Any ideas what this would mean?
Thx.
09/16/2008 (8:01 pm)
Hello,So I've been running this script on a windows machine and a mac, the mac hasn't had any problems at all. (of course, it's a mac) but on the windows machine sometimes the MasterServer will stop and give out this error message:
//------------------------
FATAL ERROR OCCURED
Traceback (most recent call last):
File "C:\Python25\MasterServer.py", line 218, in
data, client = g_socket.recvfrom(buf)
socket.error: (10040, 'Message too long')
//-------------------------
I think I added a line or 2 saying "Welcome to the Server" and that's it, no other changes. So in case the line number is off from the original, the line in code is this:
data, client = g_socket.recvform(buf)
Any ideas what this would mean?
Thx.
#27
To get round the issue the things to try are:
1. At the top of the code I set the buffer size to be 1024 bytes (see the line buf = 1024), try increasing that to a bigger number say 4096.
2. Increase the actual socket size using setsockopt() function, it's around lines 203:
3. Alter the system default UDP receive size - can't remember how to do it exactly but I think under windows its a registry setting - google should give you the results although personally I wouldn't play with it as the either of the first two options should solve your issue.
4. Handle the error and just report it in case someone sends a huge packet my mistake (or malicious), around line 214 change:
to:
(Note: I'm at work and can't test that code right now but let me know if it's not right).
09/18/2008 (4:27 am)
DALO - it's quite a common occurence to hit limits like that, especially on different systems that have different maximum UDP packet sizes. The issue is being caused by the master server receiving too much data to fit into one packet and we therefore need to increase the maximum size of those buffers or ignore the error. On the Mac it quite possibly just chops the end of packet off rather than throw an error (I actually find that more of a pain because it's harder to track an issue but heh different OS's always do things differently), on windows though it'll throw a 10040 Message too long error.To get round the issue the things to try are:
1. At the top of the code I set the buffer size to be 1024 bytes (see the line buf = 1024), try increasing that to a bigger number say 4096.
2. Increase the actual socket size using setsockopt() function, it's around lines 203:
g_socket = socket( AF_INET, SOCK_DGRAM) g_socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 4096) g_socket.bind(addr)Obviousely you can increase the size greater than 4096 but keep to multiples of 1024.
3. Alter the system default UDP receive size - can't remember how to do it exactly but I think under windows its a registry setting - google should give you the results although personally I wouldn't play with it as the either of the first two options should solve your issue.
4. Handle the error and just report it in case someone sends a huge packet my mistake (or malicious), around line 214 change:
data, client = g_socket.recvfrom(buf)
to:
try:
data, client = g_socket.recvfrom(buf)
except socket.error, e:
if e[0] == 10040:
print('Message too long, ignoring.')
else:
raise(Note: I'm at work and can't test that code right now but let me know if it's not right).
#28
Yeah the existing persistant character server resource could do with some tidying up and someof the issues people are having resolving.
09/18/2008 (4:31 am)
Eric - My character server doesn't use PyTorque it communicates by using the TCPObject in Tscript and an md5 encryption algorithym.Yeah the existing persistant character server resource could do with some tidying up and someof the issues people are having resolving.
#29
As you can see it is hitting the outside IP just fine but when my game server returns information it sends the internal IP as a server IP. Is there a preference I am missing to set it as a domain name or some way to send the outside IP.
Thanks
09/23/2008 (1:07 pm)
Andy, I have a problem and perhaps you can tell me if it is your server or something else. I am trying to connect to a game server from outside my lan. When I connect the client and query master it works fine until it tries to send me the game server. Here is my console log to see what I mean.No master servers found in this region, trying IP:98.224.10.153:28002. Requesting the server list from master server IP:98.224.10.153:28002 (2 tries left)... Received server list packet 1 of 1 from the master server (1 servers). Pinging Server IP:172.16.1.3:28000 (3)... Pinging Server IP:172.16.1.3:28000 (2)... Pinging Server IP:172.16.1.3:28000 (1)... Pinging Server IP:172.16.1.3:28000 (0)... Ping to server IP:172.16.1.3:28000 timed out. ServerQuery: query Querying servers: 0 left... 0.5 ServerQuery: done No servers found. 1 Server query canceled.
As you can see it is hitting the outside IP just fine but when my game server returns information it sends the internal IP as a server IP. Is there a preference I am missing to set it as a domain name or some way to send the outside IP.
Thanks
#30
Thx.
09/30/2008 (11:09 pm)
Just a quick question, when a client joins the server, then quits the Num Players variable jumps to 255. Any ideas what would cause this? How is this variable recorded and how does it keep track of the players?Thx.
#31
I start the Master Server on a single PC at home.
I start the Starter.fps or any "out of the box" example for that matter.
I click on Join Server button and then select Query Master Server
While I wait for that window to process the query I can watch this MS respond to the query with:
Soon afterwards the Client finishes the search and shows No Master Servers Found
So I attempted this differently and went to start a client game and checked the Host Multiplayer checkbox.
and then pressed the Launch Mission button.
The Master Server window immediatly shows:
So in the console i do a MasterServersQuery and I get the same response as the first Code Block above.
Then when I quit the game and select the "Join Servers" button, I can see:
"ONE SERVER FOUND"
This only works if I have the client open and in game for a period of time.. perhaps long enough for another heartbeat maybe, because if I enter the game and exit right away then i still get the No server found message.
I sit here scratching my head. Thinking about where to start digging.
It's obvious the checkbox must be checked before I can do a Master Server query but, pressing Refresh Server button works, pressing the Query Master button now will return a blank window and "NO SERVERS FOUND".
I don't assume this is a bug, but rather I am thinking it's like my drill seargent used to say "Lack of comuniGodDamncation".
The way I see it now is if I send a copy of my project game to a friend who would like to test for me, he will not get the server list and therefore cannot join to test it.
So I need some professional help here please.
*fixed a typo
10/24/2008 (10:43 pm)
This is a great Master Server resource, it works great. What concerns me is that Starter.fps miight actually be at fault in the scripts, or perhaps in the engine code, and I seek a solution. I'm posting this here because after using this MS as the only resource that actually works for me.. a new problem has come to light.I start the Master Server on a single PC at home.
I start the Starter.fps or any "out of the box" example for that matter.
I click on Join Server button and then select Query Master Server
While I wait for that window to process the query I can watch this MS respond to the query with:
Gameserver list request from IP 192.168.1.3 Port 28001 Game Type : ANY Mission Type : ANY Min Players : 0 Max Players : 100 Region Mask : 2 Version : 0 Filter Flags : 0 Max Bots : 0 Min CPU : 100 Buddy Count : 0 Sending list data for 1 servers
Soon afterwards the Client finishes the search and shows No Master Servers Found
So I attempted this differently and went to start a client game and checked the Host Multiplayer checkbox.
and then pressed the Launch Mission button.
The Master Server window immediatly shows:
Heartbeat from IP: 192.168.1.3 Port 28001 Sending Game Info Request IP: 192.168.1.3 Port 28001 Game Info response from IP: 192.168.1.3 port 28001 Game type : FPS Starter Kit Mission type : Number Bots : 0 Num Players : 1
So in the console i do a MasterServersQuery and I get the same response as the first Code Block above.
Then when I quit the game and select the "Join Servers" button, I can see:
Home 87 1/64This part isn't too important, it relates to the server name, ping etc.. and at the top of the window reads:
"ONE SERVER FOUND"
This only works if I have the client open and in game for a period of time.. perhaps long enough for another heartbeat maybe, because if I enter the game and exit right away then i still get the No server found message.
I sit here scratching my head. Thinking about where to start digging.
It's obvious the checkbox must be checked before I can do a Master Server query but, pressing Refresh Server button works, pressing the Query Master button now will return a blank window and "NO SERVERS FOUND".
I don't assume this is a bug, but rather I am thinking it's like my drill seargent used to say "Lack of comuniGodDamncation".
The way I see it now is if I send a copy of my project game to a friend who would like to test for me, he will not get the server list and therefore cannot join to test it.
So I need some professional help here please.
*fixed a typo
#32
Scott - I think I can see where you're going wrong, from what you've said I'm guessing you're not understanding how Torque works so please let me explain that. For this resource to be used you need to be running a game client, a game server and a master server.
In your first example where you get no servers you are only running the game client so that's why you are told it couldn't find any game servers.
When you click the host multiplayer tick box and start the game what you are actually doing is creating BOTH a game server and a game client, because they are running as the same process you don't need the master server though.... other people including your friend could connect to this game server if they tried (using a master server) - so actually whilst you think there is a problem actually it all runs perfectly as it should be doing.
When you exit the game you kill both your client and game server which is why you can't then quickly get out and refresh server list and find it, obviously whilst in the game you can run that procedure from the console and you'll see the game server you've created.....
What you can try is running the "starter.fps dedicated.bat" that will create just a game server, and you'll see your heartbeat messages on the master server, then you can go into a client and should be able to query the server.
10/26/2008 (3:41 pm)
DALO - I'm not sure it's the game server (Torque) that keeps track of the number of players and passes that to the master server, so that's where you'd have to start digging.Scott - I think I can see where you're going wrong, from what you've said I'm guessing you're not understanding how Torque works so please let me explain that. For this resource to be used you need to be running a game client, a game server and a master server.
In your first example where you get no servers you are only running the game client so that's why you are told it couldn't find any game servers.
When you click the host multiplayer tick box and start the game what you are actually doing is creating BOTH a game server and a game client, because they are running as the same process you don't need the master server though.... other people including your friend could connect to this game server if they tried (using a master server) - so actually whilst you think there is a problem actually it all runs perfectly as it should be doing.
When you exit the game you kill both your client and game server which is why you can't then quickly get out and refresh server list and find it, obviously whilst in the game you can run that procedure from the console and you'll see the game server you've created.....
What you can try is running the "starter.fps dedicated.bat" that will create just a game server, and you'll see your heartbeat messages on the master server, then you can go into a client and should be able to query the server.
#33
See when I posted that thread it was very late/early in the morning. In anycase, As I said I don't think the problem was the Python Server. I would surely recommend it to others that seek a master server setup.
What I need to do is send a copy of the game client to my friend who wants to connect and test it over the internet.
I have just one PC and getting the results I posted above now makes sense.
It didn't make sense that late hour though =)
I just wanted to thank you for the nudge and the response. I sometimes need to be pointed to the obvious as well.
Certianly your posting on a sunday means your still Torqueing even when your not. lol.
Thank you Andy
10/26/2008 (3:55 pm)
I sometimes need to be reminded the gameserver is running with the client. Most of my project work is after work/dinner/shower and late hours till wee morning. The only time I have after doing my "Dad/Husband" job.See when I posted that thread it was very late/early in the morning. In anycase, As I said I don't think the problem was the Python Server. I would surely recommend it to others that seek a master server setup.
What I need to do is send a copy of the game client to my friend who wants to connect and test it over the internet.
I have just one PC and getting the results I posted above now makes sense.
It didn't make sense that late hour though =)
I just wanted to thank you for the nudge and the response. I sometimes need to be pointed to the obvious as well.
Certianly your posting on a sunday means your still Torqueing even when your not. lol.
Thank you Andy
#34
Thanks for the response, I'm really puzzled why it would jump to 255 but I fixed by doing a client count every time a client joined instead of the ++ method on the server count variable and that seemed to fix it.
I do have a really big issue that I'm hoping you may be able to shed some light on. I have a dedicated server that runs the master python script and when ever I tested the game I would start up a dedicated game server on the same server machine and any client can join from the net with no problems. However if anyone else starts a client/server game from their house , no one can see that newly created game. The master python script recognizes that it's been created but no clients can see it. On my regular computer, not the dedicated server hosting the master python and not behind any routers, I turned off the windows firewall, opened up all the ports on my router and still no one can see the newly created client/server game. Do you know of any variables or factors that might stop clients from seeing servers? Is there a timing feature that could possibly time out too fast or something? Why can all clients see the dedicated game hosted on the dedicated server where MP script is as well, but no one else can see each other's game that they host?
Any ideas?
Thanks a bunch.
10/29/2008 (8:25 am)
Hey Andy,Thanks for the response, I'm really puzzled why it would jump to 255 but I fixed by doing a client count every time a client joined instead of the ++ method on the server count variable and that seemed to fix it.
I do have a really big issue that I'm hoping you may be able to shed some light on. I have a dedicated server that runs the master python script and when ever I tested the game I would start up a dedicated game server on the same server machine and any client can join from the net with no problems. However if anyone else starts a client/server game from their house , no one can see that newly created game. The master python script recognizes that it's been created but no clients can see it. On my regular computer, not the dedicated server hosting the master python and not behind any routers, I turned off the windows firewall, opened up all the ports on my router and still no one can see the newly created client/server game. Do you know of any variables or factors that might stop clients from seeing servers? Is there a timing feature that could possibly time out too fast or something? Why can all clients see the dedicated game hosted on the dedicated server where MP script is as well, but no one else can see each other's game that they host?
Any ideas?
Thanks a bunch.
#35
Rule 1. A PC on your network started that connection so the router is smart enough to know that "Computer A" connected to this address so any reply back to your lan should go back to Computer A.
Rule 2. You configure Port Forwarding so that if any connection comes into say port 28000 it gets routed to Computer B.
For Game servers you don't have any issue because they initiate the conversation with the master server so when it replies and asks for information the router knows where to send it to based on Rule 1.
Again, when a game client talks to the Master server it doesn't have a problem because it initiates the conversation again and Rule 1 applies too.
The issue comes when the game client then wants to connect to the game server... the client starts the conversation (in TGE the client first tries to ping the server) but as that comes into the game servers router it has no way of knowing where to go... Rule 1 doesn't apply as the game server hasn't started the conversation and so you have to setup Rule 2 and create some portforwarding.
You can test if this is what is happening for you by looking at the log files for each piece...
I've numbered each line so to explain what you should be seeing:
Game Server Communications
1. Heartbeat from - this means a game server has connected to the master server to tell it that it exists.
2. Game Info request - The master server sends a message to the game server asking for more details, what type of game it's running, how many players, bots, cpu usage, etc.
3. Game Info response - The game server responds with details about itself - in this example you can see the game type was FPS Starter Kit and there is currently 1 person playing.
Game Client Communications
4. Gameserver list request - A game Client has connected to the master server and asked for the list of game servers that exist.
5. Sending List data - Here we can see the master server sent back to the client details for 1 game server.
Again to explain the sections:
1. We send our request to the master server for the list of servers.
2. We get a reply back from the master server with details for 1 server.
3. We try and ping the game server... as you can see from the details it tries to ping the game server but doesn't get any response back from it and we get the "No servers found" result.
Please have a look at your logs and see if this is what is happening for people, if so they need to configure their routers - details for many routers can be found at www.portforward.com
If it doesn't solve you're issues then please post extracts from your log files and I'll see if I can figure out the issue from there.
P.S. Commonly when a number jumps from 0 to 255 it's a bug to do with signed numbers, if you use signed it uses the first bit to determine the sign (-ve or +ve), when this is treated as an unsigned number though it becomes a larger positive number i.e. 255.
10/30/2008 (5:31 am)
DALO - It's likely to be problems with Port Forwarding on peoples routers, somewhere earlier in this resource it was an issue someone else was having. Basically when a connection from the outside comes into your router how does the router know which of your PC's on your home lan to connect it to?? Really it comes down to two methods:Rule 1. A PC on your network started that connection so the router is smart enough to know that "Computer A" connected to this address so any reply back to your lan should go back to Computer A.
Rule 2. You configure Port Forwarding so that if any connection comes into say port 28000 it gets routed to Computer B.
For Game servers you don't have any issue because they initiate the conversation with the master server so when it replies and asks for information the router knows where to send it to based on Rule 1.
Again, when a game client talks to the Master server it doesn't have a problem because it initiates the conversation again and Rule 1 applies too.
The issue comes when the game client then wants to connect to the game server... the client starts the conversation (in TGE the client first tries to ping the server) but as that comes into the game servers router it has no way of knowing where to go... Rule 1 doesn't apply as the game server hasn't started the conversation and so you have to setup Rule 2 and create some portforwarding.
You can test if this is what is happening for you by looking at the log files for each piece...
Game Server
Sending heartbeat to master server [IP:192.168.1.6:28002] Received info request from a master server [IP:192.168.1.6:28002]Here you can see the game server is talking to the master server (sending heartbeat) and the master is responding (received info request)... so no problem here.
Master Server
[b]1.[/b] Heartbeat from IP: 192.168.1.3 Port 28001 [b]2.[/b] Sending Game Info Request IP: 192.168.1.3 Port 28001 [b]3.[/b] Game Info response from IP: 192.168.1.3 port 28001 Game type : FPS Starter Kit Mission type : Number Bots : 0 Num Players : 1 [b]4.[/b]Gameserver list request from IP 192.168.1.3 Port 28001 Game Type : ANY Mission Type : ANY Min Players : 0 Max Players : 100 Region Mask : 2 Version : 0 Filter Flags : 0 Max Bots : 0 Min CPU : 100 Buddy Count : 0 [b]5.[/b]Sending list data for 1 servers
I've numbered each line so to explain what you should be seeing:
Game Server Communications
1. Heartbeat from - this means a game server has connected to the master server to tell it that it exists.
2. Game Info request - The master server sends a message to the game server asking for more details, what type of game it's running, how many players, bots, cpu usage, etc.
3. Game Info response - The game server responds with details about itself - in this example you can see the game type was FPS Starter Kit and there is currently 1 person playing.
Game Client Communications
4. Gameserver list request - A game Client has connected to the master server and asked for the list of game servers that exist.
5. Sending List data - Here we can see the master server sent back to the client details for 1 game server.
Game Client
If you're having port forwarding issues your console.log for the game client will show something like:[b]1.[/b] Requesting the server list from master server IP:98.224.10.153:28002 (2 tries left)... [b]2.[/b] Received server list packet 1 of 1 from the master server (1 servers). [b]3.[/b] Pinging Server IP:172.16.1.3:28000 (3)... Pinging Server IP:172.16.1.3:28000 (2)... Pinging Server IP:172.16.1.3:28000 (1)... Pinging Server IP:172.16.1.3:28000 (0)... Ping to server IP:172.16.1.3:28000 timed out. ServerQuery: query Querying servers: 0 left... 0.5 ServerQuery: done No servers found. 1 Server query canceled.
Again to explain the sections:
1. We send our request to the master server for the list of servers.
2. We get a reply back from the master server with details for 1 server.
3. We try and ping the game server... as you can see from the details it tries to ping the game server but doesn't get any response back from it and we get the "No servers found" result.
Please have a look at your logs and see if this is what is happening for people, if so they need to configure their routers - details for many routers can be found at www.portforward.com
If it doesn't solve you're issues then please post extracts from your log files and I'll see if I can figure out the issue from there.
P.S. Commonly when a number jumps from 0 to 255 it's a bug to do with signed numbers, if you use signed it uses the first bit to determine the sign (-ve or +ve), when this is treated as an unsigned number though it becomes a larger positive number i.e. 255.
#36
Thx again.
11/11/2008 (10:39 pm)
@Andy, Hey Thanks a bunch Andy, I didn't think really think about the portwarding in the sense of knowing how to communicate with a specific computer. Because my IP address would sometimes change in the router I would port forward all IP's from 192.168.1.100 - 105. This is where the confusion happened, me thinks. So I switched it back to just the one pc and voila.Thx again.
#37
Thanks a bunch.
02/26/2009 (10:21 am)
Hey Andy, quick question for ya, I seem to be having an issue with games that quit unexpectedly or if I end a dedicated game's process. If someone's server or a dedicated game end abruptly then any clients there on after cannot pull the list from the master server after a new game has been created. On the window of the master server it indicates a game has been created and it shows clients pinging the server but all clients will not get the list. Have you or anyone else experience that? or would you know what's going on?Thanks a bunch.
#38
What does the console.log for an affected client show?
03/02/2009 (1:04 am)
Sorry I've not seen the query til now - it's nothing I've come across before, if you can see the clients communicating with the master server after the game has died it's most bizarre as I can't see how it would then not send them the list.What does the console.log for an affected client show?
#39
when i run the python scripting i hav receiving an error
error in line=100
pos+=1
how can i make the master server. how can i run the python script.
successfuly and make the successful master server.
Edit:
I got this error because i hav run this python script in 1.5. actually
it willl work on Python 2.5. Now i dont have any error.Its working
04/15/2010 (3:18 am)
Hi All when i run the python scripting i hav receiving an error
error in line=100
pos+=1
how can i make the master server. how can i run the python script.
successfuly and make the successful master server.
Edit:
I got this error because i hav run this python script in 1.5. actually
it willl work on Python 2.5. Now i dont have any error.Its working
#40
04/16/2010 (10:24 am)
Im a little confused on where the files go. Andy, I noticed you said to place the line of code in the server/default.cs file. I dont have this file. Also, where are the PY files to be placed? 
Torque 3D Owner DALO
Anyways, was just curious........
Thx.