View Full Version : read a SPR not HL
jscorrea
17th February 2008, 12:45
Hi guys,
How to extract the total time of local race (SPR)?
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 : -
1 byte 11 qual mins : qualifying timeIs 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:
// part of my code
$headerVars = Unpack("x11/Cttime/Claps/x2/ChotlapMode/x12/Cmass/Cintake/@128/Cconfig/Crev/x2/Sflags/ChotLap/CnumSplits", $header);
//
Thanks!
JS
Victor
17th February 2008, 17:05
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)
jscorrea
17th February 2008, 17:20
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
Victor
17th February 2008, 17:31
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.
Dygear
17th February 2008, 20:50
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.
jscorrea
18th February 2008, 11:12
Sorry but what is this?
1 byte 11 qual mins : qualifying time
the_angry_angel
18th February 2008, 11:20
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 (http://uk.php.net/language.types.type-juggling) 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.
jscorrea
19th February 2008, 11:01
I converted using intval() and did not return no data...
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.