scottrice / pysteam

Python API for accessing local Steam information
MIT License
24 stars 21 forks source link

New shortcuts.vdf values #12

Open burdenc opened 7 years ago

burdenc commented 7 years ago

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 than u0001. 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.

burdenc commented 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.

burdenc commented 7 years ago

I believe that the numbers before the key value pairs indicate the encoding. So

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.

lachlankrautz commented 7 years ago

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

Teutonic84 commented 5 years ago

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?