Pinging and getting info from a Quake 3 OSP server.
I can''t find any information about pinging and getting info such as current map, players and scores from a Quake 3 OSP server. You know those things that are displayed in eg GameSpy.
I''m going to write a small server tool but can''t find any information. All resources, hints and sample code (c++) are appriciated.
Sure. First make sure you're communicating with UDP packets.
Simply send this over to the server:
Easy, eh? Now, it will reply to you with a packet that looks just like so..
Just parse up the info parameters until the last \0, then parse the user list. I believe the names at the end are setup like so..
PING SCORE NAME
Where as for the first item, Mynx is the player's name, 19 is the ping, and 0 is the score.
If that isn't the case, then its
SCORE PING NAME
I honestly don't remember. Query a few servers and judge for yourself based on the results.
[edited by - munkie on August 11, 2002 11:18:43 AM]
Simply send this over to the server:
ÿÿÿÿgetstatus
Easy, eh? Now, it will reply to you with a packet that looks just like so..
ÿÿÿÿstatusResponse\g_needpass\0\gamename\baseq3\bot_minplayers\0\sv_privateClients\0\mapname\Q3DM3\protocol\43\g_gametype\0\version\Q3 1.16n win-x86 Mar 14 2000\g_maxGameClients\0\capturelimit\0\sv_maxclients\8\timelimit\0\fraglimit\0\dmflags\0\sv_hostname\noname\sv_maxRate\0\sv_floodProtect\1\sv_minPing\0\sv_maxPing\019 0 "Mynx"77 0 "Orbb"61 0 "Crash"139 0 "Hunter"83 0 "Lucy"87 0 "Grunt"81 0 "Lucy"
Just parse up the info parameters until the last \0, then parse the user list. I believe the names at the end are setup like so..
PING SCORE NAME
Where as for the first item, Mynx is the player's name, 19 is the ping, and 0 is the score.
If that isn't the case, then its
SCORE PING NAME
I honestly don't remember. Query a few servers and judge for yourself based on the results.
[edited by - munkie on August 11, 2002 11:18:43 AM]
Oh, to correct myself, do not parse up to the last \0, because that is a variable number. Parse up to the next linebreak, because that whole first block of information does not contain line breaks, I merely inserted them in there so I didn''t screw up the formatting of the forums.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement