Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Cheat operations More...

Functions

virtual GAME_ERROR kodi::addon::CInstanceGame::CheatReset ()
 Reset the cheat system.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::GetMemory (GAME_MEMORY type, uint8_t *&data, size_t &size)
 Get a region of memory.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::SetCheat (unsigned int index, bool enabled, const std::string &code)
 Set a cheat code.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::SetRetroAchievementsCredentials (const std::string &username, const std::string &token)
 Set the credentials of the RetroAchievements user.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::RCSetHardcoreEnabled (bool enabled)
 Set whether achievements are earned in hardcore mode.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::RCSetEncoreModeEnabled (bool enabled)
 Set whether already-earned achievements can be earned again.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::ActivateAchievement (unsigned int cheevoId, const std::string &memAddrExpression)
 Activate an achievement.
 
virtual GAME_ERROR kodi::addon::CInstanceGame::GetCheevoUrlId (const std::function< void(const std::string &achievementUrl, unsigned int cheevoId)> &callback)
 Get triggered achievement URL and ID pairs.
 
void kodi::addon::CInstanceGame::RCOnGameLoaded (const game_rc_game_loaded &data)
 Callback to Kodi Function
Notify Kodi that a game has been identified by the achievement runtime
 
void kodi::addon::CInstanceGame::RCOnAchievementTriggered (const game_rc_achievement_triggered &data)
 Callback to Kodi Function
Notify Kodi that the player has earned an achievement
 
void kodi::addon::CInstanceGame::RCOnGameCompleted (const std::string &title, bool hardcore)
 Callback to Kodi Function
Notify Kodi that every achievement of the game has been earned
 
void kodi::addon::CInstanceGame::RCOnRichPresenceUpdated (const std::string &evaluation)
 Callback to Kodi Function
Publish the current rich presence evaluation to Kodi
 
void kodi::addon::CInstanceGame::RCOnLoginResult (const game_rc_login_result &data)
 Callback to Kodi Function
Notify Kodi of the outcome of a login attempt
 
void kodi::addon::CInstanceGame::RCOnAchievementProgress (const std::vector< game_rc_achievement_progress > &progress)
 Callback to Kodi Function
Publish progress towards the game's measured achievements
 
void kodi::addon::CInstanceGame::RCOnServerError (const std::string &message, const std::string &api)
 Callback to Kodi Function
Report an error returned by the RetroAchievements server
 
void kodi::addon::CInstanceGame::RCOnConnectionChanged (bool connected)
 Callback to Kodi Function
Report a change in connectivity to the RetroAchievements server
 
void kodi::addon::CInstanceGame::RCOnChallengeIndicator (const game_rc_achievement_challenge &data, bool show)
 Callback to Kodi Function
Show or hide the indicator for an achievement the player is attempting
 
void kodi::addon::CInstanceGame::RCOnAchievementProgressUpdate (const game_rc_achievement_progress_indicator &data)
 Callback to Kodi Function
Give Kodi a new value for a measured achievement already on screen
 
void kodi::addon::CInstanceGame::RCOnLeaderboardStarted (const game_rc_leaderboard &data)
 Callback to Kodi Function
Notify Kodi that an attempt at a leaderboard has begun
 
void kodi::addon::CInstanceGame::RCOnLeaderboardFailed (const game_rc_leaderboard &data)
 Callback to Kodi Function
Notify Kodi that an attempt at a leaderboard has been abandoned
 
void kodi::addon::CInstanceGame::RCOnLeaderboardSubmitted (const game_rc_leaderboard &data)
 Callback to Kodi Function
Notify Kodi that a leaderboard value has been sent to the server
 
void kodi::addon::CInstanceGame::RCOnLeaderboardTrackerUpdate (const game_rc_leaderboard_tracker &data)
 Callback to Kodi Function
Give Kodi a new value for an attempt already on screen
 
void kodi::addon::CInstanceGame::RCOnLeaderboardScoreboard (const game_rc_leaderboard_scoreboard &data)
 Callback to Kodi Function
Tell Kodi where a submitted attempt placed
 
void kodi::addon::CInstanceGame::RCOnReset ()
 Callback to Kodi Function
Ask the frontend to reset the game
 
void kodi::addon::CInstanceGame::RCOnSubsetCompleted (const std::string &title)
 Callback to Kodi Function
Notify Kodi that every achievement of a subset has been earned
 
void kodi::addon::CInstanceGame::RCOnAchievementProgressIndicator (const game_rc_achievement_progress_indicator &data, bool show)
 Callback to Kodi Function
Show, update or hide how far along a measured achievement is
 
void kodi::addon::CInstanceGame::RCOnLeaderboardTracker (const game_rc_leaderboard_tracker &data, bool show)
 Callback to Kodi Function
Show, update or hide the live value of an attempt in progress
 

Detailed Description

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.

Function Documentation

◆ ActivateAchievement()

virtual GAME_ERROR kodi::addon::CInstanceGame::ActivateAchievement ( unsigned int cheevoId,
const std::string & memAddrExpression )
inlinevirtual

Activate an achievement.

Parameters
[in]cheevoIdThe achievement ID
[in]memAddrExpressionAchievement memory expression from patch data as a string
Returns
The error, or GAME_ERROR_NO_ERROR if the call was successful

◆ CheatReset()

virtual GAME_ERROR kodi::addon::CInstanceGame::CheatReset ( )
inlinevirtual

Reset the cheat system.

Returns
The error, or GAME_ERROR_NO_ERROR if the cheat system was reset

◆ GetCheevoUrlId()

virtual GAME_ERROR kodi::addon::CInstanceGame::GetCheevoUrlId ( const std::function< void(const std::string &achievementUrl, unsigned int cheevoId)> & callback)
inlinevirtual

Get triggered achievement URL and ID pairs.

Parameters
[in]callbackCallback 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

◆ GetMemory()

virtual GAME_ERROR kodi::addon::CInstanceGame::GetMemory ( GAME_MEMORY type,
uint8_t *& data,
size_t & size )
inlinevirtual

Get a region of memory.

Parameters
[in]typeThe type of memory to retrieve
[in]dataSet to the region of memory; must remain valid until UnloadGame() is called
[in]sizeSet to the size of the region of memory
Returns
The error, or GAME_ERROR_NO_ERROR if data was set to a valid buffer

◆ RCOnAchievementProgress()

void kodi::addon::CInstanceGame::RCOnAchievementProgress ( const std::vector< game_rc_achievement_progress > & progress)
inline

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]progressProgress of each measured achievement
Remarks
Only called from the add-on itself
Note
Added in Game API 8.0.0

◆ RCOnAchievementProgressIndicator()

void kodi::addon::CInstanceGame::RCOnAchievementProgressIndicator ( const game_rc_achievement_progress_indicator & data,
bool show )
inline

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]dataThe achievement and how far along it is
[in]showTrue to show or update it, false to hide it
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnAchievementProgressUpdate()

void kodi::addon::CInstanceGame::RCOnAchievementProgressUpdate ( const game_rc_achievement_progress_indicator & data)
inline

Callback to Kodi Function
Give Kodi a new value for a measured achievement already on screen

Parameters
[in]dataThe achievement and how far along it is
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnAchievementTriggered()

void kodi::addon::CInstanceGame::RCOnAchievementTriggered ( const game_rc_achievement_triggered & data)
inline

Callback to Kodi Function
Notify Kodi that the player has earned an achievement

Parameters
[in]dataThe achievement that was earned
Remarks
Only called from the add-on itself
Note
Added in Game API 8.0.0

◆ RCOnChallengeIndicator()

void kodi::addon::CInstanceGame::RCOnChallengeIndicator ( const game_rc_achievement_challenge & data,
bool show )
inline

Callback to Kodi Function
Show or hide the indicator for an achievement the player is attempting

Parameters
[in]dataThe achievement being attempted
[in]showTrue to show the indicator, false to hide it
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnConnectionChanged()

void kodi::addon::CInstanceGame::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]connectedTrue if the server is reachable again
Remarks
Only called from the add-on itself
Note
Added in Game API 8.0.0

◆ RCOnGameCompleted()

void kodi::addon::CInstanceGame::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]titleThe title of the completed game
[in]hardcoreTrue if the game was completed in hardcore mode
Remarks
Only called from the add-on itself
Note
Added in Game API 8.0.0

◆ RCOnGameLoaded()

void kodi::addon::CInstanceGame::RCOnGameLoaded ( const game_rc_game_loaded & data)
inline

Callback to Kodi Function
Notify Kodi that a game has been identified by the achievement runtime

Parameters
[in]dataThe achievement set of the game
Remarks
Only called from the add-on itself. The pointers inside data need only stay valid for the duration of the call.
Note
Added in Game API 8.0.0

◆ RCOnLeaderboardFailed()

void kodi::addon::CInstanceGame::RCOnLeaderboardFailed ( const game_rc_leaderboard & data)
inline

Callback to Kodi Function
Notify Kodi that an attempt at a leaderboard has been abandoned

Parameters
[in]dataThe leaderboard that was being attempted
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnLeaderboardScoreboard()

void kodi::addon::CInstanceGame::RCOnLeaderboardScoreboard ( const game_rc_leaderboard_scoreboard & data)
inline

Callback to Kodi Function
Tell Kodi where a submitted attempt placed

Parameters
[in]dataThe new standing
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnLeaderboardStarted()

void kodi::addon::CInstanceGame::RCOnLeaderboardStarted ( const game_rc_leaderboard & data)
inline

Callback to Kodi Function
Notify Kodi that an attempt at a leaderboard has begun

Parameters
[in]dataThe leaderboard being attempted
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnLeaderboardSubmitted()

void kodi::addon::CInstanceGame::RCOnLeaderboardSubmitted ( const game_rc_leaderboard & data)
inline

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]dataThe leaderboard and the value submitted
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnLeaderboardTracker()

void kodi::addon::CInstanceGame::RCOnLeaderboardTracker ( const game_rc_leaderboard_tracker & data,
bool show )
inline

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]dataThe tracker and its current value
[in]showTrue to show or update it, false to hide it
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnLeaderboardTrackerUpdate()

void kodi::addon::CInstanceGame::RCOnLeaderboardTrackerUpdate ( const game_rc_leaderboard_tracker & data)
inline

Callback to Kodi Function
Give Kodi a new value for an attempt already on screen

Parameters
[in]dataThe tracker and its current value
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnLoginResult()

void kodi::addon::CInstanceGame::RCOnLoginResult ( const game_rc_login_result & data)
inline

Callback to Kodi Function
Notify Kodi of the outcome of a login attempt

Parameters
[in]dataThe login result
Remarks
Only called from the add-on itself
Note
Added in Game API 8.0.0

◆ RCOnReset()

void kodi::addon::CInstanceGame::RCOnReset ( )
inline

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.

Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCOnRichPresenceUpdated()

void kodi::addon::CInstanceGame::RCOnRichPresenceUpdated ( const std::string & evaluation)
inline

Callback to Kodi Function
Publish the current rich presence evaluation to Kodi

Parameters
[in]evaluationWhat the player is currently doing in the game
Remarks
Only called from the add-on itself
Note
Added in Game API 8.0.0

◆ RCOnServerError()

void kodi::addon::CInstanceGame::RCOnServerError ( const std::string & message,
const std::string & api )
inline

Callback to Kodi Function
Report an error returned by the RetroAchievements server

Parameters
[in]messageThe error as reported by the server
[in]apiThe API call that failed, or an empty string
Remarks
Only called from the add-on itself
Note
Added in Game API 8.0.0

◆ RCOnSubsetCompleted()

void kodi::addon::CInstanceGame::RCOnSubsetCompleted ( const std::string & title)
inline

Callback to Kodi Function
Notify Kodi that every achievement of a subset has been earned

Parameters
[in]titleThe title of the completed subset
Remarks
Only called from the add-on itself
Note
Added in Game API 8.1.0

◆ RCSetEncoreModeEnabled()

virtual GAME_ERROR kodi::addon::CInstanceGame::RCSetEncoreModeEnabled ( bool enabled)
inlinevirtual

Set whether already-earned achievements can be earned again.

Parameters
[in]enabledTrue to re-earn achievements already unlocked
Returns
The error, or GAME_ERROR_NO_ERROR on success
Note
Added in Game API 8.1.0

◆ RCSetHardcoreEnabled()

virtual GAME_ERROR kodi::addon::CInstanceGame::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]enabledTrue to earn in hardcore mode
Returns
The error, or GAME_ERROR_NO_ERROR on success
Note
Added in Game API 8.1.0

◆ SetCheat()

virtual GAME_ERROR kodi::addon::CInstanceGame::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 kodi::addon::CInstanceGame::SetRetroAchievementsCredentials ( const std::string & username,
const std::string & token )
inlinevirtual

Set the credentials of the RetroAchievements user.

Parameters
[in]usernameThe RetroAchievements username of the user
[in]tokenThe login token to RetroAchievements of the user
Returns
The error, or GAME_ERROR_NO_ERROR if the call was successful