Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New shortcuts.vdf values #12

Open
burdenc opened this issue Dec 31, 2016 · 4 comments
Open

New shortcuts.vdf values #12

burdenc opened this issue Dec 31, 2016 · 4 comments

Comments

@burdenc
Copy link

burdenc commented Dec 31, 2016

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
Copy link
Author

burdenc commented Dec 31, 2016

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
Copy link
Author

burdenc commented Jan 4, 2017

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.

@lachlankrautz
Copy link

lachlankrautz commented Mar 27, 2017

This pull request (#14) adds the extra data to pyteam's shortcuts.vdf parser
Then this one for ice: scottrice/Ice#456 uses the new pysteam

Then Ice works again

@Teutonic84
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants