|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Service for integrating with GOG.com. More...
#include <gog_integration.h>
Classes | |
| struct | Impl |
Public Types | |
| using | AuthCallback = std::function<void(bool success, const std::string& message)> |
| using | ProgressCallback = std::function<void(const GOGProgress&)> |
Public Member Functions | |
| GOGIntegration () | |
| ~GOGIntegration () | |
| void | authenticate (const AuthCallback &callback=nullptr) |
| Start authentication flow. | |
| void | cancelOperation () |
| Cancel ongoing operation. | |
| bool | downloadCloudSaves (const std::string &gameId) |
| Download cloud saves for a game. | |
| GOGBackend | getActiveBackend () const |
| Get which backend is being used. | |
| GOGAuthStatus | getAuthStatus () const |
| Get authentication status. | |
| std::filesystem::path | getDefaultInstallPath () const |
| Get default installation directory. | |
| std::optional< GOGGameInfo > | getGameInfo (const std::string &gameId) const |
| Get info for a specific game. | |
| std::vector< GOGGameInfo > | getInstalledGames () const |
| Get all installed GOG games. | |
| std::string | getLaunchCommand (const std::string &gameId) const |
| Get launch command for a game. | |
| std::vector< GOGGameInfo > | getLibrary (bool forceRefresh=false) |
| Get all games in GOG library. | |
| bool | hasUpdate (const std::string &gameId) const |
| Check if updates are available. | |
| bool | importGame (const std::string &gameId, const std::filesystem::path &existingPath) |
| Import existing game installation. | |
| bool | installGame (const std::string &gameId, const std::filesystem::path &installPath={}, const std::string &platform="", const ProgressCallback &progressCallback=nullptr) |
| Install a game. | |
| std::future< bool > | installGameAsync (const std::string &gameId, const std::filesystem::path &installPath={}, const std::string &platform="", const ProgressCallback &progressCallback=nullptr) |
| Install a game asynchronously. | |
| bool | isAuthenticated () const |
| Check if user is authenticated. | |
| bool | isAvailable () const |
| Check if GOG integration is available. | |
| bool | launchGame (const std::string &gameId, bool useProton=false, const std::string &protonVersion="") |
| Launch a game. | |
| void | logout () |
| Log out and clear credentials. | |
| void | setDefaultInstallPath (const std::filesystem::path &path) |
| Set default installation directory. | |
| void | setPreferredBackend (GOGBackend backend) |
| Set preferred backend. | |
| bool | syncCloudSaves (const std::string &gameId) |
| Sync cloud saves (bidirectional). | |
| int | syncLibrary () |
| Sync GOG library with game database. | |
| Game | toGame (const GOGGameInfo &gogGame) const |
| Convert GOG game to generic Game object. | |
| bool | uninstallGame (const std::string &gameId) |
| Uninstall a game. | |
| bool | updateGame (const std::string &gameId, const ProgressCallback &progressCallback=nullptr) |
| Update a game. | |
| bool | uploadCloudSaves (const std::string &gameId) |
| Upload local saves to cloud. | |
| bool | verifyGame (const std::string &gameId, const ProgressCallback &progressCallback=nullptr) |
| Verify game files. | |
Static Public Member Functions | |
| static bool | isGogdlAvailable () |
| Check if gogdl CLI is installed. | |
| static bool | isHeroicAvailable () |
| Check if Heroic Games Launcher is installed. | |
Service for integrating with GOG.com.
Provides methods for managing GOG library, installation, and cloud saves through Heroic Games Launcher or gogdl CLI.
One of:
Definition at line 165 of file gog_integration.h.
| using GOGIntegration::AuthCallback = std::function<void(bool success, const std::string& message)> |
Definition at line 169 of file gog_integration.h.
| using GOGIntegration::ProgressCallback = std::function<void(const GOGProgress&)> |
Definition at line 168 of file gog_integration.h.
| GOGIntegration::GOGIntegration | ( | ) |
Definition at line 135 of file gog_integration.cpp.
References Direct, GOGDL, Heroic, isGogdlAvailable(), and isHeroicAvailable().
| GOGIntegration::~GOGIntegration | ( | ) |
Definition at line 152 of file gog_integration.cpp.
| void GOGIntegration::authenticate | ( | const AuthCallback & | callback = nullptr | ) |
Start authentication flow.
| callback | Callback when auth completes |
Definition at line 332 of file gog_integration.cpp.
References Logger::info().
| void GOGIntegration::cancelOperation | ( | ) |
Cancel ongoing operation.
Definition at line 1016 of file gog_integration.cpp.
| bool GOGIntegration::downloadCloudSaves | ( | const std::string & | gameId | ) |
Download cloud saves for a game.
| gameId | GOG game ID |
Definition at line 911 of file gog_integration.cpp.
References Logger::info().
| GOGBackend GOGIntegration::getActiveBackend | ( | ) | const |
Get which backend is being used.
Definition at line 184 of file gog_integration.cpp.
| GOGAuthStatus GOGIntegration::getAuthStatus | ( | ) | const |
Get authentication status.
Definition at line 292 of file gog_integration.cpp.
References Logger::error(), Heroic, GOGAuthStatus::isAuthenticated, GOGAuthStatus::userId, and GOGAuthStatus::username.
Referenced by isAuthenticated().
| std::filesystem::path GOGIntegration::getDefaultInstallPath | ( | ) | const |
Get default installation directory.
Definition at line 1010 of file gog_integration.cpp.
| std::optional< GOGGameInfo > GOGIntegration::getGameInfo | ( | const std::string & | gameId | ) | const |
Get info for a specific game.
| gameId | GOG game ID |
Definition at line 642 of file gog_integration.cpp.
References GOGGameInfo::gameId.
Referenced by getLaunchCommand(), launchGame(), and uninstallGame().
| std::vector< GOGGameInfo > GOGIntegration::getInstalledGames | ( | ) | const |
Get all installed GOG games.
Definition at line 621 of file gog_integration.cpp.
References Heroic, and GOGGameInfo::isInstalled.
| std::string GOGIntegration::getLaunchCommand | ( | const std::string & | gameId | ) | const |
Get launch command for a game.
| gameId | GOG game ID |
Definition at line 989 of file gog_integration.cpp.
References getGameInfo().
| std::vector< GOGGameInfo > GOGIntegration::getLibrary | ( | bool | forceRefresh = false | ) |
Get all games in GOG library.
| forceRefresh | Force refresh from GOG servers |
Definition at line 603 of file gog_integration.cpp.
Referenced by syncLibrary().
| bool GOGIntegration::hasUpdate | ( | const std::string & | gameId | ) | const |
Check if updates are available.
| gameId | GOG game ID |
Definition at line 874 of file gog_integration.cpp.
| bool GOGIntegration::importGame | ( | const std::string & | gameId, |
| const std::filesystem::path & | existingPath ) |
Import existing game installation.
| gameId | GOG game ID |
| existingPath | Path to existing installation |
Definition at line 888 of file gog_integration.cpp.
References Logger::info().
| bool GOGIntegration::installGame | ( | const std::string & | gameId, |
| const std::filesystem::path & | installPath = {}, | ||
| const std::string & | platform = "", | ||
| const ProgressCallback & | progressCallback = nullptr ) |
Install a game.
| gameId | GOG game ID |
| installPath | Installation path (empty = default) |
| platform | Platform to install (empty = auto-detect) |
| progressCallback | Progress updates |
Definition at line 760 of file gog_integration.cpp.
Referenced by installGameAsync().
| std::future< bool > GOGIntegration::installGameAsync | ( | const std::string & | gameId, |
| const std::filesystem::path & | installPath = {}, | ||
| const std::string & | platform = "", | ||
| const ProgressCallback & | progressCallback = nullptr ) |
Install a game asynchronously.
Definition at line 777 of file gog_integration.cpp.
References installGame().
| bool GOGIntegration::isAuthenticated | ( | ) | const |
Check if user is authenticated.
Definition at line 327 of file gog_integration.cpp.
References getAuthStatus(), and GOGAuthStatus::isAuthenticated.
| bool GOGIntegration::isAvailable | ( | ) | const |
Check if GOG integration is available.
Definition at line 179 of file gog_integration.cpp.
References isGogdlAvailable(), and isHeroicAvailable().
|
static |
Check if gogdl CLI is installed.
Definition at line 202 of file gog_integration.cpp.
Referenced by GOGIntegration(), isAvailable(), and setPreferredBackend().
|
static |
Check if Heroic Games Launcher is installed.
Definition at line 189 of file gog_integration.cpp.
Referenced by GOGIntegration(), isAvailable(), and setPreferredBackend().
| bool GOGIntegration::launchGame | ( | const std::string & | gameId, |
| bool | useProton = false, | ||
| const std::string & | protonVersion = "" ) |
Launch a game.
| gameId | GOG game ID |
| useProton | Use Proton for Windows games |
| protonVersion | Proton version to use |
Definition at line 934 of file gog_integration.cpp.
References Logger::error(), ShellUtils::escapeArg(), getGameInfo(), and Logger::info().
| void GOGIntegration::logout | ( | ) |
Log out and clear credentials.
Definition at line 343 of file gog_integration.cpp.
References Logger::info().
| void GOGIntegration::setDefaultInstallPath | ( | const std::filesystem::path & | path | ) |
Set default installation directory.
| path | Default install path |
Definition at line 1004 of file gog_integration.cpp.
| void GOGIntegration::setPreferredBackend | ( | GOGBackend | backend | ) |
Set preferred backend.
| backend | Preferred backend (will fall back if unavailable) |
Definition at line 238 of file gog_integration.cpp.
References GOGDL, Heroic, isGogdlAvailable(), and isHeroicAvailable().
| bool GOGIntegration::syncCloudSaves | ( | const std::string & | gameId | ) |
Sync cloud saves (bidirectional).
| gameId | GOG game ID |
Definition at line 924 of file gog_integration.cpp.
References Logger::info().
| int GOGIntegration::syncLibrary | ( | ) |
Sync GOG library with game database.
Definition at line 697 of file gog_integration.cpp.
References getLibrary(), and Logger::info().
| Game GOGIntegration::toGame | ( | const GOGGameInfo & | gogGame | ) | const |
Convert GOG game to generic Game object.
| gogGame | GOG game info |
Definition at line 656 of file gog_integration.cpp.
References GOGGameInfo::backgroundUrl, GOGGameInfo::coverUrl, GameMetadata::developer, GOGGameInfo::developer, GOGGameInfo::executable, GameRunnerConfig::executablePath, GOGGameInfo::gameId, GameMetadata::genres, GOGGameInfo::genres, GOG, GOGGameInfo::hasLinuxBuild, GameImagePaths::heroImage, Game::id, GameMetadata::imagePaths, Game::installPath, GOGGameInfo::installPath, GOGGameInfo::isInstalled, Game::metadata, Game::name, Native, GameMetadata::publisher, GOGGameInfo::publisher, Game::runner, Game::runnerConfig, Game::source, GOGGameInfo::title, GameImagePaths::verticalCover, and Wine.
| bool GOGIntegration::uninstallGame | ( | const std::string & | gameId | ) |
Uninstall a game.
| gameId | GOG game ID |
Definition at line 806 of file gog_integration.cpp.
References Logger::error(), getGameInfo(), and Logger::info().
| bool GOGIntegration::updateGame | ( | const std::string & | gameId, |
| const ProgressCallback & | progressCallback = nullptr ) |
Update a game.
| gameId | GOG game ID |
| progressCallback | Progress updates |
Definition at line 862 of file gog_integration.cpp.
References GOGDL, and Logger::info().
| bool GOGIntegration::uploadCloudSaves | ( | const std::string & | gameId | ) |
Upload local saves to cloud.
| gameId | GOG game ID |
Definition at line 918 of file gog_integration.cpp.
References Logger::info().
| bool GOGIntegration::verifyGame | ( | const std::string & | gameId, |
| const ProgressCallback & | progressCallback = nullptr ) |
Verify game files.
| gameId | GOG game ID |
| progressCallback | Progress updates |
Definition at line 880 of file gog_integration.cpp.
References Logger::info().