Howto get Serverdetails?
Moderator: OpenTTD Developers
Howto get Serverdetails?
Hi There!
How can I get on my own Site to Display the Serverdetails as here:
http://www.openttd.org/server_detail.php?id=2211 ?
How can I get on my own Site to Display the Serverdetails as here:
http://www.openttd.org/server_detail.php?id=2211 ?
-
- Engineer
- Posts: 84
- Joined: 22 May 2005 09:45
- Location: United Kingdom
OK, smarty - how does my PHP script find out what year my server is at, or what version of the software it's running?Sacro wrote:Isn't it just basic PHP?
The only way I have right now would seem to be to write a proxy metaserver, and get the local DNS server to misdirect my server's metaserver connection to that proxy before sending it on to the real metaserver.
Actually, I'm planning to get my dedicated server autopilot to populate a web page with all sorts of in-game info (like who's playing, etc) so it would be nice if the console had a bit more information available. I can only get a company name from the console by getting the server to send a message to the company.
I'd really like to see some extra info (version, date, company list) available to the dedicated server console. It would certainly make life esaier for me as a server admin who can't start the game up to look at this stuff whilst at work, for example.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Current year, version and stuff is accessable for everyone, I don't see why you have to call someone a 'smarty' for it, because he is right: with PHP for example you can poll any server you want, via the OTTD Protocol.. easy as that...Brianetta wrote:I'd like to display the current year, version, etc. on my own web site, too. Unfortunately it doesn't seem to be possible.
For your information: the MasterServer-Updater uses PHP.
Last edited by TrueBrain on 10 Jan 2006 19:15, edited 1 time in total.
You could do it the same way the OpenTTD Master Server does it. The server advertises itself to the master server, then that queries your server to find out the details. This querying is done in simple PHP.
http://svn.openttd.org/cgi-bin/trac.cgi ... update.php
If you rip out the appropiate parts to query your own server, or any other server it'll work![Smile :)](./images/smilies/icon_smile.gif)
http://svn.openttd.org/cgi-bin/trac.cgi ... update.php
If you rip out the appropiate parts to query your own server, or any other server it'll work
![Smile :)](./images/smilies/icon_smile.gif)
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
And if you're lazy, http://brutus.ath.cx/ottd/ (link to the source at the bottom). Not the most beautiful piece of code, but it will get you started.
I got mine working, eventually. I had to turn off all the checks (it claimed not to have a response from the server when, strangely enough, the return arrays had actually been populated). I gave up trying to get the client details (company value, etc) because nothing I did came back with info. jetthe's script was an excellent start, but simply didn't work on my server the way it obviously does on his.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Ahhhh the shame! I didn't test my script with the latest openttd.inc.php, the old version is available here: http://brutus.ath.cx/ottd/openttd.inc.phpsSmoky555 wrote:may be the reason is in the file (openttd.inc.php) that you are using?jetthe wrote:I will try to extend the script with some more detailed error checking and hopefully test it some more tonight. Too bad it wouldn't work out-of-the-box for all of you.
can you post it here?
Edit: All functions to retrive company details have been removed from http://svn.openttd.org/cgi-bin/trac.cgi ... td.inc.php , so using the old openttd.inc.php from my website should be considered as an permanent fix.
Yeah, someone (ahum) removed that for some reasonjetthe wrote:Ahhhh the shame! I didn't test my script with the latest openttd.inc.php, the old version is available here: http://brutus.ath.cx/ottd/openttd.inc.phpsSmoky555 wrote:may be the reason is in the file (openttd.inc.php) that you are using?jetthe wrote:I will try to extend the script with some more detailed error checking and hopefully test it some more tonight. Too bad it wouldn't work out-of-the-box for all of you.
can you post it here?
Edit: All functions to retrive company details have been removed from http://svn.openttd.org/cgi-bin/trac.cgi ... td.inc.php , so using the old openttd.inc.php from my website should be considered as an permanent fix.
![Wink ;)](./images/smilies/icon_wink.gif)
![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Yes. Expand upon my autopilot script, so that it writes company information, etc., into a database. The database support is there already. Unfortunately you'll still need to use the openttd.inc.php functions to get the game's current date, landscape and dimensions (that info's not available to the console). Everything bu the date can be inferred from the config, but if a saved game is loaded there's no guarantee that the config reflects the game.ConiKost wrote:Has anybody a new solution?
Once it's in the database, a PHP script can display the results to a web browser.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Who is online
Users browsing this forum: No registered users and 2 guests