xbmc
GameClientCheevos.h
1 /*
2  * Copyright (C) 2020-2021 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <stddef.h> /* size_t */
12 #include <string>
13 
14 struct AddonInstance_Game;
15 
16 namespace KODI
17 {
18 namespace RETRO
19 {
20 enum class RConsoleID;
21 }
22 
23 namespace GAME
24 {
25 
26 class CGameClient;
27 
32 {
33 public:
34  CGameClientCheevos(CGameClient& gameClient, AddonInstance_Game& addonStruct);
35 
36  bool RCGenerateHashFromFile(std::string& hash,
37  RETRO::RConsoleID consoleID,
38  const std::string& filePath);
39  bool RCGetGameIDUrl(std::string& url, const std::string& hash);
40  bool RCGetPatchFileUrl(std::string& url,
41  const std::string& username,
42  const std::string& token,
43  unsigned int gameID);
44  void SetRetroAchievementsCredentials(const std::string& username, const std::string& token);
45  bool RCPostRichPresenceUrl(std::string& url,
46  std::string& postData,
47  const std::string& username,
48  const std::string& token,
49  unsigned gameID,
50  const std::string& richPresence);
51  void RCEnableRichPresence(const std::string& script);
52  void RCGetRichPresenceEvaluation(std::string& evaluation, RETRO::RConsoleID consoleID);
53 
54  void ActivateAchievement(unsigned cheevoId, const char* memaddr);
55  void GetAchievement_URL_ID(void (*callback)(const char* achievementUrl, unsigned cheevoId));
56 
57  // When the game is reset, the runtime should also be reset
58  void RCResetRuntime();
59 
60 private:
61  CGameClient& m_gameClient;
62  AddonInstance_Game& m_struct;
63 };
64 } // namespace GAME
65 } // namespace KODI
Definition: GameClientCheevos.h:31
Interface between Kodi and Game add-ons.
Definition: GameClient.h:116
Definition: AudioDecoder.h:18
Game instance.
Definition: game.h:1228