|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Service for fetching game compatibility data from ProtonDB. More...
#include <protondb_service.h>
Public Types | |
| using | GameInfoCallback = std::function<void(const ProtonDBGameInfo&)> |
| using | SearchCallback = std::function<void(const std::vector<ProtonDBSearchResult>&)> |
Static Public Member Functions | |
| static void | clearCache () |
| Clear cached data. | |
| static ProtonDBGameInfo | findGameByName (const std::string &gameName) |
| Find game info by name (searches for matching game, returns full info). | |
| static void | findGameByNameAsync (const std::string &gameName, const GameInfoCallback &callback) |
| Find game info by name asynchronously. | |
| static ProtonDBGameInfo | getGameInfo (int steamAppId) |
| Get game info by Steam App ID. | |
| static void | getGameInfoAsync (int steamAppId, const GameInfoCallback &callback) |
| Get game info asynchronously. | |
| static LutrisGameInfo | getLutrisInfo (int steamAppId) |
| Get Lutris game info and installers. | |
| static void | getLutrisInfoAsync (int steamAppId, const std::function< void(const LutrisGameInfo &)> &callback) |
| Get Lutris info asynchronously. | |
| static LutrisGameInfo | getLutrisInfoBySlug (const std::string &gameSlug) |
| Get Lutris info by game slug. | |
| static SteamAppInfo | getSteamAppInfo (int steamAppId) |
| Get Steam store information (native Linux, genres, DRM, etc.). | |
| static void | getSteamAppInfoAsync (int steamAppId, const std::function< void(const SteamAppInfo &)> &callback) |
| Get Steam app info asynchronously. | |
| static SteamDeckInfo | getSteamDeckInfo (int steamAppId) |
| Get Steam Deck compatibility status from Valve's testing. | |
| static void | getSteamDeckInfoAsync (int steamAppId, const std::function< void(const SteamDeckInfo &)> &callback) |
| Get Steam Deck compatibility asynchronously. | |
| static std::string | getTier (int steamAppId) |
| Get compatibility tier for a game (quick lookup). | |
| static void | getTierColor (const std::string &tier, float &r, float &g, float &b, float &a) |
| Get tier color for UI display (RGBA). | |
| static std::string | getTierDescription (const std::string &tier) |
| Get human-readable tier description. | |
| static std::vector< ProtonDBSearchResult > | searchByName (const std::string &gameName, int maxResults=10) |
| Search for games by name. | |
| static void | searchByNameAsync (const std::string &gameName, const SearchCallback &callback, int maxResults=10) |
| Search for games by name asynchronously. | |
Service for fetching game compatibility data from ProtonDB.
Provides methods to look up game compatibility information and extract recommended settings from user reports.
Definition at line 259 of file protondb_service.h.
| using ProtonDBService::GameInfoCallback = std::function<void(const ProtonDBGameInfo&)> |
Definition at line 296 of file protondb_service.h.
| using ProtonDBService::SearchCallback = std::function<void(const std::vector<ProtonDBSearchResult>&)> |
Definition at line 297 of file protondb_service.h.
|
static |
Clear cached data.
Clears any cached API responses to force fresh lookups.
Definition at line 951 of file protondb_service.cpp.
References Logger::info().
|
static |
Find game info by name (searches for matching game, returns full info).
| gameName | Name of the game to search for |
This method searches for the game by name, finds the best match, and returns full compatibility information including tweaks. Useful when you don't know the Steam App ID.
Definition at line 759 of file protondb_service.cpp.
References ProtonDBGameInfo::errorMessage, getGameInfo(), Logger::info(), searchByName(), and Logger::warn().
Referenced by findGameByNameAsync().
|
static |
Find game info by name asynchronously.
| gameName | Name of the game to search for |
| callback | Function to call with results |
Definition at line 866 of file protondb_service.cpp.
References findGameByName().
|
static |
Get game info by Steam App ID.
| steamAppId | Steam App ID to look up |
Makes HTTP requests to ProtonDB APIs. May block for several seconds. For UI updates, prefer getGameInfoAsync().
Definition at line 585 of file protondb_service.cpp.
References Logger::debug(), ProtonDBGameInfo::errorMessage, ProtonDBGameInfo::found, Logger::info(), ProtonDBGameInfo::tweaks, and Logger::warn().
Referenced by findGameByName(), getGameInfoAsync(), and getTier().
|
static |
Get game info asynchronously.
| steamAppId | Steam App ID to look up |
| callback | Function to call with results (called from background thread) |
Returns immediately. Callback is invoked when data is available. Callback may be invoked from a different thread.
Definition at line 728 of file protondb_service.cpp.
References getGameInfo().
|
static |
Get Lutris game info and installers.
| steamAppId | Steam App ID to search for |
Fetches community-tested installation scripts from Lutris database. These contain working configurations for many games.
Definition at line 1237 of file protondb_service.cpp.
References LutrisInstaller::battleye, Logger::debug(), LutrisInstaller::dllOverrides, LutrisInstaller::eac, LutrisInstaller::environmentVariables, LutrisGameInfo::found, LutrisInstaller::found, Logger::info(), LutrisGameInfo::installers, LutrisGameInfo::name, LutrisInstaller::name, LutrisInstaller::runner, LutrisGameInfo::slug, LutrisInstaller::slug, LutrisGameInfo::steamId, LutrisInstaller::version, Logger::warn(), and LutrisInstaller::wineVersion.
Referenced by getLutrisInfoAsync(), and getLutrisInfoBySlug().
|
static |
Get Lutris info asynchronously.
Definition at line 1451 of file protondb_service.cpp.
References getLutrisInfo().
|
static |
Get Lutris info by game slug.
| gameSlug | Lutris game slug (e.g., "counter-strike-2") |
Definition at line 1412 of file protondb_service.cpp.
References Logger::debug(), LutrisGameInfo::found, getLutrisInfo(), LutrisGameInfo::gogId, LutrisGameInfo::installers, LutrisGameInfo::name, LutrisGameInfo::slug, and LutrisGameInfo::steamId.
|
static |
Get Steam store information (native Linux, genres, DRM, etc.).
| steamAppId | Steam App ID |
Checks if game has native Linux support, controller support, genres, etc. Essential for determining if Proton is even needed.
Definition at line 1102 of file protondb_service.cpp.
References SteamAppInfo::controllerSupport, Logger::debug(), SteamAppInfo::developer, SteamAppInfo::drmNotice, SteamAppInfo::found, SteamAppInfo::genres, SteamAppInfo::hasCloudSaves, SteamAppInfo::hasMultiplayer, Logger::info(), SteamAppInfo::name, SteamAppInfo::publisher, SteamAppInfo::steamAppId, SteamAppInfo::supportsLinux, SteamAppInfo::supportsMac, SteamAppInfo::supportsWindows, and Logger::warn().
Referenced by getSteamAppInfoAsync().
|
static |
Get Steam app info asynchronously.
Definition at line 1217 of file protondb_service.cpp.
References getSteamAppInfo().
|
static |
Get Steam Deck compatibility status from Valve's testing.
| steamAppId | Steam App ID |
Uses Steam's official Deck compatibility API. Results indicate whether Valve has tested and verified the game for Steam Deck.
Definition at line 972 of file protondb_service.cpp.
References SteamDeckInfo::compatibility, SteamDeckInfo::compatibilityString, SteamDeckInfo::controllerSupport, Logger::debug(), SteamDeckInfo::found, Logger::info(), SteamDeckInfo::nativeResolution, Playable, SteamDeckInfo::protonCompatible, Unknown, Unsupported, Verified, and Logger::warn().
Referenced by getSteamDeckInfoAsync().
|
static |
Get Steam Deck compatibility asynchronously.
Definition at line 1082 of file protondb_service.cpp.
References getSteamDeckInfo().
|
static |
Get compatibility tier for a game (quick lookup).
| steamAppId | Steam App ID |
Definition at line 689 of file protondb_service.cpp.
References getGameInfo(), and ProtonDBGameInfo::tier.
|
static |
Get tier color for UI display (RGBA).
| tier | Tier string (e.g., "platinum", "gold", "silver", "bronze", "borked"). | |
| [out] | r | Red channel in [0.0, 1.0]. |
| [out] | g | Green channel in [0.0, 1.0]. |
| [out] | b | Blue channel in [0.0, 1.0]. |
| [out] | a | Alpha channel in [0.0, 1.0]. |
Definition at line 903 of file protondb_service.cpp.
|
static |
Get human-readable tier description.
| tier | Tier string (e.g., "platinum") |
Definition at line 886 of file protondb_service.cpp.
|
static |
Search for games by name.
| gameName | Name to search for (partial match supported) |
| maxResults | Maximum results to return |
Definition at line 642 of file protondb_service.cpp.
References Logger::info(), and Logger::warn().
Referenced by findGameByName(), and searchByNameAsync().
|
static |
Search for games by name asynchronously.
| gameName | Name to search for |
| callback | Function to call with results |
| maxResults | Maximum results to return |
Definition at line 743 of file protondb_service.cpp.
References searchByName().