The online racing simulator
LFS World Server Script
(57 posts, started )
LFS World Server Script
My LFSW Server Script has gone BETA and thus now has publically been released! Version 0.9.0 will be the first version presented to the public eye. It also contains additional support of the cURL library, such as my LFS RacerOnlineScript, which makes accessing LFS World much more faster and more secure and this even with allow_url_fopen disabled.

LFSW ServerScript is a PHP script for retreaving all information about a server from LFS World.

Features:
  • Read out all server informations, including server status, LfS version, number of online users, current racers online, selected track, allowed cars, race length and qulification length
  • Display information about as many servers as you want
  • List of all present drivers
  • Correct formatting of servername and racernames
  • Creation of LfS Join link
  • Uses caching for better performance and lower LFS World traffic usage
  • Ident Key enabled
  • Fast and secure access of LFS World even with allow_url_fopen disabled! (using cURL) new!
  • Fallback mode to fopen / file_get_contents if cURL is not installed new!
  • Multi-language support new!
The script requires webspace with PHP functionality.

All you have to do is to configure the file "_data_config.php" included in the archive, which includes all informations about the server(s). Afterwards you can upload all files and use it.

// Update:
Since the newest version, multi-language support has been implemented. You are welcome to provide any other translations!

CURRENT VERSION: 0.9.2b Beta

DOWNLOAD: The new version can be obtained here:
http://sourceforge.net/project ... 628&package_id=219104

A preview of the script in action can be seen here:
http://www.gjl-network.net/octrin_racers/servers/server.php

Additional language files (translations) that have not been included in this release may be found at the SourceForge project page:
http://sourceforge.net/project/showfiles.php?group_id=187628

Hope you all enjoy the new version and please report any problems to me!

Readme.txt
LFSW Server Script V0.9.2b Beta
=================================================
Written by Sebastian "Octrin.VorTeX" Bauer, 2006-2007

LICENSE:
=========
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

----------------------------------------------------

This is the first version of my Server Script that is using LFS World support.
As many users don't have a server that allows FTP access I took the time to
rewrite my script and make it use LFS World.

The script is easy-to-use. Simply edit all settings in the _data_inc.php file.
You will find all information needed to configure this script inside this file!

IMPORTANT:
LFSW ServerScript requires the folder where it is saved to be writable for
the webserver. Under Unix systems it means, that the folder MUST be CHMOD 777.

The Join2LFS-Link, which will be created with the servername requires the
viewer of the website to have Join2LFS installed on the system.
Join2LFS is a free browser extension developed by Holger Reitner (formerly
known as "cr4cy!C3"). You can find the download using the following URL:
http://lfstools.crazyice.net/pafiledb/pafiledb.php?action=file&id=57

Have fun with this script, if you have any questions, suggestions or
found any bugs, please contact me at our forum, by ICQ or email.

You will find updates of this script and some other tools made by me
at http://blog.gjl-network.net

ICQ: 154112478
eMail: vortex@gjl-network.net

If you want to stay informed about updates, you can sign in to my
LFS script mailing list by writing an empty mail with the subject
subscribe to lfsscript@gjl-network.net
Problems can also be discussed inside the mailinglist.


Changes in Version 0.3:
- Fixed a major bug where the (not yet implemented) rule bytes haven't been skipped

Changes in Version 0.4:
- Added LFSW ident key support (updated function update_check() for this)
- Implemented use of "$showInfo[]" array to help the user customizing his script
- Implemented checking of RULE bytes. (Determine if SELECT, VOTE, QUALIFY,
PRIVATE, MIDRACEJOIN and MUSTPIT are set on the server)
- Enabled multiple server support
- Fixed behaviour if when server was not found (is offline)

Changes in Version 0.4.2 ALPHA
- Enabled ident key to be required
- Updated LFSW url to version 1.3
- Fixed bug for showing "All" instead of every single car.
- Fixed bug in HTML generation of get_rules()
- Show 'none' if qual == 0

Changes in Version 0.4.3 ALPHA
- Changed behavior for color code parsing

RELEASE 0.9.0 BETA (Milestone)
- Added fast and secure HTTP access of LFS World using cURL

Changes in Version 0.9.2 Beta
- Implemented multilanguage support including English and German lanuage file.

Changes in Version 0.9.2b Beta
- Fixed detection of cURL which caused a fatal PHP error if cURL is not installed.

To Do:
- Bugfixing lapcount problem (DSK Server shows proper lapcount, Octrin does not. both without racers on)

----------------------------------------------------
(C) 2006-2007 by Sebastian "Octrin.VorTeX" Bauer

Special thx fly out to:
- Octrin.cr4zy!C3 for additional information about the LfS color mapping.
- All alpha testers!
- misjka for a lot of good suggestions :)

====================================================

Updates and more stuff from me at: http://blog.gjl-network.net
My LFS Mirror: http://lfs.gjl-network.net
My Team: http://www.Octrin-Racing.net


Good work VorTeX3k
Thanks a lot for this. Hope you can do this work somewhen later again? Because currently the both included language files are obsolete as they are the old ones from my LFS ServerScript, they are currently not used. But as I said, I'll implement this as fast as possible and then come back to you! Thanks!
I translate me too in french language. If it helps someone later...

Thanks for your programs, VorTeX3k
Attached files
lang_fra.zip - 821 B - 215 views
#6 - Davo
Works great. Thanks for this Hooray to no more ftp hehe
not working for me

i think it has something to do with my ftp becasue it shows my server name, but it says offline.

EDIT: Neither is the Racer Online Script.
Quote from Falcon140 :not working for me

i think it has something to do with my ftp becasue it shows my server name, but it says offline.

EDIT: Neither is the Racer Online Script.

There is no relation between the script and the ftp^^ This script reads the data from LFS World via your webserver.

Check if your cache.txt file has been filled and tell me how big it is (kB).

You can also pm me your _data_inc.php config file, so I can check if everything is set up correctly.
Thanks for the compliment and THANKS A LOT (!! very much thanks ) for your translation!

I am currently working on the 1.0 release. This will then include the language file.
The language file itself will also be available via the SourceForge project page ( http://lfswebsitetools.sourceforge.net )
Ok Here's my translation to spanish (Dunno if it works lol)

lang_esp.zip


-Blas-
I get a blank page

The problem appears to be the 'update_cache' function. If I rem out the call to this function (having created the cache.txt manually) then the stats work.
Hmn.. strange. Well, lets try getting detailed error information:

Go inside the update_cache() function and remove all @ signs. This will enable PHP error reporting for the called methods. Then report back to me
Quote from VorTeX3k :Hmn.. strange. Well, lets try getting detailed error information:

Go inside the update_cache() function and remove all @ signs. This will enable PHP error reporting for the called methods. Then report back to me

Removing the @ from the stat function produced the only error ...


Warning: stat() [function.stat]: stat failed for cache.txt in c:\Inetpub\wwwroot\lfs\server.php
Uhm.. I think this error will be hard to track.. It seems that the stat function sometimes has some problems on Windows servers. I also have a Windows server running but without any problems..

I'll see what I can do as workaround, will come back to this topic
Could you try to replace the following lines:
$cachestat = @stat('cache.txt');
$now = date('YmdHis');
$file = date('YmdHis', $cachestat[9]);

by those:

$cachestat = @filectime('cache.txt');
$now = date('YmdHis');
$file = date('YmdHis', $cachestat);

Btw, is the output you pasted in here really the _COMPLETE_ output?
Quote from VorTeX3k :Could you try to replace the following lines:
$cachestat = @stat('cache.txt');
$now = date('YmdHis');
$file = date('YmdHis', $cachestat[9]);

by those:

$cachestat = @filectime('cache.txt');
$now = date('YmdHis');
$file = date('YmdHis', $cachestat);

Btw, is the output you pasted in here really the _COMPLETE_ output?

I get the same result using the amended code. The error message I posted was complete apart from the line number which I left out.

Anyway, I now have it working but only by enabling cURL in the php.ini

I thought that cURL was optional?

Thanks for the assistance. Much appreciated.
cURL is optional.. the script tries to connect using cURL. if this fails it tries to achieve the LFSW data using file_get_contents or fopen.

Maybe file_get_contents and fopen didn't work either but that should have give an error..
Several Errors
Hi,

it didn't work anyway until I added cURL to PHP. Before that I only got a blank screen.

But now I have several errors displaying in front of the script output.

Notice: Uninitialized string offset: 0 in /srv/www/.../server.php on line 155
Notice: Undefined index: Version in /srv/www/.../server.php on line 164
Notice: Undefined index: MaxPlayers in /srv/www/.../server.php on line 176
Notice: Undefined variable: carlist in /srv/www/.../server.php on line 760
Notice: Undefined variable: rulelist in /srv/www/.../server.php on line 468
Notice: Undefined index: Access in /srv/www/.../server.php on line 225

I don't know where to fix, I am new to Linux and I've setup up a webserver for the first time.

It would be really nice if someone could help me.

Thanks in advance
Franky
Could you PM me your _data_inc.php?
I took a couple of minutes to translate the strings to Dutch (attached).
Attached files
lang_dutch.rar - 866 B - 176 views

LFS World Server Script
(57 posts, started )
FGED GREDG RDFGDR GSFDG