RetroAchievements / RAIntegration

The DLL responsible to integrate emulators with RetroAchievements.org
https://retroachievements.org
MIT License
96 stars 23 forks source link

Revert button for server-side achievements reverts to state at login, not last committed state #92

Open stt opened 6 years ago

stt commented 6 years ago

IDC_RA_REVERTSELECTED in RA_Dlg_Achievement.cpp talks about "reverting from file" but the only thing that seems to write to file is IDC_RA_COMMIT_ACH when (g_nActiveAchievementSet == Local). Using the "Revert selected" button when Unofficial set is selected leads to some unclear behaviour. IMO it'd make sense if unofficial set actually reverted from server.

Jamiras commented 6 years ago

Unofficial achievements should be reverted from the cached file downloaded from the server.

TempSet will have a m_nSetType of Unofficial. When TempSet.LoadFromFile is called, it will go into the else code that processes the JSON response from the server which is stored in RACache\Data\[gameid].txt.

Jamiras commented 6 years ago

I have verified the functionality in RAVBA with both the current master build and the 0.72 version of the DLL. Please clarify what isn't being reverted, as well as what emulator you're using.

stt commented 6 years ago

Thanks for looking into it, sorry it took a bit to get back. Retried now what I did earlier with RASnes9x and took notes:

  1. created a new set for a game in local and created one new achievement
  2. promoted to unofficial
  3. added new requirement and did "commit selected"
  4. checked .txt file, it was still at the step#2 (so server now has newer set than the txt does)
  5. clicked "revert selected" it gave "attempt to revert from file?" prompt
  6. clicking ok the achievement set went back to the state in my local .txt (old state)

Now being aware of the state difference I can just click "Refresh from server" before doing "Revert selected" to get back to the desired point. So I guess the issue is mostly just that the UI is a bit confusing.

(Separate minor UI issue, the "* selected" buttons in "Achievements" dialog can be clicked even when no cheevo is selected, they just don't do anything)

Jamiras commented 6 years ago

That makes sense. The "Revert Selected" button restores the data to the last known server state, which is not updated when committing data to the server. I'll update the title to better reflect the issue.