PDA

View Full Version : LfS S2 Server Script


VorTeX3k
12th August 2005, 09:23
PHP Script for retreaving all informations from a server.

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.
List of all present drivers
Correct formatting of servername and racernames
Creation of LfS Join link
Multi-language support


The script requires webspace with PHP functionality. Also access to the hostXXXXX.txt file of the gameserver is required. This can be either by FTP or HTTP.

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

By default the output of the script will be written in English. If you want to change the language to another one (for example German or Spanish), you can change the according parameter in the _data_config.php file. A list of supported languages can be found in the release notes.

If you use this script on your site, please place a link to our website (http://www.Octrin-Racing.net) by using the image file included to this archive. Thanks!

If you have any questions, problems or suggestions you can post your feedback in here or contact me by ICQ.

Recent changes (version 1.9)

Added new track from Patch Y "South City Chicane Route"
Added new car from Patch Y "Formula BMW"
Added additional check if file exists to avoid errors in output

Download @ Sourceforge (https://sourceforge.net/project/showfiles.php?group_id=187628&package_id=219169&release_id=566144)

the_angry_angel
12th August 2005, 10:06
Very nice work, and I especially like the added option of security :up:

VorTeX3k
12th August 2005, 10:37
Thanks for your commendation.

Maybe someone is here, who can translate me ~20 simple lines into some languages like French, Italian, Spanish, Polish, Dutch?

I would be really happy about that :)

VorTeX3k
12th August 2005, 11:52
First of all thanks to Dannel for the spanish translation :)

Now version 1.3 is out (has gone quickly, right? ;) ) which includes spanish translation. Also I've changed the language detection function to be more dynamically.

kamkorPL
12th August 2005, 12:17
Thanks for your commendation.

Maybe someone is here, who can translate me ~20 simple lines into some languages like French, Italian, Spanish, Polish, Dutch?

I would be really happy about that :)

I can translate to Polish if you're still looking for translators. :)

VorTeX3k
12th August 2005, 12:23
Of course, every translation is welcome :D you can contact me by PM to get my mail adress for this translation :)

VorTeX3k
15th August 2005, 11:03
There's a new update again to version 1.4 (see first post).

Thanks to all translators :)

Additional translations are still welcome ;)

snewham
15th August 2005, 11:28
very nice indeed. Might use this on my site.

franky500
15th August 2005, 13:37
am i blind or just plain stupid? where can i download the script? thanks

VorTeX3k
15th August 2005, 13:53
Whoops, I deleted the link from the first posting when I edited it =)

Anyways, here's the download link again:
http://rs.pro-games.net/download.php?a=view&id=23

jscorrea
20th August 2005, 03:35
Great script!!!

Congratulations!!!

But not work for me :-(

Server specifications:

Protocol: HTTP
IP:Port: 200.207.90.173:27090
Path: D:/LFS_S2_DEDI_P

What is wrong?

Regards
JS

felplacerad
20th August 2005, 08:23
Here you are mate, NOTE just rename it to php it's not actually a zip archive!

good work.

jscorrea
20th August 2005, 11:58
Extract to lang folder.

Regards,
JS

VorTeX3k
22nd August 2005, 07:15
Hey you two, thanks for your translation! I will implement them in the next 1.5 version.

@jscorrea: what exactly does not work with the script?

jscorrea
22nd August 2005, 13:42
He appears that my server is offline....

Help.

JS

VorTeX3k
22nd August 2005, 13:51
First of all check if the path to your hostxxxx.txt file is correct. The PHP script should of course be run on a HTTP webserver.
Then check the filename of the hostfile on the game server (which should be accessed by ftp or http) and check, if the number fits the port you have entered in the config file.

If it still does not work you may send me a folder structure info of your gameserver (beginning from the root of your ftp login) and the settings of the script by pn.

Iceberg
1st September 2005, 11:11
Can anyone put this in a block?

I have tried with no luck...




Great script by the way.



My internet service provider does not support getting data from other providers, so I must find another one :pillepall

the_angry_angel
1st September 2005, 11:15
In a block? Sorry, I must be having a dumb day, because I'm not following...

I think you mean that your host doesnt allow for you to use sockets. Shame, but a lot of hosts do this to prevent exploits, preserve bandwidth and prevent leeching :(

Iceberg
1st September 2005, 11:47
I mean in a block :)

If it was possible to put the script in a block, you could have the server status on the frontpage off your php site. Like "who is online"

This would be very nice :nana:

Iceberg
5th September 2005, 11:41
It is working now :thumb:

Check www.dprt.dk (http://www.dprt.dk/)

VorTeX3k
12th September 2005, 09:03
thanks for using my script :) but as mentioned in the readme: please link to our page www.octrin-racing.net when using it ;)

Iceberg
12th September 2005, 09:49
Sorry.

I will put it in asap

Iceberg

Iceberg
13th September 2005, 11:24
I have placed you in our link section now.
Do you know how to make the join link to the server I am online at?
I don´t know how to place it when it is a variable server (not always DPRT #2) eg. <a href="lfs://|DPRT.dk%20/#1|0|S2|/>

VorTeX3k
13th September 2005, 11:50
Thanks for the link :)

To make this variable link you first have to gather the information from lfsworld which server you are on, afterwards you can create a link using PHP echo output with a variable that contains the specific servername:
echo "<a href='lfs://|$servername|0|S2|/'>Join Iceberg</a>";

But the main point is to contact lfsworld and parse the hostlist to find out which server the specific player is driving on. This information has to be stored in a variable which can be used for the LFS-Join link creation.

VorTeX3k
6th October 2005, 09:07
Hello folks,

unfortunately the download link is currently down, because our website will be done new from the scratch.
It will come back on with a new version, because I now received several reports about bugs that make the script act strangely when used several times in boxes on a website.
So I'll try to fix those bugs and put the script back on :)

Coolsson
8th October 2005, 03:11
I tested the live demo links, looks real nice, but The Downloadpage isnt working for me..

Hopefully this problem will be adressed, because I really wanna get my hands on this script :P

--
Coolsson

kyler
8th October 2005, 07:26
Me toI tested the live demo links, looks real nice, but The Downloadpage isnt working for me..

Hopefully this problem will be adressed, because I really wanna get my hands on this script :P

--
Coolsson

Pootie
8th October 2005, 16:44
The download link appears to be broken,Can someone upload the file here so that I could dload it? Thanks alot
Bud

kyler
8th October 2005, 23:04
Can someone uplaod it so we can downlaod it please?

franky500
9th October 2005, 17:54
Just realised i have it uploaded..


http://www.hks-hukkers.com/lfsserv.zip


VorTeX3k (http://member.php?u=21462) - I hope that you do not mine me hosting this script.

Coolsson
9th October 2005, 21:14
Thx Franky for sharing!

And VorTeX3k (http://member.php/?u=21462), hopefully you get the new site working so you can release your new version soon..

thx dudes!

kyler
11th October 2005, 03:31
How do u install it

Coolsson
11th October 2005, 20:42
Yeah im lost too... :S


freakin php, gives me headache

kyler
12th October 2005, 02:00
I can do it i just need to know How to do it some one sade to uplaod all files to ur host i tryed that but no work please help?

franky500
12th October 2005, 16:35
make sure you have all of the needed things on your host.. ie HTTP.... this i had to download and pput on my host manually. Just follow the instructions in the readme for how to get it.

franky500
14th October 2005, 17:56
I just realised i was actually linking the wrong file LOL

here is the ACTUAL server script... very easy to use.

http://www.hks-hukkers.com/lfsserv.zip

Coolsson
15th October 2005, 21:29
LOOOL

Thx Franky :D

Mikjen
15th October 2005, 23:07
Ok Noob question, i have me own web hosting account, can i host my Figure 8 track onto my webspcae, So that it is on 24 /7 ?? (without my comp being left on 24/7 ...?


thx

Mick

VorTeX3k
25th October 2005, 14:14
wow, first of all especially frank for being my stand-in support ;) i will upload the script to my private webspace soon, so all of you can download it from there, too.
as i said the new version will be released with our new website. and it started ;) but before the website was finished another crash happened to it and now our webmaster (ThunderX86) got sick. but I'll see if i can publish it on my private website. but for this it has to be finished ;)

@mikjen: for this you would need some kind of cronjob that permanently would call the script, and also the script would need to be modified to log all informations. for all of this you would need a root-server. so it's not really realizable this way. or need some kind of application that's connected to the server via in-sim.

//edit: ok, here's a download link of the script :)
www.gjl-network.de/lfs/lfs_server_script1.4.zip

VorTeX3k
10th November 2005, 15:02
Finally, here it is!!

Took a long time, but now Version 1.5 is finished! The most important fix is that the script now supports multiple servers at once what made some problems before.

The changes in version 1.5:
Support of Swedish language (thanks to FEL)
Brazilian Portugese translation (thanks to JSCorrea)
Added the tracks "Fern Bay RallyX Green" and "Fern Bay RallyX Green Rev." which have been forgotten to be implemented :)
Completely re-wrote the main structure of the script to make the script now working with several servers at once.
Changed the way of setting the language: Language will now be set by variable in the configuration section of the script.

It's important to read the readme.txt, too if you have used the script before since some parts mainly changed!

Downloadlink can be found here:

http://www.gjl-network.de/modules.php?op=modload&name=Downloads&file=index&req=viewdownloaddetails&lid=2&ttitle=LfS_Server_Script_V1.5

misjka
14th February 2006, 05:39
Hi!

I have just installed this great scritp :thumb: !

But, so far I have noticed at least 3 issues:

1] As all cars are allowed on the host, the script should report "All". But it does not - it reports all 18 car types.

2] If the host is configured for training (i.e. laps=0), a reasonable output from the script should be "Training" - not "0 lap"

3] In a comment in the script, it says that the default port for the host is 63396. The corrrect default port is 63392.

Here you may find my output: http://rm8s.net/smfForum/index.php?page=35

VorTeX3k
14th February 2006, 15:11
hi misjka,

thank you very much for your informations and this bug.

I will take care about this as soon as possible, i think this evening :)

misjka
14th February 2006, 16:30
No sweat :schwitz: :D !

Btw, there is a misspelled variable! Check all $showLanuage instances :smileypul !

Really enjoy this script, never the less :thumb: !

But: I would really like to see whether the host is public or private, though...

VorTeX3k
15th February 2006, 10:00
Ok, i fixed the points from your posts :) Thanks a lot for this.
But: I would really like to see whether the host is public or private, though...
Do you mean private = password protected or private = not in server list (usemaster=no) ?

misjka
15th February 2006, 11:38
Gr8 :thumb: !

I mean private = password...

And btw, I would very much have all the host variable config parts in a separate cfg or php file since it would make an update easier in my opinion... Is that possible to do?

EDIT: But, qué?? I downloaded the script again, but the errors remained...

VorTeX3k
15th February 2006, 13:09
Gr8 :thumb: !

I mean private = password...

And btw, I would very much have all the host variable config parts in a separate cfg or php file since it would make an update easier in my opinion... Is that possible to do?

EDIT: But, qué?? I downloaded the script again, but the errors remained...
Yes, seperated config file could be possible.

Ok, so i'll make those changes and right AFTERWARDS you can download it ;)

You still downloaded the old version, since the new one is not yet online ;)

misjka
15th February 2006, 13:15
Thanks, m8 :thumb: :D !

misjka
15th February 2006, 13:35
Yo :Looking_a !

It seems that my host still shows up on the Server Script page, although I shut it down an hour ago :pillepall ... Have a clue how that delay occurs :shy: ?

VorTeX3k
15th February 2006, 13:35
Ok, i've released a new Version 1.6 :) The downloadlink can be found in the first post of this topic and of course here:

http://www.gjl-network.de/modules.php?op=modload&name=Downloads&file=index&req=viewdownload&cid=1

ALL: Please be aware! All configuration has to be done in the file _data_config.php by now!! So mainly you can leave the file server.php as it is and does not need to be edited!

Of course a lot of thanks to misjka for your ideas, suggestions and bug reports! :D

VorTeX3k
15th February 2006, 13:36
Yo :Looking_a !

It seems that my host still shows up on the Server Script page, although I shut it down an hour ago :pillepall ... Have a clue how that delay occurs :shy: ?
Well, your hostxxx.txt file will still remain, but the script should show the message "server is offline", doesn't it?

//edit: *douh* forgot to implement the public or private status of the server. will fix this immideately ;)

misjka
15th February 2006, 13:55
Nope... It says Online...:shrug: Look here (http://rm8s.net/smfForum/index.php?page=35)(and try to join via Join2LFS, you'll get "host not found")...

misjka
15th February 2006, 13:57
Of course a lot of thanks to misjka for your ideas, suggestions and bug reports! :D

Sure, no sweat :schwitz: m8 :D . Glad I could contribute to an excellent script!

VorTeX3k
15th February 2006, 14:01
What webserver are you running on?

I expected such problems on IIS my IIS webserver. But with my linux based apache it works without any problems.. strange.

Btw: the new version including ALL changes is now online ;)

misjka
15th February 2006, 14:16
Do you mean the webserver that is hosting the script? It's a Unix/Apache...

OK, thanks! Gonna dl now :).

misjka
15th February 2006, 14:34
Seems to work like a charm now - much obliged :thumb: ...

About the online/offline issue, it seems that the host file didn't get updated... And I now why: I killed the dedihost by the windows X button :). It's a shame, though, that the host file is erased as the host is shut down properly... It makes the script occupy the browser for quite some time until it is timed out... With several dedihosts, that are not 24/7, it will become quite slow...

VorTeX3k
15th February 2006, 14:45
Mh.. yes.. Ok, I thought the host file will remain if the server will be shutdown. So I'll think about this problem and how to solve it. Thanks for your investigation :)

VorTeX3k
15th February 2006, 14:56
ok, now you can maybe download the script again and try it out?

Dunno why, but I did no check before trying to open the hostfile.
So now the script will check if the file exists, if not, it will ouput a message: Server is offline

misjka
15th February 2006, 15:01
OK, i'm right on it :)!

misjka
15th February 2006, 15:05
Sorry, got: Parse error: parse error, unexpected '{' in /home/xxx/public_html/.../server.php on line 128

And, mmm... for security reasons, you maybe should create an index file that doesn't allow browsing of the script folder...?

VorTeX3k
15th February 2006, 15:07
Douh *slam*

Forgot one )

Don't have any testing oppurtinities atm. Sorry ;) So now it should work.

No, a index file will not be delivered by me, because of several reasons:
- Often the script will simply be included, so the path or folder of it isn't visible at all
- Often the script is located inside a folder where an index is already located
- even if it's possible to browse the folder: you don't have any possibilities to get the server config or so, because a PHP script will ALWAYS be parsed before it gets delivered to the user, so if the user would request the _data_config.php file (even with right click -> save as) he would only get an empty html site :)

So this should be no security problem although its a user responsibility to "lock" the used directories on a webserver. I cannot assume that the script will be located in an empty or in an index-containing folder ;)

misjka
15th February 2006, 15:16
Sry, it hangs all time high now :shrug: ... As I use the Stop button in the browser I jus get Server is offline all over the place... Looks like some kind of iteration loop or something...

Check it out (http://rm8s.net/smfForum/index.php?page=35)

VorTeX3k
15th February 2006, 15:25
Douh, yes... omg... shoot me if there will be something with the next test ;)

you can download it again :) sorry for penetrating you ;)

misjka
15th February 2006, 15:31
OK - bam, bam ... consider yourself shot, then :razz: !

1] Good news: Offline works :thumb:
2] Bad news: Online does not :Looking_a

At least one of the two servers is online, but both turn up as Offline...:pillepall Check it out...!

VorTeX3k
15th February 2006, 15:33
Ok, I'll shoot myself at the evening ;)

Will now go home, so i will be back at about 6pm and will work on this :) Thanks and cu later ;)

misjka
15th February 2006, 15:36
Hehe, ain't that a contradiction or are you gonna work "on the other side of life" as well :D ?

No sweat... Just fun to test :thumb: .

I'll be back tomorrow at noon I think... Peace out :).

VorTeX3k
15th February 2006, 16:39
Well.. unfortunately there's no good solution for this problem. I will investigate this even more but until now it looks like a chance would be the opendir() function to do a file_exists() check afterward but opendir() will not work on remote- or FTP server when running on PHP4.x. This only works with PHP5.

So until now I'll keep it the ugly way to let the script wait for a timeout if the host file does not exist. But I'm working on this.

misjka
16th February 2006, 09:52
OK, but this means that the curren version 1.6 doesn't work at all since it reports "Server offline" whether the host is offline or not... :shrug: Will you withdraw the 1.6 release for now, then, and maybe just release a 1.5b version with the separate setup/config file...?

misjka
16th February 2006, 12:41
Btw, I would appreciate a Join! and Specatate! link beside the LFS hostname... The former to start LFS and the latter to start LFS Spectator... Is that achievable... In version 2, maybe :scratchch :D ?

VorTeX3k
16th February 2006, 13:17
No, 1.6 works but it has the problem that the script's waiting for timeout, if the hostfile does not exist.
But it's usable ;) So it's all this version 1.6 but without a check if the file exists (because this check caused that "server is offline" problem even it was online).

About your 2nd post: Is there some tool like Join2LFS that maps a specific protocol type to itself but for LFS Spectator? If not, there's no possibility ;)

misjka
16th February 2006, 14:04
Thanks, Vortex - will dl again 'n' check it out! Much obliged!

About the 2nd issue, you maybe should have some kind of collaboration with the creator of LFS Spectator...? Maybe in "the good for the LFS community" or something ;)?

VorTeX3k
16th February 2006, 14:06
Lol ;) Of course, I have. Currently he's very busy with another project. But I can ask him, by time he maybe will expand Join2Lfs

misjka
16th February 2006, 14:14
Sounds gr8 :thumb:

misjka
16th February 2006, 14:35
OK, seems to work as you implied :).

But, I wonder: Sure it must be a dedihost bug that the status line in the host file isn't changed to offline...? If that is corrected we wouldn't have the problem in the first place...?:Looking_a

VorTeX3k
16th February 2006, 17:43
Well, that's a wired question. I also wondered about this.

It's the question if this behaviour that the host file will be deleted is as it should be. I (of course from my side ;) ) would suggest to keep the hostfile when shutting down the server. Otherwise I have no idea, why it has this line "status" ;)
Maybe we have luck and Scawen has a short look inside this topic. Otherwise, I'll try to contact and ask him.

misjka
16th February 2006, 18:35
Would be great to get this sorted out, yes :thumb: !

misjka
17th February 2006, 13:02
Yet a proposition: Would be gr8 if one may see the S1/S2/Demo mode of the host as well...:)

VorTeX3k
17th February 2006, 14:41
Not possible ;) This is not logged in the hostfile. Except Scawen would implement it.

misjka
17th February 2006, 14:44
Well, almost a bug then ;)!

VorTeX3k
20th February 2006, 07:25
More a feature request ;)

felplacerad
20th February 2006, 08:57
kind of a long shot and an ugly way to do it, if you parse setup.cfg instead of hostx.txt you'll be able to extract the mode data.

also, i've disabled the "built-in" online/offline checker in vortrex3k script and replaced with my own, it goes like this:



<?php
$lfs_ip = "localhost";
$lfs_port = "63392";

$output = @fsockopen("$lfs_ip", $lfs_port, $errno, $errstr, 0.01);

if (!$output) {
$status = "offline";
} else {
$status = "online";
}
@fclose($output);

// and then ...

if ($status == offline) {
echo "status: offline
} else {

// all the output from vorts script ...

}

misjka
20th February 2006, 09:06
Gr8 move, FEL. Would be nice if you could collaborate about this and make a final (well...) product that anyone in the LFS community might use, whether he/she's a programmer or not...

On the other hand, for the future for the devs, the mode should maybe be placed in the first lfs string in the host file... I mean, lfs=S2 0.5Q etc... Guess it's nice to just use one file source to gather the information needed...?

VorTeX3k
20th February 2006, 09:24
Thanks fel for this =)

Socks conn. is a good way to do that, thanks :D I'll implement this into the script and will leave it as it is, because I don't really like to make another fopen and parse my arse of ( ;) ) to simply get the mode data.

Let's see... ;)

felplacerad
20th February 2006, 15:04
misjka, maybe you can use this ...



<?php
$mode = shell_exec('grep mode /path/to/setup.cfg');
echo "mode: ";
echo substr("$mode", 6);
?>

misjka
20th February 2006, 15:20
OK, thanks! I'll check it out!

But, ehh.... That won't work, will it, since the php script runs on one host and the lfs dedihost is on another one...??!

VorTeX3k
21st April 2006, 13:19
I'm glad to officially release the 0.5S compliant version directly after the release of the dedicated host! :)

Changes in Version 1.7:
- Added content of LfS Patch S2S:
- 4 new track configs (AS North (rev.) and AS Grand Touring (rev.)
- 1 new car ( BF1 )

Downloadlink can be found on the first post and also here:
http://lfs.gjl-network.net/index.php?act=showcat&id=6

misjka
22nd April 2006, 05:22
Thanks a lot :)!

But I receive:


Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/xxx/xxx/xxx/lfshosts/server.php on line 155

VorTeX3k
22nd April 2006, 10:03
Damn :( Not tested very well *shame*

Ok, plz download it again ;) It should be fixed now, made an error in the car list.

Big sorry for that!

misjka
22nd April 2006, 10:45
Sry, nope... Still get the error...

VorTeX3k
23rd April 2006, 19:06
very sorry about the inconvenience..

it is now really fixed :) sorry, sorry, sorry

Iceberg
23rd April 2006, 19:58
I can not connect to our server vith this one.
I get this when accessing the server.php page
Status: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus
The old server.php gives correct info!

See :http://www.dprt.dk/tserver/server.php for new version
And www.dprt.dk right side block for correct info.

misjka
23rd April 2006, 20:25
For me it just haaaaangs and never shows me the result from the host query... I'm not sure our servers are up right now, but that hasn't been a problem with the previous version...

VorTeX3k
23rd April 2006, 22:46
I can not connect to our server vith this one.
I get this when accessing the server.php page
Status: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus: offlineStatus
The old server.php gives correct info!

See :http://www.dprt.dk/tserver/server.php for new version
And www.dprt.dk right side block for correct info.
uhm.. strange :( k, sorry about this, I unfortunately did not had the time to proper test the new version.
I'll take care of this tomorrow morning and will release a new version.

VorTeX3k
24th April 2006, 08:04
Ok, this stupid bug is now fixed. I'm verry sorry about this.

You can download it right now :)

Iceberg
24th April 2006, 08:54
Works now.
I have attached a danish language file :)

VorTeX3k
24th April 2006, 08:56
Very nice! :D Thanks a lot!

VorTeX3k
20th June 2006, 14:49
Some news from my side:

I'm currently developing a complete new server script that is LFS World based especially for those users, who don't have HTTP or FTP access to their LFS server.
The script is currently in alpha state and should enter beta testing within this week. There's still a lot to do but it already works very stable (tested with a lot of hosts today).
I'll keep you informed about the process :)

HS-78
9th September 2006, 15:46
Hi - hows the new script going? Would really like to use it via LfS World!

Private[BE]
9th September 2006, 21:37
Can somebody help me with making the script i don't get it can't find information about what i have to change to what file.

misjka
26th September 2006, 12:56
Some news from my side:

I'm currently developing a complete new server script that is LFS World based especially for those users, who don't have HTTP or FTP access to their LFS server.
The script is currently in alpha state and should enter beta testing within this week. There's still a lot to do but it already works very stable (tested with a lot of hosts today).
I'll keep you informed about the process :)

Great news, VorTeX3k :thumb:... Have you made any further progress with this script?

VorTeX3k
23rd October 2006, 14:10
Sorry guys for this large delay ;) Had a lot to do, so the progress wasn't very fast.

I'm currently still working on the lfs world version.

But to keep you all up-to-date I installed a mailing list and I advise everyone that is interested, to sign in to it:
Just write an empty mail with the subject subscribe to lfsscript@gjl-network.net

Then you'll receive all information also about beta the beta phase of the LFSW version, coming soon.

@Private[BE]: Please write me a PM regarding your problem or contact me via icq, so that I can have a further look into this problem.

VorTeX3k
13th November 2006, 08:24
Testing of the LFS World version which doesn't require HTTP or FTP access to your websever is in progress. If anyone else wants to participate to the testing, please just contact me by mail :)

VJM
14th November 2006, 17:52
There is some script or some modification to do this script work in a server install in my PC? (it works 24/7 and is demo dedicated server)

VorTeX3k
20th November 2006, 07:58
There's no need for modification. You only need a webserver with PHP support. That's all.

VorTeX3k
23rd December 2006, 19:14
To make one clear to everybody, I just received a mail this day (see below) that I would not provide any instructions on how to setup my script for a forum software.

Well: THIS IS A STAND-ALONE APPLICATION! I give you all instructions you need to set up the script and get it working. It is a stand-alone application to be as flexible as possible. If it would be a mod for a f... forum-software or something like this, it would only work with this single software and would need to be rewritten for every single CMS or forum software.
So, if you are too dumb, to know this and blame me for your missing knowledge on how to place a link to the script or embed it via an iframe, it is not my problem.

And I post this, because I'm not interested to get mails like this again..

You give us 2 php files and that’s it



No ****ing instructions



Nothing



U say what to edit and then upload it.



You don’t say how to put it in the forum, or how to link it to the forum



Or anything



YOU'RE A ****ING DISGRACE!!!!!!!!!!!!!!!!!!!!!!!!

--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.18/585 - Release Date: 12/13/2006 11:49 AM

Davo
23rd December 2006, 19:20
Testing of the LFS World version which doesn't require HTTP or FTP access to your websever is in progress. If anyone else wants to participate to the testing, please just contact me by mail :)

I'd be interested, plz PM details or an email addy. Cheers :)

Cr45h
4th January 2007, 13:59
News about these scripts?

I've downloaded both, but nothing works.. The online racers say that it couldn't get data from LFS World due to an unknow problem, the server.php page says that it can't connect to the server to retrieve infos.

About _data_config.php, in a certain line u say that I have to put the path of the folder, right?

But, if i host the server on my personal pc, under Winzozz, and the lfs.exe host is under, ex: g:\LFS HOST\lfs.exe I have to put the entirely path, so G:\LFS HOST\ or something different? :scratchch

Thanks 4 help, and Happy New Year to all!

Cr45h

VorTeX3k
8th January 2007, 12:46
News about these scripts?

I've downloaded both, but nothing works.. The online racers say that it couldn't get data from LFS World due to an unknow problem, the server.php page says that it can't connect to the server to retrieve infos.

About _data_config.php, in a certain line u say that I have to put the path of the folder, right?

But, if i host the server on my personal pc, under Winzozz, and the lfs.exe host is under, ex: g:\LFS HOST\lfs.exe I have to put the entirely path, so G:\LFS HOST\ or something different? :scratchch

Thanks 4 help, and Happy New Year to all!

Cr45h

To the problem with the Server script: I think you misunderstand one point: The hostfile must be accessible via a FTP directory. So you need a FTP running on your live for speed server with the game directory (in your ex. g:\LFS HOST\) accessible via FTP. Afterwards you must configure the _data_config.php to access this FTP server (by entering the email address). The path that has to be entered is the relative path seen from the root of your FTP.
So if you configured you FTP to have g:\LFS HOST\ as root path, then you have to leave the $hostpath variable empty. if you for example configured g:\ as your ftp root, the $hostpath must be "/LFS HOST".


Regarding the RacerOnlineScript: Please check if you have a cache.txt file within the directory you run the script from. If not, check that this directory is writable for the webserver. If there is a cache.txt file, check what's written in there and how big it is. If it is much larger than some kb (eg. some MB) than we need to check this problem further, if the file is small and than some error message may be written in it.
If the file is created but is completely empty, check 2 things: Try to delete the file and create it manually, set the CHMOD to 777 (access rights writable). If this still does not help your PHP installation may block access to external URLs. This is done through the configuration variable allow_url_fopen. The script can only work if this is set to enabled. So check this within your php.ini.

Cr45h
17th January 2007, 09:33
Hm... For server script... It works very great!

But, about FTP....I don0t understand very well what it does instead of http... 'cause now i have the config file with no ftp specification, and, it works with no problems.

The FTP option what does if I activate it? :scratchch

Anyway... congrats for script!! :thumb:

VorTeX3k
17th January 2007, 09:56
If you use FTP, the script also accesses a FTP server, HTTP does the same but accessing the data through HTTP. Those are different protocols and runnning in different servers.
So for example if you have a default HTTP access configured to http://blah.test it may be configured in the HTTP server to point to the local directory "C:\webserver\http" whilst the same domain as FTP (so port 21) (ftp://blah.test) could be configured in the FTP server to point to "C:\ftp dir".
So it is no "must" that an address accessed via FTP or HTTP point to the same direction.

And thanks for the congrats :D

wonderous
15th March 2007, 20:22
Lets say a host starts an online game. It creates a hostxxxxx.txt file right?
But when the host leaves the game the hostxxxxx.txt file disappears. When this happens the output file "server.php" displays the error msg

<b>Warning</b>: fopen(......../host63392.txt (http://www.theohbrothers.com/myservers/lfs/host63392.txt)) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>.../server.php</b> on line <b>165</b><br />

It writes this error (which is generated by the server)at the top of the output file, and it spoils the look of the output file,
this happens because of this line
$datei[$c] = fopen($filepath[$c], r);
Opening the file directly in this manner will return errors if the file is not present.
is there a way to modify the script such that is does not "open" the file but checks if it's there in the first place then outputs "Server is 'Online' or 'Offline' " instead of the php error message like the one mentioned above it really spoils the look of the output file

Thorvertonian
13th December 2007, 13:32
Will this script be updated for x30 or are you waiting for patch y?

not demanding a new version! Just wondering if it will be updated!

DanielC
13th December 2007, 14:07
Dunno which version of the script I originally had, but with a few tweaks it works fine with X30 / X31 ... :)

http://www.sillyproject.com/liveforspeed/

X31 servers are at the bottom of the page ... :D

Direct access to the txt file as well, not http ... :thumb:

Thorvertonian
13th December 2007, 14:12
Only thing I can't get is it to display FBM! some help please on the tweak to make this possible?


[Don't worry, I've managed to figure it out!]

DanielC
13th December 2007, 14:20
Add this after SO5R ...

if($track=="SO6")
$trackName = "South City Chicane Route";
if($track=="SO6R")
$trackName = "South City Chicane Route Rev.";

Add an extra 1 in the line of 1's ...

function get_cars($cars, $showAll, $showLanguage)
{
$i = 0;
$j = 0;
$j2 = 0;
if(trim($cars)=="11111111111111111111" && $showInfo[4] == 1)

Add the case 19 part for the FBM ...

case 18:
$carlist .= "BF1";
break;
case 19:
$carlist .= "FBM";
break;

Annndd, I think that's it, unless I've forgotten something ... :D

VorTeX3k
5th January 2008, 15:35
Thanks for your support ppl! :) I just released the new Version 1.9 containing DanielC's changes (thanks to you!).

I also added a small fix to avoid occuring wonderous' problem.

The download can be found here at sourceforge:
LFS ServerScript 1.9 Download @ Sourceforge (https://sourceforge.net/project/showfiles.php?group_id=187628&package_id=219169&release_id=566144)

BOSCHO
6th May 2008, 08:48
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Program Files\xampp\htdocs\server\server.php on line 182

how to fix that ?

doowle
14th May 2008, 20:49
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Program Files\xampp\htdocs\server\server.php on line 182

how to fix that ?


BOSCHO i had the same problem, i'm nor programmer and have little php skills but i think it has something to do with the script not being able to access the file.

I got around this by removing this line in server.php

$filepath[$c] = $serverprot[$c] . "://" . $ftpuser[$c] . ":". $ftppw[$c] . "@" . $serverip[$c] . $hostpath[$c] . "/host" . $lfsport[$c] . ".txt";

and putting this line in _data_config.php in the connention info for Server 1

$filepath[0] = "/lfs/host63392.txt";

I can do this as the php scripts are running on the same server as the LFS dedicated server (that may not be the case for you)


I also had to change;
die "File access error!";

for
echo "File access error!";
exit();

In server.php

Not really a fix, but certainly a work around!

Doowle

A.Fedorov
16th May 2008, 03:32
in old version i make
_data_config.php
/*************START SERVER 1*****************/
$hostpath[0] = "d:\\LFS_Y\\";
$lfsport[0] = "63333";
/*******************************************/

/*************START SERVER 2*****************/
//$hostpath[1] = "d:\\LFS\\";
//$lfsport[1] = "63392";
/*******************************************/

server.php
$serverCount = count($hostpath);
$c = 0;
while($c < $serverCount)
{
include setLanguage($showLanguage);
$filepath[$c] = $hostpath[$c] . "host" . $lfsport[$c] . ".txt";

LFSCruise
28th May 2011, 21:02
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/***/domains/***/public_html/server.php on line 182

Help

DavidTiger
28th May 2011, 21:22
See this - its only a few posts up!!! (http://www.lfsforum.net/showthread.php?p=798045#post798045)

Nathan D.
25th February 2012, 04:52
Would it be possible to a add feature to show the online racers' statuses by putting the following beside (to the right) each online racers' name? http://www.lfsworld.net/isonline.username

cargame.nl
25th February 2012, 07:24
No... Somehow Scawen decided to put playernames inside hostXXXXX.txt instead of usernames :really:

You have to retrieve; http://www.lfsworld.net/hoststatus/?h=cargame.nl+S2 (example)

and strip the information you need.