Jump to content
Sign in to follow this  
Guest

Command line to get server status

Recommended Posts

Guest

So hi,

Program like ASE use something to get a file which contain key of a define server (by IP of this server) For example 1 key is "reqversion" (or anything like this) with, again for example, the value "196" etc...

So HOW I CAN GET THIS FILE !

IS it a winsock command to send to the server ?

Plz answer me I search it for 3 months and nothing sad_o.gifsad_o.gif

Share this post


Link to post
Share on other sites

Its a standard Gamespy query, Gamespy has a document about it somewhere, but basically you just send "\info\status\" in an UDP packet to the server port + 1 (or +2 for directplay server), and the server sends back an UDP packet which contains a "\property\value\" formated info about the server's status and players.

Share this post


Link to post
Share on other sites
Guest

So thx Kegetys I love you !!! Oh sorry little excited biggrin_o.gif

Share this post


Link to post
Share on other sites

There is [WKK] RealTime Server Query (RTSQ) for OFP out where you can look how it is done. In this, it's done with php. It works very fine.

I have used the code to display life stats on our homepage when the server is up. Also used for internal info.

Greets

[CiA]Lobanak

Share this post


Link to post
Share on other sites

I am in the process of writing a perl cgi to replace the php one from WKK on our site (actually, besides some deuglification it's already completed) and have a few questions regarding server queries:

-how do you get the elapsed time? It does not seem to be part of the answers data from a status command?!? Do i need a different command for that?

-what does the following data mean:

gamemode = openplaying

groupid = 261

queryid = 111808.1

groupid seem to always be 261 and gamemode always openplaying, queryid is always a different string (maybe elapsed time? or just a random number to recognize answer packets? something else entirely?)

-whats the difference between actver and gamever (except the dot in the version number wink_o.gif ))?

I also would like to get a link to the gamespy documentation. I searched google and gamespys site but found only different stuff (newer protocol versions it seems).

Just found something (searching again...):

Quote[/b] ] The gamemode is ALWAYS openplaying. This is to tell querying programs that the Unreal server's game can be dynamically joined.

Share this post


Link to post
Share on other sites
I also would like to get a link to the gamespy documentation. I searched google and gamespys site but found only different stuff (newer protocol versions it seems).

Google came up with http://www.gdconf.com/archives/2000/gamespy.doc for me

Quote[/b] ]-how do you get the elapsed time? It does not seem to be part of the answers data from a status command?!? Do i need a different command for that?

The reply does include a "timeleft" property for me... Its possible that its only there when the played mission has the timeleft thing set.

Share this post


Link to post
Share on other sites

Thanks for the link to the gamespy document, Kegetys.

And: yes, remaining time is in the answer packet (although this is always 15 minutes, except the mission has a known timelimit or the mission maker sets the value with estimatedTimeLeft). What i am missing though is elapsed time. Other tools show that too, so it must somehow be possible. Well, maybe i can find something about in the doc. Thanks again.

Share this post


Link to post
Share on other sites

ah... Its possible that the elapsed time is not included in the gamespy query... The OFP's internal server browser thing uses some other format (the WKK query thing includes support for it too) than the gamespy query which returns some limited info about the server (no players etc.) in a binary format, maybe it includes the elapsed time, though I dont know how it works as the gamespy query returns much more info.

Share this post


Link to post
Share on other sites
-what does the following data mean:

queryid = 111808.1

Use queryid to group and order multiple response packages.

The response can be too long for a UDP package and then it's split into several responses. If there are two or more respons messages they will have chronological queryid values like: 111808.1 and 111808.2

Look for the \final\\ string to identify the last package in the response. If you want to make 100% robust code you should not assume the packages comes in order.

I think this is gamespy query standards, it will probably work for any gamespy compatible game.

It's also possible to query OFP's main port in a binary format, that's how I initially wrote OFP Watch and it works for non dedicated servers as well.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×