Open burdenc opened 7 years ago
It looks like any key-value pair that begins with u0002
has 2 extraneous null bytes after their value:
\02IsHidden\00\00\00\00\00
. Changing the u0002
to u0001
makes Steam ignore that value.
It also looks like the current implementation avoids corrupting the shortcuts file because the regex just greedily matches all the new values into the icon field. So when the results are written back out, the new values are written directly back to the file.
I believe that the numbers before the key value pairs indicate the encoding. So
\x01
means UTF8 encoded value (including null terminator)\x02
means 4 byte little endian binary. This is my best guess, but it would would explain the 2 extra nulls after all newer values. Currently these are only used for boolean (0 = false, 1 = true) values.This could potentially be expanded to also say that \x00
denotes a list type, but that's a bit harder to argue. Both shortcuts
and tags
are list types, but tags
starts its list items with a \x01
and shortcuts starts with \x00
so it's hard to say what that means.
This pull request (https://github.com/scottrice/pysteam/pull/14) adds the extra data to pyteam's shortcuts.vdf parser Then this one for ice: https://github.com/scottrice/Ice/pull/456 uses the new pysteam
Then Ice works again
I tried using both the updated pysteam source and updated ice source from lachlankrautz post above, but I am not able to import ROMS into steam. it says it cant import them and displays one of my custom non-steam game shortcuts in the output. I noticed that there are more fields added to shortcuts.vdf since this was updated. Could this be the reason why it's not able to import with the updated code?
It appears there's a new values for the shortcuts.vdf file. There's a couple new key-value pairs that pysteam doesn't account for. SteamShard's API has some basic documentation of the new fields:
https://github.com/PsychoTheHedgehog/SteamShard/wiki/T_SteamShard_Shortcuts
It looks like some of the new fields are preceded by a
u0002
character rather thanu0001
. This could be because they're optional, or because the number denotes the version # of the shortcuts file format? There's also some empty files. It would probably be best to switch away from static regex formatting.