Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri May 24, 2013 5:36 am

All times are UTC




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Howto get Serverdetails?
PostPosted: Tue Jan 10, 2006 4:09 pm 
Offline
Engineer
Engineer

Joined: Sun Jun 02, 2002 3:21 pm
Posts: 64
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 ?

_________________
Crazy Ivan ;)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 4:42 pm 
Offline
Engineer
Engineer

Joined: Sun May 22, 2005 9:45 am
Posts: 84
Location: United Kingdom
Usually, if the server is set to "advertise" and can be accessed, it will appear on the servers list and can be queried for game info.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 4:50 pm 
Offline
Engineer
Engineer

Joined: Sun Jun 02, 2002 3:21 pm
Posts: 64
But how I do it myself ?

_________________
Crazy Ivan ;)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 4:57 pm 
Offline
Engineer
Engineer

Joined: Tue Aug 09, 2005 10:12 am
Posts: 12
Location: Aalborg, Denmark
*delete*


Last edited by IvanDK on Mon Jan 16, 2006 2:42 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 5:59 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 15, 2003 10:00 pm
Posts: 2565
Location: Jarrow, UK
I'd like to display the current year, version, etc. on my own web site, too. Unfortunately it doesn't seem to be possible.

_________________
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 6:01 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1117
Location: Here
Isn't it just basic PHP?

_________________
We Am De Best

Host of ThroughTheTube site


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 6:06 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 15, 2003 10:00 pm
Posts: 2565
Location: Jarrow, UK
Sacro wrote:
Isn't it just basic PHP?


OK, smarty - how does my PHP script find out what year my server is at, or what version of the software it's running?

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 7:12 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon May 31, 2004 9:21 am
Posts: 1223
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.


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...

For your information: the MasterServer-Updater uses PHP.


Last edited by TrueBrain on Tue Jan 10, 2006 7:15 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 7:13 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Feb 24, 2003 6:45 pm
Posts: 3049
Location: Hong Kong
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 :)

_________________
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."


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 9:14 pm 
Offline
Engineer
Engineer

Joined: Sun Aug 14, 2005 12:58 pm
Posts: 5
Location: Lkpg, SWE
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 10:24 am 
Offline
Engineer
Engineer

Joined: Tue Aug 09, 2005 10:12 am
Posts: 12
Location: Aalborg, Denmark
*delete*


Last edited by IvanDK on Mon Jan 16, 2006 2:40 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 1:37 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 15, 2003 10:00 pm
Posts: 2565
Location: Jarrow, UK
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 7:06 pm 
Offline
Engineer
Engineer

Joined: Sun Aug 14, 2005 12:58 pm
Posts: 5
Location: Lkpg, SWE
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 12:46 pm 
Offline
Engineer
Engineer
User avatar

Joined: Thu Jan 06, 2005 5:22 am
Posts: 97
Location: Russia, Volgograd
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.

may be the reason is in the file (openttd.inc.php) that you are using?
can you post it here?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 2:34 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
You might try checking SVN.

_________________
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 5:17 pm 
Offline
Engineer
Engineer

Joined: Sun Aug 14, 2005 12:58 pm
Posts: 5
Location: Lkpg, SWE
Smoky555 wrote:
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.

may be the reason is in the file (openttd.inc.php) that you are using?
can you post it here?


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.phps

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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 11:04 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon May 31, 2004 9:21 am
Posts: 1223
jetthe wrote:
Smoky555 wrote:
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.

may be the reason is in the file (openttd.inc.php) that you are using?
can you post it here?


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.phps

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 reason ;) It currently is no longer used for the MasterServer, and the code was buggy... but oh well :) Someone should rewrite everything anyway :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 4:49 pm 
Offline
Engineer
Engineer

Joined: Fri Jul 04, 2003 4:06 pm
Posts: 11
Location: Norway
grrr...

what has changed with the new version (0.4.5), my server-info script don't work anymore...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 9:57 pm 
Offline
Engineer
Engineer

Joined: Sun Jun 02, 2002 3:21 pm
Posts: 64
Has anybody a new solution?

_________________
Crazy Ivan ;)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 9:12 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 15, 2003 10:00 pm
Posts: 2565
Location: Jarrow, UK
ConiKost wrote:
Has anybody a new solution?

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.

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.