The online racing simulator
Can someone share config?
I have problems with it. I changed ports and ip. But still have problems. :/
Server passowrd and insim port should be the same as in lfs. Shouldn't matter where lapper is installed, but I like to have it in the lfs folder.
Typing /insim 29999 makes insim use 29999 as the port. So make sure it's the same number you type as in the config. No port forwarding should be necesary as it's on the same machine, localhost.
Is it possible to use LFSLapper over the LFS insim relay?
Ya but u do launch before another soft named "Race Manager" and start Gateway module.
After u can launch many insim applis (lapper include)
Could someone point me to the program that allows hosts to display live timings and race control messages. ie things like "Great split by whoever xxx etc
Venus, just be sure to adjust the default "great split...." if you are going to use that. It really bugs me to pull out of the garage at Westhill, run down the pitlane at 48 mph, cross the line and start accellerating to see a "Great split by NightHawk: 33.25 s" in the FZR, LOL. That's about 15 seconds off the pace and is definitely not a "great split".

I can't stand seeing those "great split...." messages actually. It compounds even worse in my dislike when folks have it set to ridiculous times.

Less spam in the chat, including LFSLapper... +1!
A question about Webstats
Hi, anyone knows how to build a linux C++ cgi ?
The precompiled cgi (both for windows and linux) came with Webstats. But i didnt' like the design of the output page so i made some changes to the source file. Now how do I compile the source into a linux cgi?

The readme file doesnt touch deeply into building the cgi

Quote :+========================================+
| Compiling from source (advanced users) |
+========================================+
Linux:
------
makefile is provided for linux users (g++ and make required). Type "make" in console.
Windows:
--------
sln and vcproj are provided for Windows users (MS Visual Studio required). Open solution and build.
Other OSes and/or C++ compilers
-------------------------------
Use your favourite C++ compiler (must have STL support) and compile main.cpp to WebStats.cgi

All it says is build the solution either by typing "make" for linux users, or build by opening thevcproj with MS Visual Studio (I currently have MS visual studio 2005 installed, but I dont know how to build it into a linux cgi. I read some tutorials online but they only teach me how to build windows cgis, but I need is not a windows but a linux cgi can someone teach me how to do this? I really hope to get this done as soon as possible. Any help would be greatly appreciated
Quote from wonderous :Hi, anyone knows how to build a linux C++ cgi ?
The precompiled cgi (both for windows and linux) came with Webstats. But i didnt' like the design of the output page so i made some changes to the source file. Now how do I compile the source into a linux cgi?

The readme file doesnt touch deeply into building the cgi



All it says is build the solution either by typing "make" for linux users, or build by opening thevcproj with MS Visual Studio (I currently have MS visual studio 2005 installed, but I dont know how to build it into a linux cgi. I read some tutorials online but they only teach me how to build windows cgis, but I need is not a windows but a linux cgi can someone teach me how to do this? I really hope to get this done as soon as possible. Any help would be greatly appreciated

Visual Studio (Visual C++ actually) can not compile source into Linux executable (it is not a cross compiler). I suggest you compile source on Linux with g++. It very probably comes installed along with your Linux distribution. You just have to compile main.cpp into executable and rename it into cgi (makefile is already provided for convenience, but if you don't have it installed, you can compile with g++ main.cpp -o WebStats.cgi).
I've installed g++ on my system, it's a rather old version and doesn't support the mkdir -p ./bin/Linux well, so i didn't make use of the makefile, i just ran g++ main.cpp -o Webstats.cgi and I got a 963KB file.

I noticed this file is huge when compared to the procompiled linux cgi file(56.2KB), is there something wrong with the compilation? and by running that command in the cmd prompt (I'm a windows user) does it create a windows or a linux? I'm still getting errors on my website, same 500 server error .....
Quote from wonderous :I've installed g++ on my system, it's a rather old version and doesn't support the mkdir -p ./bin/Linux well, so i didn't make use of the makefile, i just ran g++ main.cpp -o Webstats.cgi and I got a 963KB file.

I noticed this file is huge when compared to the procompiled linux cgi file(56.2KB), is there something wrong with the compilation? and by running that command in the cmd prompt (I'm a windows user) does it create a windows or a linux? I'm still getting errors on my website, same 500 server error .....

Your version of g++ probably links with static library. If I compile with:
g++ main.cpp -o WebStats.cgi --static
I get 1.2M file

with stripping symbols and optimization (g++ main.cpp -s -O3 -o WebStats.cgi --static) I get 889K file.

However by default my g++ uses dynamic linking(g++ main.cpp -s -O3 -o WebStats.cgi), and in this case result is 57K file (but you need libraries to run it).

You can check with ldd, if executable is dynamic executable:

janez@monkster:~/work/WebStats/src$ g++ -s -O3 main.cpp -o WebStats.cgi
janez@monkster:~/work/WebStats/src$ ldd ./WebStats.cgi
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4001e000)
libm.so.6 => /lib/tls/libm.so.6 (0x400d9000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x400fb000)
libc.so.6 => /lib/tls/libc.so.6 (0x40104000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

But that really doesn't matter . It should work in both cases.
You can check if it works by running it:

./WebStats.cgi

it should print on console:
Content-type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or
g/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>LFSLapper WebStats</titl
e><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><b
ody bgcolor="gray">
<p>Could not open file PB.txt</p>
</body></html>


If you made changes to main.cpp, and then you get internal server error 500 (but original unmodified version of WebStats works), then you screwed up something in source...
Both both the original unmodified version and the one i compiled gave me the same error message, i'm quite certain that I modified the code correctly, and didn't miss out any ';' or forget to type \ before a " for the html output.. cuz before this i told you i used microsoft visual studio 2005 to compile it into an .exe file(compilers would have detected coding probs so they are very unlikely) and i ran the compiled .exe file and press pause/break button it did print the scores(the PB.txt file was in the same folder) I read the html code it was perfect.. so most likely there's no prob with my modified version of main.cpp. i think is the problem lies with the g++ compilation.. did i install g++ correctly on my windows system?

Did some research and eliminated causes of probs...
- I used the unmodified html and LINUX cgi that came in the package, but I still get the same error as when i used the modified html and cgi file
- I uploaded WebStats.cgi in ASCII mode, (uploading in binary can cause that error)
- ensured the file permissions 755 (the support told me to set it to 755 in order or it to work)
- My own coding errors would have been detected by the compiler
- I ensured there are no broken links
- my webhost couldn't have blocked it for security reasons or else why did it state it supported cgis?

Likely problems
- g++ software not installed correctly in windows(it's not updated version, about 2 years old) ---> most probable

How about you help me compile it? but the prob is when you're uploading to this forum will it be in binary..

Notes
-My webhost: Bluehost http://www.bluehost.com/
-The site I'm testing on http://wonderous.theohbrothers.com/ (Best viewed with MSIE 6 or 7) click on home wait when it loads at the top click "View live for speed server status" then a page will load showing the server status then again at the top click "View LFSLapper Stats" and it'll bring you to a page (Webstats.html modified that looks quite different from yours, but I'm using the unmodified WebStats.cgi now)
then click the button and it returns a weird error.. see for yourself
ran the WebStats.cgi this is what it returned

Quote :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Creator: Wonderous //-->
<head>
<title>LFSLapper WebStats</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="misc/WebStats.css">
</head>
<body style="background-color: transparent">
<div id="Layer 1" style="position: absolute; left:0px; top: 0px;">
<p>Could not open file PB.txt</p>
<b><font color="white">· LFSLapper output information </font> <font color="yellow">is powered by</font> <font color="00FFFF">WebStats v1.2 !</font> Script developer: <a href="http://monkster.hoopto.org/~janez" target="_blank">Janez Cufer</a><br></body></html>

image:


Copy and paste that into a txt file and change the extension into html, I did that I saw it's all perfect right? Actually one thing i dont understand, this is a linux cgi right? how come my windows system was able to run it then?

erm, edited the post.. this is actually how it looks like when the PB.txt file is in the same folder, the output is perfect, so I'm assuming there's no error with the code?
Quote :

It's a binary. It must be uploaded to server that way. In ASCII mode it gets corrupted. And I don't see first line (Content-type: text/html) in your console output . Yes, it has to have executing permission for all users (755) like your support said.

If you can send source to me, I can compile it on my Linux machine and see if it works...

You compiled source on your Windows machine and then uploaded cgi to their Linux Web server ? Are you sure the compiled binary is for Linux. I have a feeling you compiled for windows (that would explain why you can run it on windows)...

Here is WebStats.cgi (zipped) again, this time statically linked, to avoid library mismatch problems. Upload it to linux server as BINARY.
Attached files
WebStatsLinuxStatic.zip - 349.6 KB - 256 views
It Worked!
HEY I USED THAT FILE YOU UPLOADED IT RUNS! But it now gives me the error message "Could not open PB.txt" I've uploaded PB.txt and DriftPB.txt in the cgi-bin how come it's says it can't open it? unless it does not have the permission to do so? where is it trying to locate the file from

well, i edited the output file even more this time, compiled the cpp with MS Visual Studio into an exe, ran the exe and
here's the hotlapping output(this time with "Content-type: text/html" on the first line)

And this is the output for drifting:

both of them output the way i want them to be, extremely neat, so after reading the output i certain there're no bugs in the cpp file,
here's the cpp file:
main.txt
Had to upload in txt, change the file extension to cpp and that's it!
Thanks a lot for compiling this for me.

Hey just wanted to inform you that i added you to MSN, foxtrot_envoy@hotmail that's my email, so we can get this done faster, i'm on almost 24hrs a day(although i might not be at the computer)
when i need you to compile another edited version then i'll ask you on MSN isn't that much more convenient haha
Attached files
main.txt - 13.9 KB - 307 views
-
(MonkOnHotTinRoof) DELETED by MonkOnHotTinRoof
Here's my cpp file attached:

Thank you very much, i really appreciate your help.. i'm off to bed now I'll reply tomorrow, as soon as i can
Attached files
main.zip - 3.9 KB - 241 views
Hello,

My question it's probabily stupid, but why don't you use PHP to view result of PB file on your Web site?

Gai-Luron
I guess it's the preference of the developer.. php is not compiled file it's like c++ or java or any other language that you code in.. it is only compiled when the file is ran on the server and because of that it runs slower than compiled files like exe or cgis, that's a flaw of php, also, because you dont use a compiler to check for errors in the code you have to check to make sure the script has no coding errors and that can be tough especially when the code is subject to frequent modifications
Actually, resolving errors in binary CGI is pain in the behind, cause all you get is 500 internal server error . True, it is much faster and uses less resources (specially if written in assembly language)...

I setup gnu c++ (g++) compiler on
http://monkster.hopto.org/~janez/onlinegnucpp.html

so you can experiment without having Linux installed. If your source is correct, you will be able to download compile.cgi (rename it to proper name - WebStats.cgi), if not, you will get error output from compiler.
It's a slow machine, so compiling may take a while...
Actually, monk, have you ever thought of changing the program from c++ to php? I think lots of us would prefer that, because we dont have to deal with any incompatiblility issues (like whether it's linux or windows cgi) php runs on almost every server so I would really like this to be programmed in php actually aha But then many will come to you telling you they get errors and such only to find they screwed up the source when modifying it (That means you'll be bombarded with more noob probs haha)


oh yeah forgot to thank you for so much hard work you put in this mod.. really enjoy LFSLapper
There is a link to php version made by Gai-Luron somewhere in this thread.
Hi,

I'm trying to get this to work, and it just won't work. I downloaded Mono 1.2.3.1 . Installed it, then ran it. The shell popped up. I then changed to lfslapper folder. Started my server, joined. Typed /insim=29339 (my insim port - also tried 29999). Then I ran the mono start bat file in the bin folder of lfslapper. Everytime, it crashed.

I created a database folder, created two files PB.txt and DriftPB.txt. Then I put that into the cfg with database=path to files (can't be bothered typing it). Everytime I get the same error. Connection reset by peer. Then a whole mess of coding stuff I don't understand.

If you want me to post a screenie, i will.

Jeez, couldn't you have just made it into a normal program rather than having to mess with all this stuff. lol

V
Dude, probably the mono isn't working? have you tried running WinMSBuild.bat file(requires Net framework 2.0)?
http://www.microsoft.com/downl ... 5e04f5&displaylang=en
to download .NET framework 2.0, it's a lil large and requires a genuine windows cdkey to download.. after installing reboot and you're ready to use WinMSBuild.bat i'm sure if you follow these instructions closely you wont see "crashing" or "blue screen" or "error report" kinda stuff.


First configure the LFSLapper.cfg in the cfg directory(like changing the password, once your done run WinMSBuild.bat you should see:

some warnings, ignore them, close window. Now LFSLapper.exe file has been compiled and is now ready in the bin directory , i suggest you create a LFSLapper shortcut. right-click and drag LFSLapper.exe onto the desktop and select create shortcut. Then right click the shortcut and select properties, in the target box paste the following line *not forgetting the double-quotes*(if you've already done this move on)
Quote :"C:\.....\bin\LFSLapper.exe" "C:\.....\cfg\LFSLapper.cfg"

replace the .... with the location of LFSLapper directory

Once youre done with the shortcut first run LFS, start your server, start the game and type /insim 29999 (or 29339) **lfs can only communicate with programs with one port you either choose 29999 or 29339(default is 29999) not both**. if you select other ports you have to modify the port number the LFSLapper.cfg (default is 29999)and recompile with WinMSBuild.bat
Now run the shortcut and you'll see:

minimise this window. If you see warnings like "the PB.txt or DriftPB.txt file is not yet created" dont worry about it. it will be automatically created later on. Once this is done, make sure you pit in the game, and exit the pits. Then the mod will run.

In the future if you make any modifications to LFSLapper.cfg just run the build file then run the shortcut,and pit in the game, it's as simple as this
Good luck installing, feel free to ask if you have other problems.

LFSLapper - Another Insim Mod
(616 posts, started )
FGED GREDG RDFGDR GSFDG