Cheat operations
Cheat operation parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.
◆ CheatReset()
◆ GetMemory()
Get a region of memory.
- Parameters
-
| [in] | type | The type of memory to retrieve |
| [in] | data | Set to the region of memory; must remain valid until UnloadGame() is called |
| [in] | size | Set to the size of the region of memory |
- Returns
- The error, or GAME_ERROR_NO_ERROR if data was set to a valid buffer
◆ SetCheat()
| virtual GAME_ERROR SetCheat |
( |
unsigned int | index, |
|
|
bool | enabled, |
|
|
const std::string & | code ) |
|
inlinevirtual |
Set a cheat code.
- Parameters
-
| [in] | index | |
| [in] | enabled | |
| [in] | code | |
- Returns
- The error, or GAME_ERROR_NO_ERROR if the cheat was set
◆ SetRetroAchievementsCredentials()
| virtual GAME_ERROR SetRetroAchievementsCredentials |
( |
const std::string & | username, |
|
|
const std::string & | token ) |
|
inlinevirtual |
Set the credentials of the RetroAchievements user.
- Parameters
-
| [in] | username | The RetroAchievements username of the user |
| [in] | token | The login token to RetroAchievements of the user |
- Returns
- The error, or GAME_ERROR_NO_ERROR if the call was successful
◆ RCSetHardcoreEnabled()
| virtual GAME_ERROR RCSetHardcoreEnabled |
( |
bool | enabled | ) |
|
|
inlinevirtual |
Set whether achievements are earned in hardcore mode.
The frontend enforces the restrictions hardcore requires. The client is told so its runtime agrees, and so that anything the client itself can do that hardcore forbids - cheats, for one - can be refused here too.
- Parameters
-
| [in] | enabled | True to earn in hardcore mode |
- Returns
- The error, or GAME_ERROR_NO_ERROR on success
- Note
- Added in Game API 8.1.0
◆ RCSetEncoreModeEnabled()
| virtual GAME_ERROR RCSetEncoreModeEnabled |
( |
bool | enabled | ) |
|
|
inlinevirtual |
Set whether already-earned achievements can be earned again.
- Parameters
-
| [in] | enabled | True to re-earn achievements already unlocked |
- Returns
- The error, or GAME_ERROR_NO_ERROR on success
- Note
- Added in Game API 8.1.0
◆ ActivateAchievement()
| virtual GAME_ERROR ActivateAchievement |
( |
unsigned int | cheevoId, |
|
|
const std::string & | memAddrExpression ) |
|
inlinevirtual |
Activate an achievement.
- Parameters
-
| [in] | cheevoId | The achievement ID |
| [in] | memAddrExpression | Achievement memory expression from patch data as a string |
- Returns
- The error, or GAME_ERROR_NO_ERROR if the call was successful
◆ GetCheevoUrlId()
| virtual GAME_ERROR GetCheevoUrlId |
( |
const std::function< void(const std::string &achievementUrl, unsigned int cheevoId)> & | callback | ) |
|
|
inlinevirtual |
Get triggered achievement URL and ID pairs.
- Parameters
-
| [in] | callback | Callback invoked once per triggered achievement during this call. It may be called zero or more times before the function returns. Implementations must not retain/copy the callback for later use. The URL string reference is valid only for the callback invocation and must be copied if needed afterwards. |
- Returns
- The error, or GAME_ERROR_NO_ERROR if the call was successful
◆ RCOnGameLoaded()
Callback to Kodi Function
Notify Kodi that a game has been identified by the achievement runtime
- Parameters
-
| [in] | data | The achievement set of the game |
- Note
- Added in Game API 8.0.0
◆ RCOnAchievementTriggered()
Callback to Kodi Function
Notify Kodi that the player has earned an achievement
- Parameters
-
| [in] | data | The achievement that was earned |
- Note
- Added in Game API 8.0.0
◆ RCOnGameCompleted()
| void RCOnGameCompleted |
( |
const std::string & | title, |
|
|
bool | hardcore ) |
|
inline |
Callback to Kodi Function
Notify Kodi that every achievement of the game has been earned
- Parameters
-
| [in] | title | The title of the completed game |
| [in] | hardcore | True if the game was completed in hardcore mode |
- Note
- Added in Game API 8.0.0
◆ RCOnRichPresenceUpdated()
| void RCOnRichPresenceUpdated |
( |
const std::string & | evaluation | ) |
|
|
inline |
Callback to Kodi Function
Publish the current rich presence evaluation to Kodi
- Parameters
-
| [in] | evaluation | What the player is currently doing in the game |
- Note
- Added in Game API 8.0.0
◆ RCOnLoginResult()
Callback to Kodi Function
Notify Kodi of the outcome of a login attempt
- Parameters
-
- Note
- Added in Game API 8.0.0
◆ RCOnAchievementProgress()
Callback to Kodi Function
Publish progress towards the game's measured achievements
Sent whenever the reported progress changes. Achievements without a measured trigger condition are omitted.
- Parameters
-
| [in] | progress | Progress of each measured achievement |
- Note
- Added in Game API 8.0.0
◆ RCOnServerError()
| void RCOnServerError |
( |
const std::string & | message, |
|
|
const std::string & | api ) |
|
inline |
Callback to Kodi Function
Report an error returned by the RetroAchievements server
- Parameters
-
| [in] | message | The error as reported by the server |
| [in] | api | The API call that failed, or an empty string |
- Note
- Added in Game API 8.0.0
◆ RCOnConnectionChanged()
| void RCOnConnectionChanged |
( |
bool | connected | ) |
|
|
inline |
Callback to Kodi Function
Report a change in connectivity to the RetroAchievements server
Unlocks earned while disconnected are held by the add-on and submitted once the connection returns.
- Parameters
-
| [in] | connected | True if the server is reachable again |
- Note
- Added in Game API 8.0.0
◆ RCOnChallengeIndicator()
Callback to Kodi Function
Show or hide the indicator for an achievement the player is attempting
- Parameters
-
| [in] | data | The achievement being attempted |
| [in] | show | True to show the indicator, false to hide it |
- Note
- Added in Game API 8.1.0
◆ RCOnAchievementProgressUpdate()
Callback to Kodi Function
Give Kodi a new value for a measured achievement already on screen
- Parameters
-
| [in] | data | The achievement and how far along it is |
- Note
- Added in Game API 8.1.0
◆ RCOnLeaderboardStarted()
Callback to Kodi Function
Notify Kodi that an attempt at a leaderboard has begun
- Parameters
-
| [in] | data | The leaderboard being attempted |
- Note
- Added in Game API 8.1.0
◆ RCOnLeaderboardFailed()
Callback to Kodi Function
Notify Kodi that an attempt at a leaderboard has been abandoned
- Parameters
-
| [in] | data | The leaderboard that was being attempted |
- Note
- Added in Game API 8.1.0
◆ RCOnLeaderboardSubmitted()
Callback to Kodi Function
Notify Kodi that a leaderboard value has been sent to the server
Where it placed arrives later, through KodiRCOnLeaderboardScoreboard, and may not arrive at all.
- Parameters
-
| [in] | data | The leaderboard and the value submitted |
- Note
- Added in Game API 8.1.0
◆ RCOnLeaderboardTrackerUpdate()
Callback to Kodi Function
Give Kodi a new value for an attempt already on screen
- Parameters
-
| [in] | data | The tracker and its current value |
- Note
- Added in Game API 8.1.0
◆ RCOnLeaderboardScoreboard()
Callback to Kodi Function
Tell Kodi where a submitted attempt placed
- Parameters
-
- Note
- Added in Game API 8.1.0
◆ RCOnReset()
Callback to Kodi Function
Ask the frontend to reset the game
Raised when hardcore mode is enabled, because a session started in casual mode may not continue into hardcore.
- Note
- Added in Game API 8.1.0
◆ RCOnSubsetCompleted()
| void RCOnSubsetCompleted |
( |
const std::string & | title | ) |
|
|
inline |
Callback to Kodi Function
Notify Kodi that every achievement of a subset has been earned
- Parameters
-
| [in] | title | The title of the completed subset |
- Note
- Added in Game API 8.1.0
◆ RCOnAchievementProgressIndicator()
Callback to Kodi Function
Show, update or hide how far along a measured achievement is
Some achievements are measured rather than simply locked or unlocked, and the runtime reports progress while the player works towards one. Show and update are separate events but the same thing on screen, so both set the value; hide removes it.
- Parameters
-
| [in] | data | The achievement and how far along it is |
| [in] | show | True to show or update it, false to hide it |
- Note
- Added in Game API 8.1.0
◆ RCOnLeaderboardTracker()
Callback to Kodi Function
Show, update or hide the live value of an attempt in progress
Show and update are separate events in the runtime but the same thing on screen, so both set the value; hide removes it.
- Parameters
-
| [in] | data | The tracker and its current value |
| [in] | show | True to show or update it, false to hide it |
- Note
- Added in Game API 8.1.0