The online racing simulator
Getting info from an spr
(5 posts, started )
Getting info from an spr
Hi, i want to extract info from an spr file. I do everything according to the spr header documentation on the lfs site and everything works perfectly.

I have one question, though.When the hotlap (the app I want to code is about hotlaps) is processed, the Racer Name value is the player's s2 id (in my case 'Falcon1').If the hotlap is about a demo user, the Racer Name is the user's screen name.
What I am trying to say is, if someone takes a demo version of LFS and makes a hotlap with 'Falcon1' as name will there be any way to tell if the hotlap was made by the original s2 licensed racer or by a demo user with that name?
Thanks

PS:I expressed it a bit strangely, if you don't understand something please post.
#2 - migf1
I would like to add one more question about replay (.spr) reading and I thought I shouldn't open a new topic.

So... I'm making a hotlap database prog in C, using the valuable info found here. My prob is that replays prior to version W do not seem to have anything stored in their

4 char 24 short track name : e.g. BL2R

field. This is no good for my prog, since -amongst other things- it sorts data according to car/short-track combos.

Also, versions prior to T (I think) seem to store the best laptime differently, because my app gets garbage data in the

1 time 136 split 1 : msht time (first checkpoint)
1 time 140 split 2 : msht time
1 time 144 split 3 : msht time
1 time 148 split 4 : msht time


fields when it loads older spr files.

So what I'm asking for is a way to overcome the above probs... for example a pointer to the header structures of older versions of spr.

I know it can be done somehow, since always in LFSW you could upload a replay (of any version) and it was sorted automatically under the correct car/short-track combo.

Any help would be greatly apreciated.
In LFS versions before patch X there was no short track name, so you need to use track name, config and reverse to work out the track.

E.G.
track name = Blackwood
config = 1
reversed = 1

would be the equivalent of BL1R, which would be Blackwood Grand Prix Reversed. If that makes sense.

Similarly before patch X the times were stored as four bytes, which represented minutes, seconds, hundredths and thousandths respectively (although thousandths was always zero if I remember). With patch X the times were changed to milliseconds, to match similar changes which were made to InSim.

I don't know where the old SPR or MPR header files are located, sorry.
#4 - migf1
Many many thanks for the truly informative answer!

PS. I think I didn't get the difference in times between newer and older patches, but I'll get back to it as soon as I put my hands on them. First I'll fix the prog to respond to older spr files as far as the short-track is concerned. Thanks again!
#5 - migf1
All done!

I fixed the short-track prob with older versions and actualy times work ok too without changing anything in the code (perhaps the testing replay file I used back then was corrupted or something).

Ive tested again the prog with replays from patch U and it seems to work fine... thanks DarkTimes.

PS. I've attaced the executable of my prog, in case anyone wants to have a look. Please note that the UI is primitive (text-based) and that the prog doesn's save the database in the hard-disk, yet (everything is done in memory).

To load replays with spaces or non-english characters in their filenames, pass them as command line arguments (drag them onto the program icon - the program MUST NOT ran when you drag replays on its icon).

Once inside the prog, type "help" for a list of available commands, and then type "help command" for more help on any specified command.
Attached files
lfs_spr.08f.zip - 23.5 KB - 181 views

Getting info from an spr
(5 posts, started )
FGED GREDG RDFGDR GSFDG