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

Corrupt shortcuts.vdf if screenshot was taken #2

Closed
byzod opened this issue May 2, 2017 · 17 comments
Closed

Corrupt shortcuts.vdf if screenshot was taken #2

byzod opened this issue May 2, 2017 · 17 comments
Assignees
Labels

Comments

@byzod
Copy link

byzod commented May 2, 2017

Step to Reproduce

  1. Close Steam
  2. Generate two game entry with steam-rom-manager (SRM), Test Game and Test Gal for example. Set any tag for it, ${Test} for example, then save list.
  3. Open Steam, two new shortcut added to Test category. Open any of them, say, Test Gal, take a screenshot by pressing F12, then exit Steam.
  4. Wait for Steam completely exited. Add prefix New , generate list again, save list.

Expected Result

4 shortcut lies in Test: Test Game, Test Gal with 1 screenshot, New Test Game and New Test Gal.

Actually Result

1 shortcut in Test: Test Gal with 1 screenshot, besides, the shortcuts.vdf is "corrupted", SRM can no longer add/edit it, but Test Gal are still available in Steam library.

Env

  • Platform: Windows 10 x64

  • SRM version: 1.1.3

  • Real Emulator folder: K:\Game\_Emu\WiiU\Cemu

  • Real Game path (including a fake one for testing, basically it's a copy of XCX):

    • K:\Game\_Emu\WiiU\ROMS\Xenoblade Chronicles X (USA) [Loadiine]\code\spaceTravel.rpx
    • K:\Game\_Emu\WiiU\ROMS\test\code\test.rpx
  • SRM config:

    • Type: Glob-Regex
    • Steam category: ${Exotic}
    • Executable: K:\Game\_Emu\WiiU\Cemu\Cemu.exe
    • Roms folder: K:\Game\_Emu\WiiU\ROMS
    • Steam folder: K:\Game\Steam
    • User glob-regex: ${/([^\(]+)/}/code/*.rpx
    • Arguments: -f -g "${filepath}"
@FrogTheFrog
Copy link
Contributor

@byzod could you upload your shortcut.vdf (after taking screenshot, but before saving) in a zip file? I am away from my PC at the moment but I could analyze it in notepad anyway.

@byzod
Copy link
Author

byzod commented May 2, 2017

Config

  • Actual Emulator folder: K:\Game\_Emu\WiiU\Cemu
  • Actual Game path:
    • K:\Game\_Emu\WiiU\ROMS\Xenoblade Chronicles X (USA) [Loadiine]\code\spaceTravel.rpx
    • K:\Game\_Emu\WiiU\ROMS\Fake\code\fake.rpx
  • SRM config:
    • Type: Glob-Regex
    • Steam category: ${Exotic}
    • Executable: K:\Game\_Emu\WiiU\Cemu\Cemu.exe
    • Roms folder: K:\Game\_Emu\WiiU\ROMS
    • Steam folder: K:\Game\Steam
    • User glob-regex: ${/([^\(]+)/}/code/*.rpx
    • Arguments: -f -g "${filepath}"

Shortcut.vdf trace

  • Attachment 1: .vdf files
    • 1 shortcuts.vdf: generated by SRM after step 2 of reproduce steps.
    • 2 shortcuts.vdf: generated by Steam after step 3, i.e. after screenshot taken and Steam terminated.
    • 3 shortcuts.vdf: generated by SRM after step 4
    • 4 shortcuts.vdf: generated by Steam after launching it. Exact same as 3 shortcuts.vdf (same hash) so I didn't included it.
  • Attachment 2: screenshots
    • 2A.png: taken in step 3, before screenshot in Steam.
    • 2B.png: taken in step 3, after screenshot in Steam.
    • 4.png: taken after step 4, after 4 shortcuts.vdf generated.
      a1 vdf.zip
      a2 img.zip

@FrogTheFrog
Copy link
Contributor

V1.1.4 should fix it. Technically it should work (doesn't mean it will) with any shortcuts.vdf, because it was not corrupted. Steam just changed my AppName to appname. I wish they would stick to one capitalization style instead of 2. As a result too many entries were added and Steam got "confused". Later this week I will also add option to remove generated and all added entries.

If V1.1.4 fails to fix it, reply here and I'll reopen this Issue.

@byzod
Copy link
Author

byzod commented May 3, 2017

Nope, still not working.

p.s. there's no way to tell the current version of the application when using it, I have to check the file version to make sure it's the latest.

Config

  • SRM version: 1.1.4
  • Actual Emulator folder: K:\Game\_Emu\WiiU\Cemu
  • Actual Game path:
    • K:\Game\_Emu\WiiU\ROMS\Xenoblade Chronicles X (USA) [Loadiine]\code\spaceTravel.rpx
    • K:\Game\_Emu\WiiU\ROMS\Fake\code\fake.rpx
    • K:\Game\_Emu\WiiU\ROMS\中文\code\fake.rpx (Make sure UTF-8 is working, just in case)
  • SRM config:
    • Type: Glob-Regex
    • Steam category: ${Exotic}
    • Executable: K:\Game\_Emu\WiiU\Cemu\Cemu.exe
    • Roms folder: K:\Game\_Emu\WiiU\ROMS
    • Steam folder: K:\Game\Steam
    • User glob-regex: ${/([^\(]+)/}/code/*.rpx
    • Arguments: -f -g "${filepath}"
  • Test steps
    1. Close steam, delete shortcuts.vdf, generate & save list with SRM
    2. Open Steam, check result
    3. Run 中文, then take a screenshot, close Steam
    4. Add title prefix 2, generate & save list again
    5. Open Steam, check result
    6. Run 中文, then take a screenshot again, close Steam

Shortcut.vdf trace

  • Attachment 1: test files
    • 1 shortcuts.vdf: generated by SRM after step 1 of test steps.
    • 1.png: taken after step 2
    • 2 shortcuts.vdf: generated by Steam after step 3
    • 3 shortcuts.vdf: generated by SRM after step 4
    • 4 shortcuts.vdf: generated by Steam after step 6 (I found that steam will never overwrite the shortcut file without actions like screenshot, adding new shortcut)

a1.zip

@FrogTheFrog FrogTheFrog reopened this May 3, 2017
@FrogTheFrog
Copy link
Contributor

Now that shortcuts.vdf parser is fixed, I'm giving my VDF manager a total rewrite as I noticed "holes" in my logic. Many of them were fixed but many may still remain.

@FrogTheFrog FrogTheFrog self-assigned this May 5, 2017
@FrogTheFrog FrogTheFrog added the bug label May 5, 2017
@FrogTheFrog
Copy link
Contributor

FrogTheFrog commented May 5, 2017

Steam changes utf-8 encoding to something else. Parser changes it back to utf-8. Now, this drives Steam nuts if "LastTimePlayed" is set. Need to figure out what encoding Steam uses.

Edit:
False conclusion once again, but it has something to do with "LastTimePlayed".

Edit2:
It seems to be related to shortcuts.vdf parser after all. It fails to read or write integer properly.

@FrogTheFrog
Copy link
Contributor

@byzod could you try out the new v1.2.0 pre-release?

@byzod
Copy link
Author

byzod commented May 6, 2017

@FrogTheFrog OK it works now.

Just a small flaw: it overwrites the original Xenoblade Chronicles X shortcut (same name) created before I notice this project, it's ok since the detailed config is exactly the same.

But all screenshot I taken are "gone": the new Xenoblade Chronicles X created a new, different folder in \Steam\userdata\{userID}\760\remote\ to store screenshots, so I have to manually move all screenshots images to the new one.

@FrogTheFrog
Copy link
Contributor

FrogTheFrog commented May 6, 2017

@byzod I intentionally disallow same titles as they could mess up appId. For the second problem (even the first one maybe), could you give me full where emulator executable was (for the original title), or are they at the same location?

@byzod
Copy link
Author

byzod commented May 6, 2017

@FrogTheFrog
I have only one Cemu so yes, they (it) are (is) at the same location. But the shortcut entries stored in the shortcuts.vdf are slightly different, the case: Ceme/cemu

Content of Down.zip
Before SRM edition: shortcuts.backup
After SRM overwrite it: shortcuts.vdf
(Only the XCX part, cut off from the original .vdf)

Down.zip

p.s. about the icon thing, I added it AFTER all things happened, I think it has nothing to do with the issue.

@FrogTheFrog
Copy link
Contributor

@byzod "K:\Game\_Emu\WiiU\cemu\Cemu.exe" change to "K:\Game\_Emu\WiiU\Cemu\Cemu.exe". AppId is generated from "%exe%"%appname%. Thus even a slightest change changes appId. That's the feature of Steam.

@byzod
Copy link
Author

byzod commented May 6, 2017

@FrogTheFrog OK, linux-friendly, understandable.

Steam create one (same) library shortcut for XCX(Cemu) and XCX(cemu), but create two (different) screenshot folder for it (them). That's legit.

@FrogTheFrog
Copy link
Contributor

@byzod Actually, I prevent Steam from creating duplicate title entries (even if appId is different), because at the time of writing it made no sense to me to have 2 identical entries in the library. For that reason I added prefix and suffix options. Sorry :D

@FrogTheFrog
Copy link
Contributor

@byzod If you have no other problems related to this Issues, I'll close it.

@byzod
Copy link
Author

byzod commented May 6, 2017

@FrogTheFrog Correct me if I'm wrong:

When I added a shortcut "%exe%"%appname% (case sensitive)

Steam:

  • create appId generated from "%exe%"%appname%
  • create a library shortcut from appId
  • create media folder: \Steam\userdata\{userId}\760\remote\{appId}
  • store grid picture if I set one: \Steam\userdata\{userId}\config\grid\{appId}.png or .jpg or .tga
  • create other things related to appId that I didn't know yet

Steam-Rom-Manager:

  • Prevent multiple shortcut that have different appId but "%exe1%"%app1name%.toLowerCase() == "%exe2%"%app2name%.toLowerCase() is True

Then I think SRM should prevent other things too, at least the screenshot folder, because it's a little bit confusing, especially all screenshots are "gone" after the list saved. Not every user will check their \Steam\userdata\{userId}\760\remote folder like me.

@FrogTheFrog
Copy link
Contributor

FrogTheFrog commented May 6, 2017

@byzod
Steam-Rom-Manager:

  • Prevents multiple shortcuts when %app1name% === %app2name%. %app1name%'s appId is replaced with %app2name%'s appId. Thus replacing images. I could rename media folder to new appId if you want.
  • Manages (removes, adds) grid pictures to \Steam\userdata\{userId}\config\grid\{appId}.*

@byzod
Copy link
Author

byzod commented May 6, 2017

Any way, the .vdf corruption problem is fixed, please close the issue.

If anyone found that "screenshots disappeared" problem is vital they should create an issue themselves :)

cbartondock added a commit that referenced this issue Apr 26, 2023
* Easier Theme Selector

* EmuDeck wip

* Deck Theme

* EmuDeck theme

* Opacity

* small fix setttings

* font

* Fix routing issue (#1)

* added EmuDeck to themes

* fixed routing

* EmuDeck Theme + fixes Classic and Deck theme

* new bg + fix navarea buttons

* Preview Screen Text + Lens Icon

* typo

* streamlined button

* add (bad) styling for required fields (#2)

* comma

* nicer colors

* small fixie

---------

Co-authored-by: Chris Dock <[email protected]>
cbartondock added a commit that referenced this issue Apr 26, 2023
* Easier Theme Selector

* EmuDeck wip

* Deck Theme

* EmuDeck theme

* Opacity

* small fix setttings

* font

* Fix routing issue (#1)

* added EmuDeck to themes

* fixed routing

* EmuDeck Theme + fixes Classic and Deck theme

* new bg + fix navarea buttons

* Preview Screen Text + Lens Icon

* typo

* streamlined button

* add (bad) styling for required fields (#2)

* comma

* nicer colors

* small fixie

---------

Co-authored-by: Chris Dock <[email protected]>
cbartondock added a commit that referenced this issue Apr 26, 2023
* Easier Theme Selector

* EmuDeck wip

* Deck Theme

* EmuDeck theme

* Opacity

* small fix setttings

* font

* Fix routing issue (#1)

* added EmuDeck to themes

* fixed routing

* EmuDeck Theme + fixes Classic and Deck theme

* new bg + fix navarea buttons

* Preview Screen Text + Lens Icon

* typo

* streamlined button

* add (bad) styling for required fields (#2)

* comma

* nicer colors

* small fixie

* Fix update alert

* fix chunky boy

* label switcharoo

---------

Co-authored-by: Chris Dock <[email protected]>
cbartondock added a commit that referenced this issue Apr 29, 2023
* Easier Theme Selector

* EmuDeck wip

* Deck Theme

* EmuDeck theme

* Opacity

* small fix setttings

* font

* Fix routing issue (#1)

* added EmuDeck to themes

* fixed routing

* EmuDeck Theme + fixes Classic and Deck theme

* new bg + fix navarea buttons

* Preview Screen Text + Lens Icon

* typo

* streamlined button

* add (bad) styling for required fields (#2)

* comma

* nicer colors

* small fixie

* Fix update alert

* fix chunky boy

* label switcharoo

* + Log report + Exceptions

---------

Co-authored-by: Chris Dock <[email protected]>
cbartondock added a commit that referenced this issue Apr 29, 2023
* Easier Theme Selector

* EmuDeck wip

* Deck Theme

* EmuDeck theme

* Opacity

* small fix setttings

* font

* Fix routing issue (#1)

* added EmuDeck to themes

* fixed routing

* EmuDeck Theme + fixes Classic and Deck theme

* new bg + fix navarea buttons

* Preview Screen Text + Lens Icon

* typo

* streamlined button

* add (bad) styling for required fields (#2)

* comma

* nicer colors

* small fixie

* Fix update alert

* fix chunky boy

* label switcharoo

* + Log report + Exceptions

* Fix logget

* Fix exceptions?

---------

Co-authored-by: Chris Dock <[email protected]>
cbartondock added a commit that referenced this issue May 3, 2023
* Easier Theme Selector

* EmuDeck wip

* Deck Theme

* EmuDeck theme

* Opacity

* small fix setttings

* font

* Fix routing issue (#1)

* added EmuDeck to themes

* fixed routing

* EmuDeck Theme + fixes Classic and Deck theme

* new bg + fix navarea buttons

* Preview Screen Text + Lens Icon

* typo

* streamlined button

* add (bad) styling for required fields (#2)

* comma

* nicer colors

* small fixie

* Fix update alert

* fix chunky boy

* label switcharoo

* + Log report + Exceptions

* Fix logget

* Fix exceptions?

* fixes issue with parser scroll bar on EmuDeck Theme

---------

Co-authored-by: Chris Dock <[email protected]>
cbartondock added a commit that referenced this issue May 8, 2023
* Easier Theme Selector

* EmuDeck wip

* Deck Theme

* EmuDeck theme

* Opacity

* small fix setttings

* font

* Fix routing issue (#1)

* added EmuDeck to themes

* fixed routing

* EmuDeck Theme + fixes Classic and Deck theme

* new bg + fix navarea buttons

* Preview Screen Text + Lens Icon

* typo

* streamlined button

* add (bad) styling for required fields (#2)

* comma

* nicer colors

* small fixie

* Fix update alert

* fix chunky boy

* label switcharoo

* + Log report + Exceptions

* Fix logget

* Fix exceptions?

* fixes issue with parser scroll bar on EmuDeck Theme

* Error message color RED

---------

Co-authored-by: Chris Dock <[email protected]>
cbartondock pushed a commit that referenced this issue Jun 10, 2024
* Update deprecated actions calls

* checkout with lfs

* Run a clean install

* use a regular npm install

* include python install

* Fix deprecated setup-python and upload-artifact calls

* Upload mac build as an artifact in pr

* Update upload artifact action (#2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants