Players.bin

From X-Moto
Jump to: navigation, search

Català - Español

This file, which on Windows is located in the game installation directory and in ~/.xmoto on Unix systems, contains information about player profiles and their associated highscores. Originally it was also intended to support "Skipped" levels like in Elasto Mania, so there's some information in it which is not really used. It's a binary file, and below is a description of it's format.

Format

2 bytes: 0x0012 (VERSION)     # indicates the file format version, have been 0x0012 since 
                              # Xmoto version 0.1.9
4 bytes         (NUMPROFILES) # number of player profiles, little-endian integer

This is followed by an entry for each player profile:

STRING          (PLAYERNAME)  # name of player (see below)
4 bytes         (COMPLETED)   # number of completed levels, little-endian integer
4 bytes         (SKIPPED)     # number of skipped levels, little-endian integer

For each completed level:

STRING          (COMPLEVEL)   # ID of level completed 

For each skipped level:

STRING          (SKIPLEVEL)   # ID of level skipped

Then there's a lot of entries, each descriping an entry into the best times table:

STRING          (LEVEL)       # ID of level the entry is concerning
STRING          (REPLAY)      # name of replay file (not used for anything)
STRING          (TIMESTAMP)   # Time and date of the best time
4 bytes         (TIME)        # Completion time in seconds, little-endian float

If level ID is a zero-length string, there's is no more entries left. This is followed by the next player profile, and so forth.

STRINGs are stored in a Pascal-like way (not that I like the language, but I like the way strings are stored :P), where the first byte tells how long the string is, followed by the actual string. Notice that there's no tailing \0 to mark the end of the string. And yes, this means strings can't be longer than 255 characters.

See Also