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

Retro Achievements #328

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Retro Achievements #328

wants to merge 3 commits into from

Conversation

OFFTKP
Copy link
Contributor

@OFFTKP OFFTKP commented Aug 31, 2023

Ongoing PR for retro achievements integration

@OFFTKP
Copy link
Contributor Author

OFFTKP commented Aug 31, 2023

Let me know what you think of the structure. Basically you'd login from the UI and call ra_login_credentials (and then it would auto log in on startup using ra_login_token). If this is fine I need a login UI and a way to save/load the token from the platform specific save directory.

@skylersaleh
Copy link
Owner

skylersaleh commented Aug 31, 2023

Overall structure looks reasonable to me. Make sure to #ifdef Retro Achievements support and make it configurable from CMAKE as some platforms will not be able to communicate with the Retro Achievements server (ie. Web)

@OFFTKP OFFTKP force-pushed the rcheevos branch 2 times, most recently from 9eae465 to 8f4e06d Compare September 4, 2023 17:26
@OFFTKP
Copy link
Contributor Author

OFFTKP commented Sep 5, 2023

Does the async image loading/caching function look good to you? Basically you call se_ra_get_image with the url and a callback after it's downloaded/loaded. See se_ra_get_image(ra_info.game_title, url, se_ra_load_game_image_callback, NULL); for example loads the game image. Later we also need to load achievement images but I wanna make sure you like this function first.

@OFFTKP OFFTKP force-pushed the rcheevos branch 2 times, most recently from 607ec6a to b14f25c Compare September 7, 2023 11:51
@skylersaleh
Copy link
Owner

skylersaleh commented Sep 12, 2023

A couple of bugs I've noticed so far:

  • Auto Login after exit doesn't seem to work properly.
  • Achievement list/game is not getting loaded when a user logs in after a game is already loaded.
  • Achievement lists don't seem to be cleared when launching a game that does not have achievements after a game that had achievements was loaded

Could you root the above out and fix them? I'll commit some other changes for the async image loading. I want to redo how this is handled a bit so that code can be shared with some of the other UI work I want to do later and hopefully reduce the surface area for potential bugs.

@OFFTKP
Copy link
Contributor Author

OFFTKP commented Sep 12, 2023

For the last one, can you tell me a game that doesn't have achievements so I can reproduce?

@skylersaleh
Copy link
Owner

skylersaleh commented Sep 12, 2023

For the last one, can you tell me a game that doesn't have achievements so I can reproduce?

You can just use any GBA/GB test ROM (ie. mGBA suite)

@OFFTKP
Copy link
Contributor Author

OFFTKP commented Sep 12, 2023

With the last patch all three bugs should be fixed

@OFFTKP
Copy link
Contributor Author

OFFTKP commented Sep 22, 2023

Fixed merge conflict and rebased with upstream dev

@OFFTKP
Copy link
Contributor Author

OFFTKP commented Sep 22, 2023

Removed std::future/std::async stuff, just running http requests on detached threads
Instead of waiting on the requests, now just pushing the callback to a vector and checking that from the main thread. This means the image creating/game loading callbacks should only be called after calling ra_run_pending_callbacks from the main thread, so the lock_mutex stuff should not be needed, as ra_info editing would happen on the same thread.

The recursive_mutex.h stuff was ugly anyway so I'm happier with this. Let me know if the previous crashes still happen.

@OFFTKP
Copy link
Contributor Author

OFFTKP commented Sep 22, 2023

needs some more chasing, there are still some bugs

skylersaleh added a commit that referenced this pull request Dec 15, 2023
OFFTKP pushed a commit to OFFTKP/SkyEmu that referenced this pull request Dec 17, 2023
OFFTKP pushed a commit to OFFTKP/SkyEmu that referenced this pull request Dec 17, 2023
@OFFTKP OFFTKP force-pushed the rcheevos branch 10 times, most recently from 2c92d21 to e2d2a6e Compare December 23, 2023 15:09
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

Successfully merging this pull request may close these issues.

None yet

2 participants