The online racing simulator
Searching in All forums
(234 results)
MonkOnHotTinRoof
S2 licensed
I remember someone else had that kind of problem long time ago. He was using normal (non-dedicated) server. Didn't figure out, why this was occurring tho, usually this doesn't matter...
MonkOnHotTinRoof
S2 licensed
This is not enough, some commands do not work anymore, so you need version 3.8 AND also replace all car names in PB.txt with short car name (use an editor capable of replacing text), if you want to keep old records.
MonkOnHotTinRoof
S2 licensed
There is a link to php version made by Gai-Luron somewhere in this thread.
MonkOnHotTinRoof
S2 licensed
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...
restoring last window position and size
MonkOnHotTinRoof
S2 licensed
I think it was suggested one time before, but I can't see it in list.
I use switching between full screen <-> window a lot, and I know I am not the only one . It's quite annoying to resize and set position of window every time...
MonkOnHotTinRoof
S2 licensed
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.
MonkOnHotTinRoof
S2 licensed
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...
Last edited by MonkOnHotTinRoof, .
MonkOnHotTinRoof
S2 licensed
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).
MonkOnHotTinRoof
S2 licensed
When player times out, LFS could output InSim packet (PTO?), instead of writing language dependent message "nick timed out". Not directly related to InSim, but WRONG WAY (and flags) message is really annoying, cannot be turned off, and it cannot be overwritten with rcm message (option somewhere in menu to disable all these default center messages (but still allowing custom rcm messages) would be great). I would suggest packet for notifying about resetting player's car, but in next? patch not allowing reset will be possible, so this is not necessary . Otherwise, most important are pitting messages already described by above posts .
Taking over cars, InSim
MonkOnHotTinRoof
S2 licensed
Anyone knows what happens (from InSim POV) when car is being taken over ? Same packet is received as for renaming. But what happens with uniqueids of both players ? I know, I could investigate this myself, but if someone overcame the problem, no point in spending time on it . How to detect this ? Compare if nickname is already used (if it is not, it is casual renaming, otherwise take over)?
MonkOnHotTinRoof
S2 licensed
I don't see why not. Just need to use different ports.
MonkOnHotTinRoof
S2 licensed
Quote from Mladen[CROtm] :Yes i need just one signal- gfor shift light. 12V i can reduce with resistors...
What is DTR? I want to write signal output in vb...

pins on your port on PC :

1 2 3 4 5
6 7 8 9

pin 4 is DTR output
pin 5 is GND

(check docs on net if this is correct)

You can use following windows API to change DTR signal (you have to open serial port first with CreateFile API):

BOOL EscapeCommFunction( HANDLE hFile, DWORD dwFunc);

where dwFunc is CLRDTR or SETDTR to lower/raise signal and hFile is handle to a file (serial port actually)
Last edited by MonkOnHotTinRoof, .
MonkOnHotTinRoof
S2 licensed
Quote from Mladen[CROtm] :Hello! Can somebody help me? I am about to connect shiftlight on a COM port... I had it connected to LPT but now i want to attach something else on lpt- tachometer... I dont know which pins are for input, and which are for output on a COM port. In short i don't know anything about com port so link on schematichs would be usefull... I just hope that programming in vb for COMport i similar to lpt programming... Thnx!

Serial port is completely different animal than LPT. You can control(read) LPT pins directly, but with serial port you need a controller (com port only has 1 line for reading (Rx) and one for writing (Tx) (actually it has other lines, but are pretty much useless), so controller must deal with assembling those bits together, put bytes into fifo queue, synchronizing all the stuff, generate irqs, etc... There are ICs that do that for you, but it still may prove to be little more annoying than you think it is...

If you only need one signal line you can get away with it easily: just use one of the control signals such as DTR... (beware: you are dealing with 12V here)
Last edited by MonkOnHotTinRoof, .
MonkOnHotTinRoof
S2 licensed
I merged changes into 3.6. Gai-Luron, please update your copy (small differences in some files).
MonkOnHotTinRoof
S2 licensed
You can customize settings by modifying lfslapper.cfg in cfg directory.

Quote from niffer022 :
is there a way for it showing your split times automaticly as soon as you have done that section???

You can lower max split times to do that, note that this is public message and can be annoying if it pops up everytime someone passes split line...
It is intended only for very good splits.
In 3.6 version you have another option to do private messages of splits (check end of LFSLapper thread)

Quote from niffer022 :
how do i turn off the drift scoring.....

Just delete action or raise score threshold.

BTW, LFSLapper thread is here:

http://www.lfsforum.net/showthread.php?p=43389#post43389
MonkOnHotTinRoof
S2 licensed
Quote from Anarchi-H :Hmm, good stuff. I think I'll keep digging

Tnx for sharing. I thought that could be the reason. I will spend some more time on it too, cause it's a nice language. But I am already missing GUI library in phobos. As long as there is no portable GUI, I will have to stick with java, which unfortunately feels so slugish (which is weird, cause C# on the other hand seems more responsive, even if tests show, it's not any faster).
And as angry angel says, namespaces are a bit messy (slowly getting used to it however).
MonkOnHotTinRoof
S2 licensed
Quote from Anarchi-H :I wonder what extra stuff D has to put in to support the new language features and how much of it is really necessary

Probably the cause is static linking with phobos library. If you skip the imported write function, size drops to 64k. Uhm, which is still a lot for an empty main func . Sure, managed memory and such features take their toll, but still...

Of course, if you statically link C++ code with CRT, you will also end up in 100k or even 1M file size, depends on your CRT provider...
About speed: you can't expect that language with managed memory will be faster than C (which is medium-level lang), but well optimized code could get very close...
Last edited by MonkOnHotTinRoof, .
MonkOnHotTinRoof
S2 licensed
And in D:


import std.stdio;

void func(char[] arg1,char[] arg2)
{
writef("%s\n%s",arg1,arg2);
}

void main()
{
func("123","4343");
}

which compiles to about 100K exe file
Code looks a lot like java
Last edited by MonkOnHotTinRoof, .
MonkOnHotTinRoof
S2 licensed
Seems like a very nice concept. I was wondering many times why this kind of language doesn't exist yet. Something that is as productive as C#, fast as C (or even better hand-crafted asm) , and has all the standardized portable libraries you need (no such language yet or maybe java ?).
MonkOnHotTinRoof
S2 licensed
Quote from Davo :1 minute is too long. 30 seconds should be enough. Perhaps for longer races more time and shorter races less time.

Server specified count would be much better...
MonkOnHotTinRoof
S2 licensed
Quote from Mac... :
Mene pa zanima kam se shranijo podatki ki jih vidiš če napišeš !top ali !stats, in če se jih da resetirat. Problem imam tudi s tem ker mi samo !stats dela, pri !top pa mi napiše samo en rekord in še ta čist nek slab cajt, od drugih pa jih ni.

Podatki se hranijo v PB.txt. Če zbrišeš ta fajl, preden štartaš program, boš resetiral rekorde. !top brez dodatnih argumentov ti izpiše čase za privzet avto (ki je XRT). Za XF GTI lahko uporabiš recimo !top XFG. Lahko tudi spremeniš privzet avto v nastavitvah (v lfslapper.cfg, oz. skripti, ki jo uporabljaš). Komande (in ostalo) imaš opisane v doc/readme.txt.
MonkOnHotTinRoof
S2 licensed
Quote from Chris758 :
AutoAction =
TAB here swearword1:swearword2:swearwordetc |No Space here/kick {Nickname}:/rcm {Nickname} was kicked for profanity!:/rcm_all

Also, will this pick up any message which has the words in, or only when the words are sent on their own?

All messages that have these words in.
MonkOnHotTinRoof
S2 licensed
Assuming you want to use NT kernel (Windows NT/2000/XP), you first need driver to give you access to ports (at least parallel data port). Then it is just a thing of writing proper byte to that port (using outgauge functionality). This article might help:

http://www.codeproject.com/csharp/csppleds.asp

Integrate this example with sdether's library and write some glue code...
MonkOnHotTinRoof
S2 licensed
Quote from magicius :i want to have BFS,CSR and auto message work at same time

AFAIK BFS (if you use insim functionality) and auto message (from crazyice ?) use insim, so you need insim gateway to run both at the same time. CSR is pure outgauge app, so you don't need anything (as long you don't want to run another outgauge app), you can even run it from BFS (But you will probably have to manually adjust priority in this case as BFS can't do it).
WebStats updated
MonkOnHotTinRoof
S2 licensed
WebStats, compatible with new output format is uploaded for those who use it on their servers. See first post for download...
FGED GREDG RDFGDR GSFDG