game.libretro icon indicating copy to clipboard operation
game.libretro copied to clipboard

Game API v4.0.0: Achievement support for RetroPlayer

Open Shardul555 opened this issue 2 years ago • 1 comments

This PR implement support for Achievements in ReteroPlayer. This PR is based on https://github.com/kodi-game/game.libretro/pull/67 , for adding support of RCheevos. This PR is used by https://github.com/garbear/xbmc/pull/126 for implementing Achievements.

Shardul555 avatar Feb 01 '23 03:02 Shardul555

I had to make the following change to update for upstream changes:

diff --git a/src/client.cpp b/src/client.cpp
index 86376d1..f9ec5be 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -504,7 +504,8 @@ GAME_ERROR CGameLibRetro::RCGetPatchFileUrl(std::string& url,
   return GAME_ERROR_NO_ERROR;
 }
 
-GAME_ERROR CGameLibRetro::SetRetroAchievementsCredentials(const char* username, const char* token)
+GAME_ERROR CGameLibRetro::SetRetroAchievementsCredentials(const std::string& username,
+                                                          const std::string& token)
 {
   CCheevos::Get().SetRetroAchievementsCredentials(username, token);
   return GAME_ERROR_NO_ERROR;
diff --git a/src/client.h b/src/client.h
index d06e4b6..f2e84f4 100644
--- a/src/client.h
+++ b/src/client.h
@@ -78,7 +78,8 @@ public:
                                const std::string& username,
                                const std::string& token,
                                unsigned int gameID) override;
-  GAME_ERROR SetRetroAchievementsCredentials(const char* username, const char* token);
+  GAME_ERROR SetRetroAchievementsCredentials(const std::string& username,
+                                             const std::string& token) override;
   GAME_ERROR RCPostRichPresenceUrl(std::string& url,
                                    std::string& postData,
                                    const std::string& username,

garbear avatar Mar 26 '23 20:03 garbear