|
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Typedefs | |
| using | KODI::GAME::ControllerPtr = std::shared_ptr<CController> |
| Smart pointer to a game controller (CController) | |
| using | KODI::GAME::ControllerVector = std::vector<ControllerPtr> |
| Vector of smart pointers to a game controller (CController) | |
| using | KODI::GAME::ControllerGrid = std::vector<ControllerColumn> |
| Collection of controllers in a grid layout. | |
| using | KODI::GAME::CControllerTree = CControllerHub |
| Collection of ports on a console. | |
| using | KODI::GAME::GameClientPtr = std::shared_ptr<CGameClient> |
| Smart pointer to a game client (CGameClient) | |
| using | KODI::GAME::GameClientVector = std::vector<GameClientPtr> |
| Vector of smart pointers to a game client (CGameClient) | |
| using | KODI::GAME::GameClientPortPtr = std::unique_ptr<CGameClientPort> |
| Smart pointer to an input port for a game client (CGameClientPort) | |
| using | KODI::GAME::GameClientPortVec = std::vector<GameClientPortPtr> |
| Vector of smart pointers to input ports for a game client (CGameClientPort) | |
| using | KODI::GAME::GameClientDevicePtr = std::unique_ptr<CGameClientDevice> |
| Smart pointer to an input device for a game client (CGameClientDevice) | |
| using | KODI::GAME::GameClientDeviceVec = std::vector<GameClientDevicePtr> |
| Vector of smart pointers to input devices for a game client (CGameClientDevice) | |
| using | KODI::GAME::GameAgentPtr = std::shared_ptr<CGameAgent> |
| Smart pointer to a game-playing agent (CGameAgent) | |
| using | KODI::GAME::GameAgentVec = std::vector<GameAgentPtr> |
| Vector of smart pointers to game-playing agents (CGameAgent) | |
Functions | |
| bool | KODI::GAME::IsTimeFormat (const std::string &format) |
| Turn a raw leaderboard value into something readable. | |
| std::string | KODI::GAME::FormatRelativeDate (std::time_t submitted, std::time_t now) |
| How long ago something was submitted, in words. | |
| std::string | KODI::GAME::RankMedal (unsigned int rank) |
| Which medal a place on a leaderboard earns, if any. | |
| void | KODI::GAME::SaveLeaderboardEntries (unsigned int leaderboardId, const std::string &account, const std::vector< LeaderboardEntry > &entries) |
| Remember a leaderboard's standings between sessions. | |
| bool | KODI::GAME::LoadLeaderboardEntries (unsigned int leaderboardId, const std::string &account, std::vector< LeaderboardEntry > &entries) |
| Read back standings kept from a previous session. | |
| void | KODI::GAME::ForgetLeaderboardEntries (unsigned int leaderboardId) |
| Forget a leaderboard's kept standings. | |
| void | KODI::GAME::ClearLeaderboardEntries () |
| Forget every leaderboard's kept standings. | |
Variables | |
| constexpr auto | KODI::GAME::GAME_CLIENT_RESOURCES_DIRECTORY = "resources" |
| Name of the resources directory for game clients. | |
| constexpr unsigned int | MAX_PORT_COUNT = 12 |
| The maximum port count, chosen to allow for two Saturn 6 Player Adapters. | |
Everything about RetroPlayer.
Collection of ports on a console.
| using KODI::GAME::ControllerGrid = std::vector<ControllerColumn> |
Collection of controllers in a grid layout.
| using KODI::GAME::ControllerPtr = std::shared_ptr<CController> |
Smart pointer to a game controller (CController)
| using KODI::GAME::ControllerVector = std::vector<ControllerPtr> |
Vector of smart pointers to a game controller (CController)
| using KODI::GAME::GameAgentPtr = std::shared_ptr<CGameAgent> |
Smart pointer to a game-playing agent (CGameAgent)
| using KODI::GAME::GameAgentVec = std::vector<GameAgentPtr> |
Vector of smart pointers to game-playing agents (CGameAgent)
| using KODI::GAME::GameClientDevicePtr = std::unique_ptr<CGameClientDevice> |
Smart pointer to an input device for a game client (CGameClientDevice)
| using KODI::GAME::GameClientDeviceVec = std::vector<GameClientDevicePtr> |
Vector of smart pointers to input devices for a game client (CGameClientDevice)
| using KODI::GAME::GameClientPortPtr = std::unique_ptr<CGameClientPort> |
Smart pointer to an input port for a game client (CGameClientPort)
| using KODI::GAME::GameClientPortVec = std::vector<GameClientPortPtr> |
Vector of smart pointers to input ports for a game client (CGameClientPort)
| using KODI::GAME::GameClientPtr = std::shared_ptr<CGameClient> |
Smart pointer to a game client (CGameClient)
| using KODI::GAME::GameClientVector = std::vector<GameClientPtr> |
Vector of smart pointers to a game client (CGameClient)
|
strong |
|
strong |
|
strong |
Methods for stretching the game to the viewing area.
| void KODI::GAME::ClearLeaderboardEntries | ( | ) |
Forget every leaderboard's kept standings.
Offered to the player because the kept copies are the only thing between them and a fresh answer, and a table that has been beaten in the last few minutes is otherwise a week away from being asked for again.
Forget a leaderboard's kept standings.
Called when the player's own standing on it changes. The kept page was fetched before they submitted, so it is wrong rather than merely old, and leaving it would show them a table they are no longer in the right place in until it aged out a week later.
| std::string KODI::GAME::FormatRelativeDate | ( | std::time_t | submitted, |
| std::time_t | now ) |
How long ago something was submitted, in words.
A leaderboard is read down a column, and "3 months ago" is taken in at a glance where a date has to be worked out against today's. The exact date is still published alongside for anyone who wants it.
| submitted | When it was submitted, as a unix timestamp |
| now | The current time, passed in so the result can be tested |
| bool KODI::GAME::IsTimeFormat | ( | const std::string & | format | ) |
Turn a raw leaderboard value into something readable.
RetroAchievements sends scores as plain integers and says separately how to read them: 9000 is nine thousand points on one leaderboard and two and a half minutes on another. Both leaderboard dialogs need this.
Follows rcheevos, which is what formats the same game's live tracker inside the add-on. The two would otherwise write one leaderboard's values two ways.
| score | The value as sent |
| format | The leaderboard's format, as the server names it. Anything unrecognised is shown as a plain number, since a wrong unit reads worse than none. |
Whether a leaderboard measures a duration rather than a quantity
Every format FormatLeaderboardScore() reads as a time is named here, so that what a value looks like and what the board is called cannot disagree.
| bool KODI::GAME::LoadLeaderboardEntries | ( | unsigned int | leaderboardId, |
| const std::string & | account, | ||
| std::vector< LeaderboardEntry > & | entries ) |
Read back standings kept from a previous session.
| leaderboardId | The leaderboard | |
| account | The RetroAchievements account the standings were read for | |
| [out] | entries | Filled in if anything was kept and it is still fresh |
| std::string KODI::GAME::RankMedal | ( | unsigned int | rank | ) |
Which medal a place on a leaderboard earns, if any.
| void KODI::GAME::SaveLeaderboardEntries | ( | unsigned int | leaderboardId, |
| const std::string & | account, | ||
| const std::vector< LeaderboardEntry > & | entries ) |
Remember a leaderboard's standings between sessions.
Standings are a request each and change slowly - a table that has stood for months will not have moved because Kodi restarted. Keeping them means reopening a leaderboard already looked at costs nothing, and a game with thirty of them is not thirty requests every time.
Written to userdata rather than a database: there are few of them, they are small, and losing them costs one refetch.
| leaderboardId | The leaderboard |
| account | The RetroAchievements account the standings were read for |
| entries | Its standings, as fetched |
|
constexpr |
Name of the resources directory for game clients.
|
constexpr |
The maximum port count, chosen to allow for two Saturn 6 Player Adapters.