The online racing simulator
LFS stats is born again
(396 posts, started )
Quote from Eclipsed :Yesterday had similar surprise about new version and LFSStats crashing,changed one setting in cfg and works now like it used to:

# TCP mode.
# true if you want to use TCP
# false if tou want to use UDP
TCPmode = false

Seems like it did not work for me in TCP mode,check if you have same thing!

In UDP mode it works well. Thx
Hello,


New LFSSTAT1.12 release . Fix TCP reading issue with LFS 0.6E. You can replace only exe.

Bye

Gai-Luron
Quote from Gai-Luron :Hello,


New LFSSTAT1.12 release . Fix TCP reading issue with LFS 0.6E. You can replace only exe.

Bye

Gai-Luron

Where can we get it?

Thanks
Link in the first post
Quote from Scawen :Someone might like to have a look at why this program doesn't work with the recent LFS test patches, causing a buffer to fill up so LFS is forced to close the connection.

HECTOR_UA describes the problem here.
http://www.lfsforum.net/showthread.php?p=1758174#post1758174

I've added my interpretation two posts below that. I suspect it's a bug in LFSStats which was not noticed before. But if you find out it's really an LFS bug I'd like to know about it!

EDIT : HECTOR_UA now says it works ok if he moves it to another folder. So I don't know what's up or if it's really a problem.

Will check it. But as I see Luron released some patch on it.

Quote from Titanio :Is there another place to download that files? Megaupload is disable

I have to rehost it, you know after a few years the websites, hostings etc. do change and cease to exist. Nobody hit me with a PM so I can't notice. I think I did rehost it once already but that site went down for sure, it's up again but not the files.

Quote from Gai-Luron :Hello,

Maybe, you can reproduce this bug starting replay with LFSStat and go to the end or replay with cursor. I remember this bug occur sometime also in previous release of LFS.
For now i stop all my dev waiting for next significant LFS release.

Bye

Gai-Luron

PS : Updated download link for LFS stat

Yes there always were some bugs around, especially when the replay jumping/seeking was introduced. I don't even want to know what it may do if you jump forward and then back etc.

As Gai-Luron said, it's pointless for anybody to work on tools for LFS.
  1. Nothing changed in the past couple years or so
  2. I still see people using LFSStat and they don't tell me they have a problem, if they had, they resolved it
  3. If S3 is ever going to be released, it may as well be worth it to start some tools from scratch
Anybody looking for a complete up to date LFSStat with nice graphs, download here.
Hopefully we will get yamakawa to share the sources as well
Gai-Luron, your source code for version 1.12 is older than 1.11 that I still have. I've copied the changes from insim4.cs and have found no other connection related changes. When connecting in TCP mode it refused to connect with an error when the port was already open in LFS. I've started LFS, started LFSStats and opened the port, it was ok, but then quit LFSStats and it would not connect anymore when run again, it would write an error out.

It seems to work fine in UDP mode though.

And I'm going to fix some things related to new insim version but not the connections. If it works in UDP, it works in UDP and I'm fine with that.

This the bug I got when LFS quit, it was in UDP and working fine, until LFS was closed and the connection died.

The following error occurred:
Index was outside the bounds of the array.
Graph
at Graph.RprData.Stats()
at Graph.RprData..ctor(String fn)
at Graph.Graph.GenerateGraph()
at LFSStat.LFSClient.exportRaceStats(String datFile)
at LFSStat.LFSClient.Loop(Connect insimConnection)
at LFSStat.LFSClient..ctor(String scriptfilename, Boolean debugmode)
at LFSStat.LFSStat.Main(String[] Args)

The reason may be that it tried to export stats (exportOnSTAte enabled) when LFS quit. And it can't handle the dropped connections or some lack of information to generate the stats.
Hi
I wanted to use this program but encountered a problem.
Using LFSSTAT1.12.zip from http://cgtavc.monespace.net/la ... d/lfsstat/LFSSTAT1.12.zip
(link of first post in thread)

LFSStat.cfg is set to TCPmode = false

Start LFSSTat.exe, in LFS type /insim 2999
LFSstats says "Connection OK" but when unpausing the replay it gives an error:
http://pastebin.com/3GBR92AN

"Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt." roughly translated:
"The object referenz was not set to object instanz"

The JackCY Moded Version 2.0 links are dead

Is there a newer/working version or am I doing something wrong?
After trying different versions from various posts this one seems to be working now:
Quote :Anybody looking for a complete up to date LFSStat with nice graphs, download here.

At first it made an error too (sorry, window closed before i copied it) but now it seems to be working. (replay currently on lap 3 and it outputs split times to console)
Maybe it just needed restart of LFS or the /insim 2999 has to be typed before starting replay, not sure.

edit:
It worked
great tool, thanks to all developers
Quote from Gutholz :Hi
I wanted to use this program but encountered a problem.
Using LFSSTAT1.12.zip from http://cgtavc.monespace.net/la ... d/lfsstat/LFSSTAT1.12.zip
(link of first post in thread)

LFSStat.cfg is set to TCPmode = false

Start LFSSTat.exe, in LFS type /insim 2999
LFSstats says "Connection OK" but when unpausing the replay it gives an error:
http://pastebin.com/3GBR92AN

"Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt." roughly translated:
"The object referenz was not set to object instanz"

The JackCY Moded Version 2.0 links are dead

Is there a newer/working version or am I doing something wrong?

Hi, yes I'm working on it currently as I need to practice. This type of error should be fixed and if it is unknown it should be possible to find out what caused it. Guess I should enable debug so it shows the code lines in the messages even release version. This type of bug you encountered is usually caused by how Insim sends packets and the use of UDP. Or just bad luck when clicking around in LFS was causing this. I've done some more on this today or yesterday, found new bugs and basically disable handling Insim packets except 2 until a session is started.

Yes sources are down, something was rehosted but I did not rehost them yet, I've put a link there when I found out, so it goes to Yamakawa's host. Later I started to update it again so I can practice.

I'll move it to github or similar site so it will have it's own webpage or at least a definite download place for everything.

I can rehost the 2.0 version quickly somewhere, maybe I've set Luron links to update the front page but I'm not sure. Nobody sent me a PM so I did not see a need to rehost or even knew it's down already.

Yes Yamakawa's version is a copy of my version 2.0 with his new graph.


Here is a sneak peak of changes, I may try to change the rubbish TCP, I just found a fix for LFSLapper so I will try it. The problem is that Scawen changes Insim and there is no documentation of Insim, after the last couple days I basically hate how he sends Insim messages. Such a mess that we causing LFSStats to crash. Like getting a YellowFlag FLG after race end and returning to a host screen, made LFSStats look up a player that did not exist anymore. TCP should be better in avoiding something random like this but Scawen introduced something in LFS that broke the TCP completely with a random error by shutting the connection down or some such.
Changelog:
==========
v2.1
----
* Graphs:
* Adding option to generate graph from DLL or EXE and adding Yamakawa's YGraph as an option
* Updated NPlot library to 0.9.10.0 and due to NPlot a .NET 4.0 Client Profile is not enough and a full .NET 4.0 is needed
* Changed default graph config to not output unused images
* Changed default graph background to transparent
* Networking:
* Fixed new Insim flags (AXIS_CLUTCH / THROTTLE, ...), proper names and exporting all of them, including SwapSide
* Changed them to be displayed via CSS3 - easy to modify at any time
* Added changes from Luron's v1.12 in Insim4.cs but TCP is still buggy
* Disabling TCP in code for now
* (InSim.Decoder.PIT.PIT) Pit flags text but still needs localization I think
* Ohter:
* Looked up and commented out some unused code
* Fixed {*Conditions} "Sunny,no wind" formatting to "Sunny, no wind"
* Added a few language file substitutions
* LFSStat changed to .NET 4.0 Client Profile and update some outdated code for better performance and conventions
* Cleaner version reporting and maintaining in the project
* Removed #MONO and #WINDOWS from source files since these are supposed to be defined elsewhere, in build/compiler options,
and not in source files, just change the #IFs back to #IF MONO and define #IF at build/compile level not in source files
* Command line options with help text and usage
* Customizable program ouput verbosity
* fixed 45 sec. penalty string
* Config errors are not reported but wrong values are set to default
* IMPORTANT: the application is now multithreaded, uses .NET tasks for exporting the collected data,
removes slight application hang up while exporting, thus main thread = networking runs continuously and exporting is asynchronous
* All command line interaction removed except when config defines to ask for filename, it should not hang up anywhere and should
quit on errors
* Fixed some of the weird exceptions that were happening because Insim does not report well session states, thus things were being
accessed while a session did not even start yet. It should be safe now to browse LFS without LFSStats crashing.
* Cleaner and formatted output to command line and console title
* Templates:
* Changed template names to .html for easier processing
* Added back to templates what Yamakawa decided to throw away but LFSStats can export and is useful, like driver swaps!
* LBL integrated in race.html
* LBL colors are HSLA, partly transparent and colors change continuously not discretely, saturation and alpha can be changed in tempplate
in code easily, want only 2 colors sure, want crazy mixed rainbow with 100 colors and all the way to 2000% best laptime? sure!
Just type it in there.
* More sensible html titles (16 laps of Fern Bay Green)

Any known bugs that you guys can't live with?

Another option to solve the screwed Insim is to use InSimDotNet.

Latest InSim version is 5, at least on a client 0.6E and the older version in LFSStats is a version 3 updated to version 4 or something like that. + the fixes I made to mostly visual appearance, flags etc.

Basically, 2.1 has completely new templates in HTML5 and CSS3 with JavaScript.
I just have to do part of the HTML, qualification and chat. Then the new CSS for all. Menu works already that is in JavaScript.
The rest is endless programming and fixing.
Quote :Statistics (LFSStats) 2.1.223.264 (X86)

^264 builds since I changed the versioning in 2.1

Race HTML goes fine, as long as Insim does not screw it up, probably due to the UDP or some packets getting lost. I had a lap fall out of the stats sometimes, when replay jumping.
InSim.txt in data/docs folder is not a sufficient documentation for the needs of this app?
Quote from Flame CZE :InSim.txt in data/docs folder is not a sufficient documentation for the needs of this app?

Well not much, it mostly defines what it sends, how the data is layout. It's basically a header file with comments, nothing more.
Does not define when it sends what packets and how the communication goes. A little is in the comments of the header file and that's about it.

That's why I think using another project that handles the insim communication might be better than trying to keep with the changes that are made to API/insim and break backward compatibility. Though that probably does not solve the issues of properly detecting states.

Yes people say: insim.txt
Have they tried to use it themselves though?

What defines a session (race, qualification, practice) end?
As far as I've seen nothing. It's basically hacked around to detect it via starting a new session, etc.

---

Why are there so many null errors in LFSStats? Because it was coded previously without checking for nulls and they do happen to pop up, same goes for index out range. I'm adding checks and fixing things where I find it.

Right now, I'm in TCP mode and got IS_SMALL with a length of 4 instead of "always 8" as insim.txt says. And other junk. Don't get it in UDP and don't get it consistently in TCP either. Have a log of it now, caught it once in debug and the IS_SMALL was [4,4,4,4], Size 4 ok but invalid for IS_SMALL, Type IS_SMALL, ReqI 4, SubT 4, and nothing for UVal that is on positions 4-7 and those are missing.
Don't need IS_SMALL, it doesn't work for what I hoped so I can remove it but why do I also get:

Packet head: 114
Unknown packet received: 114
Packet head: 48
Unknown packet received: 48
Packet head: 145
Unknown packet received: 145
Packet head: 83
Unknown packet received: 83
Packet head: SMALL
SMALL

48 is OK, anything under 55 is defined. The rest is not though. So right before the invalid IS_SMALL it also receives some other junk. Only in TCP and only sometimes. Not fun to debug.

Another:
TCP, the moment I click to fast forward a replay, TCP returns nothing as if no packets are sent to the stream. While they do get sent in UDP and do get sent in TCP while not fast forwarding. From that moment on, the stream reads nothing. And I bet it would yell at me with some kind of fatal error if the stream got closed and I was reading from it, which does get caught. It's as if LFS does not write to the stream anymore.

This last thing was originally implemented with an Exit, the application just shut down when LFS would do this. For me it gets hanged in an infinite reading of empty TCP stream over and over, trying to get packets but none are coming.

Found another fix from Luron, from LFSLapper so I'll try it, it's the same part of code so we will see if this finally fixes the TCP for what ever reason. But is shouldn't from what I see, as it only throws an exception, that's what I had here right now, it spawns the console with exception, the exit is better.
The fix might work on something else though. Like the above log of messy packets.
thanks for reply and your work

Quote :Any known bugs that you guys can't live with?

There was this replay I could not generate stats from:
https://drive.google.com/folde ... 2cbH56Sx8ndWRjdW53WGxhRzQ
It crashed at end and the generated stats were "empty" (everybody DNF etc) Not sure if it was just bad luck but tried 2-3 times and did not work. (It worked for some other replays)
(sorry, do not remember more details than "it crashed" or I'd give error message)


Quote :What defines a session (race, qualification, practice) end?
As far as I've seen nothing. It's basically hacked around to detect it via starting a new session, etc.

Only just started with insim and did not test it, but maybe this?
ISP_RES, // 35 - info : result confirmed
At least for quali & race, practice maybe has no results.
INSIM ERROR : WOULDBLOCK
This appears in LFS when i run LFSStats. And then LFSStats close auto. What could be a problem?
Quote from Gutholz :thanks for reply and your work

There was this replay I could not generate stats from:
https://drive.google.com/folde ... 2cbH56Sx8ndWRjdW53WGxhRzQ
It crashed at end and the generated stats were "empty" (everybody DNF etc) Not sure if it was just bad luck but tried 2-3 times and did not work. (It worked for some other replays)
(sorry, do not remember more details than "it crashed" or I'd give error message)


Only just started with insim and did not test it, but maybe this?
ISP_RES, // 35 - info : result confirmed
At least for quali & race, practice maybe has no results.

Let me check if it works with the latest version on UDP when jumping the replay to the end. Yes both replay work and generate. Though there is an issue that the results may miss a lap or something because it's on UDP and my hardware is a little old. So the results are not correct to the race due to the network transfer. That's why having TCP is better to have the results correct even if something slows down, nothing gets lost.
And I don't know about a mechanism in Insim that would handle lost packets.

IS_RES is only reporting result of a race and in Q it gets sent with every finished lap and IS_LAP.

Yes the only way seems to stop (and start) on IS_RST and the other options is to monitor IS_STA. I think I have it now, at least it reports all P,R,Q start and end all the time. But it could be made cleaner and easier to find those states of a track session.

Quote from Litro :INSIM ERROR : WOULDBLOCK
This appears in LFS when i run LFSStats. And then LFSStats close auto. What could be a problem?

No idea, never saw it.

If it's with version 2.0 and it prints some exception or log into console then I could check.

I've bullet proofed things a bit in v2.1 so all the old code from v1 that is causing these errors is easier to catch and find. Or was already fixed when I saw it in code.

WOULDBLOCK might mean that something would block or maybe overflow the TCP/socket buffer in LFS. Though there hardly anything gets sent from LFSStats, only a few requests to get connections and players and such. Otherwise it just sends ACK to reply to LFS to keep the connection alive and that's usually about it.

The TCP only goes down for me when I try to jump in replay, well it is up but LFS does not send anything and does not close it either. So it just lingers half open.

I've now closed LFSStats while I've closed LFS earlier:

Goodbye.

! Unhandled exception:
! System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.ReceiveFrom(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint& remoteEP)
at System.Net.Sockets.UdpClient.Receive(IPEndPoint& remoteEP)
at InSim.Connect.Receive()
at LFSStatistics.LFSClient.Loop(Connect insimConnection)
at LFSStatistics.LFSClient..ctor(String configFileName, Int32 refreshInterval, Verbose verbose)
at LFSStatistics.LFSStats.Main(String[] args)

I still can't get it to show code lines though, it should show them but maybe I will have to disable optimization for it to do so, which I don't want to do. Or it can't show for unhandled exceptions. Who knows, would have to test.

Guess I should suppress these errors when it's shutting down on my command.

---

HTML5 outline of race stats:

LFSStats log of Gutholz's replays.

LFSStats v2.1
Copyright (C) 2008-2013 Jaroslav Černý

LFSStats comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. Read LICENSE for details.
You should have received a copy of the GNU General Public License
along with LFSStats. If not, see <http://www.gnu.org/licenses/>.


Loading WR... Not loaded
UDP: Connecting... OK

Product: S2 Version: 0.6E InSim Version: 5
LFSStats is running...


Race start: 38 laps of AS3
Result: 1. THR Mazdarati/1
Result: 2. BWR-Black/1
Result: 3. [CR]Bandes/2
Result: 4. ERR|?nyle/2
Result: 6. MZRtoberkel/1
Result: 7. Cruel Garfield/4
Result: 8. [MRc] Michal/4
Result: 9. [RfB]alex/4
Result: 10. [GRT] Wheldon 77/3
Result: 11. TcL Knistling/3
Result: 12. [RfB]dan/4
Result: 13. TcL Gutholz/3
End of race by Race STart

Race start: 38 laps of AS3
> Race Stats exported (627ms)
> Graph.dll graphs generated (2321ms)
End of race by STAte

Goodbye.

---

LFSStats v2.1
Copyright (C) 2008-2013 Jaroslav Černý

LFSStats comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. Read LICENSE for details.
You should have received a copy of the GNU General Public License
along with LFSStats. If not, see <http://www.gnu.org/licenses/>.


Loading WR... Not loaded
UDP: Connecting... OK

Product: S2 Version: 0.6E InSim Version: 5
LFSStats is running...


Race start: 36 laps of WE1
Result: 1. LLM C.Dalda/1
Result: 2. MTDZX-Antti/1
Result: 3. THR Mazdarati/1
Result: 4. S M.Kapal/4
Result: 5. [CR]Bandes/2
Result: 6. BWR-Black/1
Result: 7. Camoradi/2
Result: 8. THR Daniel /1
Result: 9. [GRT]LRK-racer /1
Result: 10. MZRtoberkel/2
Result: 11. ERR|?nyle/2
Result: 12. BHAtmack/3
Result: 13. Cruel Garfield/2
Result: 14. TcL Knistling/3
Result: 15. [GRT] Wheldon /2
Result: 16. TcL Gutholz/3
Result: 17. BHAgredghog1/3
Result: 18. ERR| Jamo /2
Result: 19. Migpha/4
End of race by Race STart

Race start: 36 laps of WE1
> Race Stats exported (508ms)
> Graph.dll graphs generated (572ms)
End of race by STAte

Goodbye.

Yeah the call to Graph.dll takes some time the first time sometimes. Guess it gets loaded or something or it just gets scheduled later. The export is now run in parallel so it does not affect the rest of the application at all. It could take 5min to export and have another export to be done already executed as well, it would still work. Should Never tested but it should work.

---

The new Lap by lap, everything apart from menu layout and colors of the laptimes is going to change since it's not styled yet.
The times are colored continuously now.



Yes it is more green than the old one since anything in the range of 101.5-103% is green-yellow.
The same for other colors. The bar under menu shows the preview at predefined percentages. Can add more or change colors anyhow. This seemed the best.
It's 100+0.5+1.0+1.5+2.0+2.5 for the percentages.
Quote from Litro :error
I see something similar to this https://www.lfsforum.net/showt ... php?p=1758174#post1758174 but where to move that folder? Tried another direction...didnt helped.
When i use spr replays it gets stats.

Dunno, that looks like Luron's v1 so expect a lot of bugs.
That one fails to create a class of IS_STA packet while trying to read some [S]WORD (Int32)[/S] I mean USHORT (uint16) which in Insim is named as WORD

But yeah this is one of the things that can still go to hell because of how the Insim was coded and handled. I may switch it to InsimDotNet if that one does work. The plan was to not rewrite network layer if necessary but it's something that needs to be done nonetheless.

It's probably one of Luron's early programming projects so it looks like it. There is no checking and safety, it assumes everything is always ok, well it is not and then it crashes instead of recovering.
Well...your version also did the same.
Quote from Litro :Well...your version also did the same.

Very likely, did not fix the network back then and the network was also working with older LFS much more. v2.0 fixes and updates were more cosmetic than changing the inner operation of LFSStats.

Will make a new thread and repository for the code with new version.

I think TCP is a necessity here for LFSStats to create valid results so I have another big thing to update = remove the whole "network layer" and wire it to InsimDotNet.

I'm not sure there will be much left from the original LFSStats anymore.

---

OLD version 2.0 (temporary):

binary
source



Will try to get the new one out once it makes an output that is usable.
Still missing Q and maybe practice, need to make CSS to style the whole thing.
Then I can publish and fiddle with TCP/InsimDotNet.
Wow, this version works! Thank You!
Quote from Litro :Wow, this version works! Thank You!

That's the v2.0 that was here before, same archive, I've only changed the mode to UDP in config and zipped it again.

Well even the latest v2.1 (in TCP mode) I have still crashes on occasion because of how the internals were made, which is a bit of a guess and it seems one needs to check everything and everywhere as packets and information gets built for the stats in an unknown order.

Joined online server with v2.1 running, shortly after crash. User sent message and it has to translate user ID to nickname but there was no entry yet in the translation dictionary for this ID ==> :hbomb:
Will have to look into it later when rewiring things.
Right now it works fine so I'm waiting if it crashes again.
...
Hmm so far it's running fine.

Only error in stats is that it lists some best possible laps of people who did not make a lap but did a split or something. Making a note to check it later.

---

Changing the internals a LOT.
Even configuration and stuff. Can't work with it much unless things are nicely separated.
Hi,

these should be the latest versions I could find for LFSStats:

https://www.dropbox.com/sh/ir4z05l1f69j5i5/AAChT4HAZA0rTpifaZDqzDuOa?dl=0

Includes original 2.00 shared before, some updated 2.01 and the WIP 2.1 versions, sources included. These are all old compiles. Never finished the 2.1 as it made no sense anymore with the state of LFS and the whole project would be best done from scratch so that one can use a newer proper design of the whole application to avoid old bugs and bloat.

I think this app has probably been superseded by other apps by now but feel free to use it or edit it.
Attached files
LFSStats_v2.00_v2.01_v2.1.rar - 954.5 KB - 41 views

LFS stats is born again
(396 posts, started )
FGED GREDG RDFGDR GSFDG