Your OpenTTD Server as signatur eks.

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

It'll go in there at some point, but I'm currently more interested in getting the GUI working. If you want me to look at incorporating your changes, send me a diff against the current SVN version and I'll have a look at it.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
DaGeek
Engineer
Engineer
Posts: 24
Joined: 01 Mar 2006 16:49
Skype: gspurgeon
Location: London, UK
Contact:

Post by DaGeek »

my Kludge's are a Major change of your brilliant code, just to make my exact
setup work..

I will post in a short wile with the whole script as my changes are like i say, Major...

The major changes are getting the 'Console Screenshots' working and moving
them to a predifined location, but i have also made some changes to make the autopilot
work with a 'Multi Server Instance' System from a Single script, rather than having the script copied all over the server.

I have a server setup that can create OpenTTD Game Servers 'On the Fly' with
AP support, so i just have 1 AP script and then one hell of a lot of SymLinks :)

I do use the MySQL add-on for AP but I'm just working on getting it to log more info.
Like ALL chat from ALL clients, just in case someone says something they shouldn't, I will have it logged.
User avatar
DaGeek
Engineer
Engineer
Posts: 24
Joined: 01 Mar 2006 16:49
Skype: gspurgeon
Location: London, UK
Contact:

Post by DaGeek »

Hello Again Brianetta

In post 540872 @ http://www.tt-forums.net/viewtopic.php?p=540872#540872
you posted the code of your Banner Script...

I have been messing around with a few things and
wondered if you could point me in the correct direction...

How do you call the TCL script to make the .png file ?
Do you do it from the CLI or is it directly via http/Apache
I understand and can follow what the code is doing,
I just cant seem to see how you call the script..

Sorry if this soundz like a Lame Question. :oops:
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

No, it's fine. It's called by the server as a CGI script. The source I posted is the CGI script. Use the same URL, but replace .tcl with .cgi - the two URLs are the same file, hardinked. I just use Apache rewrite rules to convert a .png filename into a script URL internally to the web server.

If you want a CLI-only version, have a look at this one:
http://ppcis.org/standard/udp_query.tcl

It just dumps the info as text to the console.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
DaGeek
Engineer
Engineer
Posts: 24
Joined: 01 Mar 2006 16:49
Skype: gspurgeon
Location: London, UK
Contact:

Post by DaGeek »

Brianetta wrote:I just use Apache rewrite rules to convert a .png filename into a script URL internally to the web server.
Would you mind showing us your rewrite rules for this ?
If you want a CLI-only version, have a look at this one:
I have tried this from the CLI and I got an error..
After looking @ the code I found that the was an error on line 126.

Line 126 Should read:-

Code: Select all

puts $server_socket [binary format sc 3 0]
and not:-

Code: Select all

puts $-nonewline server_socket [binary format sc 3 0]
Last edited by DaGeek on 11 Feb 2007 20:57, edited 1 time in total.
User avatar
DaGeek
Engineer
Engineer
Posts: 24
Joined: 01 Mar 2006 16:49
Skype: gspurgeon
Location: London, UK
Contact:

Post by DaGeek »

I have added this feature to autopilot as a kind of Add-On..

With the Modz that I have made to my setup the CLI version is now
called/run every 60 Seconds, again this is now running on a server that
runs quite a few different instances of OpenTTD @ once so the way I have
set it up is to out put the info into separate file that are www accessible @
http://openttd.dageek.co.uk/{My OTTD Server Name}.txt

for example:- http://openttd.dageek.co.uk/DaGeek_Serv ... xample.txt
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

DaGeek wrote:Line 126 Should read:-

Code: Select all

puts $server_socket [binary format sc 3 0]
and not:-

Code: Select all

puts $-nonewline server_socket [binary format sc 3 0]
Any Ideas ?
Yeah, I found and fixed that in the signature image script last week. I didn't update the CLI one, because I never use it and don't maintain it. The only problem with the extra newline is an additional packet containing only that CR, which produces an error on the dedicated server's console. It's ugly and wrong, but not the end of the world...
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

I have taken the liberty to port Brianetta's script to PHP and play with the banners a little bit. Here are a few examples of the banners produced:

Image

Image

Source code is licensed under Gnu GPL, you can get it via [url=svn://svn.dan-masek.eu/code/php_ottd_info/trunk]SVN[/url] or browse it online.
For more information, examples and a banner link generator, check out http://dan-masek.eu/ottd/ .

minime
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
User avatar
osai
Traffic Manager
Traffic Manager
Posts: 132
Joined: 22 Sep 2004 14:56
Location: 10.0.1.254
Contact:

Post by osai »

minime,
That is awesome!
May I use your php script to show server information at our homepage?
And of course I want this banner in my signature. :)


Thx,
Osai
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

Of course you can. Just keep in mind this still more of an alpha-stage software.

So far I have tested it under Debian/Apache 2.2/mod_php 5.2.0 and WinXP/Apache 2.2/mod_php 5.2.1
User avatar
osai
Traffic Manager
Traffic Manager
Posts: 132
Joined: 22 Sep 2004 14:56
Location: 10.0.1.254
Contact:

Post by osai »

No Problem Minime,
almost everything we use is nightly or stable or whatever :)

I checked out your repo via svn, so we are always up-to-date.
I tweacked the .htaccess file a bit, so you can only access our Banner via our url code. To prevent usage of others. This might also be a "feature".

I also showed the banner to some ppl, for feedback. And they said the font-size is a little bit too small, the information are not good readable.

Regards,
Osai
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

And they said the font-size is a little bit too small, the information are not good readable.
Yeah, I'll have to switch to using TrueType fonts in order to support UTF-8 properly, I'll use the opportunity to enlarge the text a little.

Thanks for the feedback.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 5 guests