(deleted lots of text here.. should have read the message properly first)
I haven't found a reliable way to find usernames in the replays, but I've had quite good results by playing with offsets. I can find most drivers this way, and it's more reliable than trying to find patterns. Try combining these two methods.
Hmm, OK, did a little bit of research, those look like car bits. Allowed cars on that server, that is. S1 cars are listed just above the rules bits, I guess the rest of the cars are in the same order as everywhere else, f.e. LFSWorld.
the_angry_angel, I think he's trying to find LFSWorld usernames.
yes, but in the header there are just nicknames, not lfs-usernames...
right now, i find the usernames in mpr like this...
somewhere in mpr file is a block of data that consist of:
num unit offset description --- ---- ------ -----------
CONNECTION INFO : size 61 bytes per connection
2 byte ???? always 0x3C07 1 byte 2 connection id? (host has always 0x01, and is always first in the list) 2 byte 3 ?? (host has always 0x00) 24 char 5 player name 8 char 29 number plate 24 char 37 user name
in s2, this block begins on a different offset in each mpr file, and i didn't found something like a pointer to this block yet...
so i just search the file for a sequence of bytes 0x3C, 0x07, 0x01, 0x00, 0x00 to find the block... it seems to work every time...
btw if someone wants a source for mpr parser in java, i can post it..
That's my parser, in C++. It's a bit hacky since I didn't think I'd show it to anyone
Look for "const int magic_offset", that's where I move to that block of data. The offset to the username block depends on the number of players, unlike in S1 where it was always in the same place.
My parser can find all the players that were ingame when the replay started, this means you can't find people who started from the pits, joined the game after spectating or connected to the server after the replay started. It's good enough for running a league, though.
Here's the problem: right when you start the replay, it says "poa.agarash left the pits (FXO)". The race hasn't begun yet, but the countdown has. That's why Agarash's block of data is 282 bytes instead of 335. I don't know of a way to detect this, so I just tell my drivers to not pit when the race starts