The online racing simulator
#1 - MikeB
mpr header - "rules" and "flags"
I want mprEdit to support different session types (currently only race works well, qualy and practice sessions have some issues with regard to extracting length of replay and time of certain events...). To my surprise the info about session type is not documented in the mpr header info.
There are only two flags mentioned:
1 int 12 rules : -
1 int 16 flags : -

So, does anybody here know where the session type is stored and/or what's the meaning of these two flags? Or do i have to find out myself again

Or did i just miss the obvious somewhere?

Thanks and regards
Michael
From the reference that info must be at the beginning here:
[FONT=FIXED SYS]num unit offset description
--- ---- ------ -----------

6 char 0 LFSMPR : do not read file if no match
1 byte 6 game version : ignore
1 byte 7 game revision : ignore
1 byte 8 MPR version : ignore
1 byte 9 immediate start : joined already running game
[COLOR=Red][B]1 byte 10 reserved : -
1 byte 11 reserved : -
1 int 12 rules : -
1 int 16 flags : -[/B][/COLOR]
1 byte 20 laps byte : laps / hours (see notes)
1 byte 21 skill : skill level (0,1,2,3,4)
1 byte 22 wind : 0=off 1=weak 2=strong
1 byte 23 num players : players at start of race
8 char 24 LFS version : text, ends 0
4 char 32 short track name : e.g. BL2R
1 int 36 start time (UTC) : seconds from 00:00 1/1/1970
32 char 40 track name : text, ends 0
1 byte 72 config : 1,2,3.. (first config is 1)
1 byte 73 reversed : 0=no 1=yes
1 byte 74 weather : 0,1,2.. (first weather is 0)
1 byte 75 num finished (NF) : players in results table
1 int 76 0 : -
NF result 80 RESULT INFO : (see below)[/FONT]

In my opinion it should one of those fields. Maybe the best thing would be to generate a handful of mpr files and check those values with an hex editor.

Anyway, with practice sessions you can check the number of laps (must be 0), but I don't know if there's any reference on the content of the mpr depending on the type of the session. I think Scawen may be the only one capable of solving your doubts.
#3 - MikeB
Quote from MaKaKaZo :From the reference that info must be at the beginning here:
[FONT=FIXED SYS]num unit offset description
--- ---- ------ -----------

6 char 0 LFSMPR : do not read file if no match
1 byte 6 game version : ignore
1 byte 7 game revision : ignore
1 byte 8 MPR version : ignore
1 byte 9 immediate start : joined already running game
[COLOR=Red][B]1 byte 10 reserved : -
1 byte 11 reserved : -
1 int 12 rules : -
1 int 16 flags : -[/B][/COLOR]
1 byte 20 laps byte : laps / hours (see notes)
1 byte 21 skill : skill level (0,1,2,3,4)
1 byte 22 wind : 0=off 1=weak 2=strong
1 byte 23 num players : players at start of race
8 char 24 LFS version : text, ends 0
4 char 32 short track name : e.g. BL2R
1 int 36 start time (UTC) : seconds from 00:00 1/1/1970
32 char 40 track name : text, ends 0
1 byte 72 config : 1,2,3.. (first config is 1)
1 byte 73 reversed : 0=no 1=yes
1 byte 74 weather : 0,1,2.. (first weather is 0)
1 byte 75 num finished (NF) : players in results table
1 int 76 0 : -
NF result 80 RESULT INFO : (see below)[/FONT]

In my opinion it should one of those fields.

Thats what I also think...
Quote from MaKaKaZo :Maybe the best thing would be to generate a handful of mpr files and check those values with an hex editor.

Yeah, but i hoped that someone already did this and knows the meaning so I can save the time to try to figure it out myself
Flags are "race flags" documented in InSim.txt

// HOSTF_CAN_VOTE 1
// HOSTF_CAN_SELECT 2
// HOSTF_MID_RACE 32
// HOSTF_MUST_PIT 64
// HOSTF_CAN_RESET 128
// HOSTF_FCV 256
// HOSTF_CRUISE 512

Rules are the allowed cars

"XF GTI", // 1
"XR GT", // 2
"XR GT TURBO", // 4
"RB4 GT", // 8
"FXO TURBO", // 10
"LX4", // 20
"LX6", // 40
"MRT5", // 80
"UF 1000", // 100
"RACEABOUT", // 200
"FZ50", // 400
"FORMULA XR", // 800
"XF GTR", // 1000
"UF GTR", // 2000
"FORMULA V8", // 4000
"FXO GTR", // 8000
"XR GTR", // 10000
"FZ50 GTR", // 20000
"BMW SAUBER F1.06", // 40000
"FORMULA BMW FB02", // 80000
#5 - MikeB
Ahh, thanks for the info
Regarding the session (practice/qualy/race) type: I think I already found where it is stored (somewhere later in mpr file).
Maybe this would be useful to include in the officially documented mpr header?

FGED GREDG RDFGDR GSFDG