The online racing simulator
LFSTop tracker
(116 posts, started )
LFSTop tracker
After several months of development I am ready to release first public version of my tracker.

Here is what it does and what it has:
  • Top server laps (!top)
  • Average of 3 consecutive laps (!avg)
  • Theoretical best lap (!tb)
  • Theoretical best lap during 1 stint (!tbs)
  • For all of the above there is separate table for each tyres compound combination as well as combined table where the best result of every driver is merged
  • Also, everything is split to clean-only and nonclean+clean,
  • Detailed stint information: lap-by-lap info, average lap and theoretical laps (!stint)
  • Custom cars and classes, using newly introduced IS_HCP packet, so you can set up easy to join balanced classes servers (handicap can be applied automatically, note: it doesn't clean up after you shutdown LFSTop so you might need to restart your server or just type !cars ALL before shutting down LFSTop)
  • Configurable Hot Lap Validation Check system. You can set different options for LFS stock tracks and custom tracks (per-track override is available, for example if you want to count drafting as clean on oval tracks)
  • User-configurable settings for laptimes notifications (!opt)
  • Airio importer (put your Airio.sta.* files in lfstop directory and run lfstop_airio_import)
  • Unicode chat logging
  • Can be translated to any of the language that is supported by LFS (and any others that can be used inside LFS chat)
  • Custom info windows (for custom commands like !info, !rules, etc)
The intention of this Yet Another tracker is to have a simple yet usable tool for racers and hotlappers.

Limitations and defects:
  • To change settings you have to restart the server (you can only change allowed cars list with !cars command, but can not define any cars and classes)
It is still in early development and haven't experienced any serious testing, so use it at your own risk : )

Note for linux admins: you need to run it from the directory where config.ini and others lay in, like this:
cd lfstop-1.0.0-linux-i686; ./lfstop

LFSTop is free software under GPL.

Source code, issue tracker: https://gitlab.com/fiasco/lfstop

Translation service: https://www.transifex.com/lfstop/lfstop/

Download: Linux Windows

Changelog: https://gitlab.com/fiasco/lfstop/blob/master/CHANGES
Nice :*
Uploaded v1.0.1 with handicapping fixed on initial connect.
Is this for running on servers or works offline too? (cant test atm)
+1 for making it OS
Quote from Gutholz :Is this for running on servers or works offline too? (cant test atm)

There is not really much point in making it work offline, apart from !stint feature (and being always #1 in !top if you don't provide pubstat key for WR downloading feature). I don't think it will work properly offline atm. But I will consider making it so.

Also I want to make it working with replays for debugging and being able to hotlap with historical heroes of online racing after you gather replay data and then run the app offline or on dedicated server.

All of those are future plans... And lately I can't contribute as much time as I want into this.
Thumbs up
Version 1.2.0 released. Download: Linux Windows

Changes:
  • Implemented switcher for splits/sections in !top, !avg, !tb, !tbs, !pb commands (see http://i.imgur.com/FlNzldL.gif)
  • Added configurable !recent command: Number of drivers stored option, Restricted to admins only option
  • !ver command added displaying version info, uptime and bytes read/written
  • Can now find specific username doing db query (!top, !avg, !tb, !tbs) (like !top Scawen, !top me)
  • Can now scroll to N'th position in the query window (like !top 13
  • Create running.pid file while running to prevent multiple instances
  • Showing admin commands to admin in help window
  • Linux build produced in release mode shrinking binaries size twice
  • Some small fixes and improvements no one will probably mention
Tested this program a while back, seems nice!
Hope it will be the next big thing, because due to years of no development on Airio its becoming less and less compatible with LFS.
Quote from vitaly_m :Create running.pid file while running to prevent multiple instances

What if your program crash? It won't be able to start next time, right?
That is usually done using mutexes. Also be careful about working directory and path to exe, LFSLazy stores all files based on path to exe.

void PreventMultipleInstances()
{
HANDLE m_hMutex = 0;
char text[512];
GetModuleFileNameEx(GetCurrentProcess(), 0, (LPSTR)text, sizeof text);
*(strlaststr(text, "\\")+1) = 0;
char MutexName[256];
sprintf_a(MutexName, sizeof MutexName, "LFSTop_PTH_%d", hashC(text));
m_hMutex = CreateMutex(NULL, FALSE, MutexName);

if (GetLastError() != ERROR_SUCCESS)
{
HWND h= FindWindow(WindowClassName, 0);
if (h)//bring window to front if already running
{
SetForegroundWindow(h);
ShowWindow(h, SW_RESTORE);
}
exit(0);
}
}

Quote from DANIEL-CRO :
That is usually done using mutexes. Also be careful about working directory and path to exe, LFSLazy stores all files based on path to exe.

Are you proposing to get the LFSTop window to foreground if it is running already? This is not the thing I would want to do, since I want to allow multiple instances (for example you want to run one instance for one group of LFS servers and another instance for another group of servers -- maybe you are running a hosting service or something like that), but I want to protect the folder containing all the databases and configs from multiple instances working on it.

Quote from DANIEL-CRO :
What if your program crash? It won't be able to start next time, right?

That is true. To overcome this I might need to create watchdog process that will monitor the state of the server and clean up running.pid if it crashes. The watchdog thing is quite usefull thing for daemons (daemon term is translated as 'service' term for Windows world). Using watchdog I would be able to restart cleanly (not just rerunning the whole code that currently lays in the main() function) and do other fancy things. But those things are in future, so with current version you have to deal with crashes by yourself.
I've tried the linux verson. I created a dedicated user "lfstop" to start the server/service. This user own the whole directory where the binary/files are. Currently I can't start lfstop as this user.

Of course I start lfstop in the root directory of lfstop (in my case under /data/lfstop). But I get following error message.

lfstop@gamer:/data/lfstop> ./lfstop
15.11.2015 18:35:49.038 INFO ====================================
terminate called after throwing an instance of 'std::runtime_error'
what(): can not open file: 15.11.2015 18:35:49.039 INFO ====================================
Aborted
lfstop@gamer:/data/lfstop>

I don't know which file can't be open. Any idea what's wrong with my setup?
After posting my Problem I've found the issue. :-)

The directory /data/lfstop itself was not owned by user lfstop.

Everything works fine now. Thanks
Quote from Pasci :After posting my Problem I've found the issue. :-)

The directory /data/lfstop itself was not owned by user lfstop.

Everything works fine now. Thanks

I am glad you have it sorted now Smile
Hm... other problem:

15.11.2015 18:40:48.525 INFO [srv1] Connect success
15.11.2015 18:40:48.551 INFO [srv1] loaded track database: AS4
15.11.2015 19:16:25.929 INFO [srv1] Admin command: /laps 10
Segmentation fault

Because of admin command "/laps" your program quit! I can reproduce this behaviour. But I don't find any other hint in the logs. :-(
Quote from Pasci :Hm... other problem:

15.11.2015 18:40:48.525 INFO [srv1] Connect success
15.11.2015 18:40:48.551 INFO [srv1] loaded track database: AS4
15.11.2015 19:16:25.929 INFO [srv1] Admin command: /laps 10
Segmentation fault

Because of admin command "/laps" your program quit! I can reproduce this behaviour. But I don't find any other hint in the logs. :-(

I can't reproduce it on my pc, but obviously this is a bug...

Do you have gdb installed on that machine? It would be great if you could provide me backtrace.

1. Enter the directory as you normally do

cd lfstop

2. Start gdb session recording output to a log file

gdb ./lfstop | tee debug_output.log

3. When gdb shell opens, run the program

run

4. Execute the /laps command on the server to cause the segmentation fault.
5. Ask gdb to print backtrace:

bt

Then type enter until you see the whole backtrace (in case it gets long) and type ctrl+d or quit to finish debgging session.

After you done this post me the content of that debug_output.log file.
In the meantime I have also crashes with other commands. By the way: Also if I send the command "!" to hide the info boxes of LFSTop.

You will find 2 debug logs attached. Perhaps you will found out whats wrong.

With which user do you start lfstop? root or a dediacted (service) user? If as root, try as an other user. Perhaps in this case you can reproduce my problem?

I need to change the file extension to .txt because .log is not allowed here. :-)
Attached files
debug_output.txt - 3.6 KB - 367 views
debug_output2.txt - 3.6 KB - 398 views
You can ignore the warnings of wrong srv1 configuration (hlvc_checks parameter ignored). It's fixed now. Program still crash.
Quote from Pasci :In the meantime I have also crashes with other commands. By the way: Also if I send the command "!" to hide the info boxes of LFSTop.

You will find 2 debug logs attached. Perhaps you will found out whats wrong.

With which user do you start lfstop? root or a dediacted (service) user? If as root, try as an other user. Perhaps in this case you can reproduce my problem?

I need to change the file extension to .txt because .log is not allowed here. :-)

Are these both logs related to the "!" issue? That one I can reproduce and the fix is trivial...

I can't see /laps command report in any of those...
Ok, hopefully I can get the /laps crash backtrace tommorow so I can fix it. So far I have no clue why could this happen. And now some sleep...
Bugfix version 1.2.1 released. Download: Linux Windows

Changes:
  • Empty command ("!" by default) now clears the window instead of crashing.
Version 1.3.0 released. Download: Linux Windows

Changes:

+ Configurable !log command added: option to restrict to admins, max
messages limit. Long messages are split to 2 strings

+ Split/sections preference is now saved to database, so you can
switch it once and it will always appear the same after reconnect

+ Use SystemSemaphore instead of running.pid file. No longer need to
remove running.pid file if program crashes

+ !ver command shows memory usage

+ Added Clang compiler build flags

- Fixed options window which showed all laptime updates options "On"
until you change them

- Will not run importer if lfstop is running in the directory

- Database query window optimised (!top, !tb, !tbs and !avg printed up
to 20 times faster)

- A lot of minor fixes, refactoring, code formatting :)


Bugfix version 1.3.1 released. Download: Linux Windows

Changes:

1.3.1

- WR update was parsing the answer multiple times after first update,
accumulating amount with every update

Everything works fine under Linux - thanks for your work/the updates
looks like its going to be a nice program mate,when I try to run it I am getting an error saying the following "The program can't start because libgcc_s_dw2-1.dll is missing from your computer.
Try reinstalling the program to fix this problem"

hope all is good and well and hope to see u soon
Quote from bishtop :looks like its going to be a nice program mate,when I try to run it I am getting an error saying the following "The program can't start because libgcc_s_dw2-1.dll is missing from your computer.
Try reinstalling the program to fix this problem"

hope all is good and well and hope to see u soon

Thanks for testing. Somehow I failed to build it properly for windows. I wonder why no one reported that earlier Big grin

Try this https://bitbucket.org/restlessmonkey/lfstop/downloads/lfstop-1.3.1-windows-bundled_libs-i686.zip

I have also updated the links in first post and latest version post.
will test now mate .thanks

LFSTop tracker
(116 posts, started )
FGED GREDG RDFGDR GSFDG