The online racing simulator
read a SPR not HL
(8 posts, started )
read a SPR not HL
Hi guys,

How to extract the total time of local race (SPR)?

[FONT=FIXED SYS]6 char 0 LFSSPR : do not read file if no match
1 byte 6 game version : ignore
1 byte 7 game revision : ignore
1 byte 8 SPR version : ignore
1 byte 9 reserved : -
1 byte 10 reserved : -
[B]1 byte 11 qual mins : qualifying time[/B][/FONT]

Is 1 bite qual mins the total time of local race in SPR mode?

Im use a code in PHP but not works, ttime is total time:


<?php 
// part of my code 
$headerVars Unpack("x11/Cttime/Claps/x2/ChotlapMode/x12/Cmass/Cintake/@128/Cconfig/Crev/x2/Sflags/ChotLap/CnumSplits"$header);
//
?>

Thanks!

JS
I'm not sure what you mean by "total time". Do you mean the total race time? Say you do 3 laps, where each lap takes 1:30, so the total time would be 4:30 ?
And if so, where to find this total race time in a spr? (i couldn't tell you from the top of my head though)
yeah, is the total time of spr.

Not Hotlap mode.

example:

10 laps of 10 minutes of total time

average time is: 1minute

This is the idea.

JS
tbh i've no idea. I don't think total time is given in the SPR header, so you'd have to get the information from the data part of the SPR. But since that's not documented that may be hard.
Quote from Victor :tbh i've no idea. I don't think total time is given in the SPR header, so you'd have to get the information from the data part of the SPR. But since that's not documented that may be hard.

Are you ever? Or is that pretty much going to give us the secret to life the universe and everything? I would think it would, and would also understand why you would not want to give us the information. But it would be nice ... one day.
Sorry but what is this?

1 byte 11 qual mins : qualifying time
Assuming I've not miscount the bytes either, the field is a single byte, which you read with 'C' in unpack, which actually reads it as an ASCII character. You simply need to convert this into it's int value, by typecasting it.

However, I don't know if it actually corresponds to the value you think it does, as I've not really touched SPRs much.
I converted using intval() and did not return no data...

read a SPR not HL
(8 posts, started )
FGED GREDG RDFGDR GSFDG