|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Automatic game state synchronization service. More...
#include <game_state_sync.h>
Classes | |
| struct | Stats |
Public Types | |
| using | GameUpdateCallback |
| using | StateChangeCallback |
Public Member Functions | |
| Stats | getStats () const |
| void | requestFullSync () |
| Request immediate sync of all games. | |
| void | requestImmediateSync (const std::string &gameId) |
| Request immediate sync of a specific game. | |
| void | setAutoRecoveryEnabled (bool enabled) |
| Enable/disable automatic status recovery. | |
| void | setGameUpdateCallback (GameUpdateCallback callback) |
| void | setStateChangeCallback (StateChangeCallback callback) |
| void | setSyncInterval (int intervalSeconds) |
| Set sync interval (default: 10 seconds). | |
| void | setTransitionalStateTimeout (int timeoutSeconds) |
| Set timeout for transitional states (default: 60 seconds). | |
| void | start (GameLibrary *library, SteamLibraryScanner *steamScanner) |
| Start the background sync thread. | |
| void | stop () |
| Stop the background sync thread. | |
Static Public Member Functions | |
| static GameStateSync & | instance () |
Automatic game state synchronization service.
Runs in a background thread to ensure game metadata stays synchronized with reality by:
This prevents games from getting stuck in "Installing", "Launching", "Updating" states and keeps metadata fresh.
Definition at line 29 of file game_state_sync.h.
Definition at line 100 of file game_state_sync.h.
Definition at line 33 of file game_state_sync.h.
| GameStateSync::Stats GameStateSync::getStats | ( | ) | const |
Definition at line 126 of file game_state_sync.cpp.
|
static |
| void GameStateSync::requestFullSync | ( | ) |
Request immediate sync of all games.
Definition at line 86 of file game_state_sync.cpp.
| void GameStateSync::requestImmediateSync | ( | const std::string & | gameId | ) |
Request immediate sync of a specific game.
| gameId | Game ID to sync now |
Definition at line 80 of file game_state_sync.cpp.
| void GameStateSync::setAutoRecoveryEnabled | ( | bool | enabled | ) |
Enable/disable automatic status recovery.
| enabled | If true, automatically fix stuck states |
Definition at line 105 of file game_state_sync.cpp.
| void GameStateSync::setGameUpdateCallback | ( | GameUpdateCallback | callback | ) |
Definition at line 116 of file game_state_sync.cpp.
| void GameStateSync::setStateChangeCallback | ( | StateChangeCallback | callback | ) |
Definition at line 110 of file game_state_sync.cpp.
| void GameStateSync::setSyncInterval | ( | int | intervalSeconds | ) |
Set sync interval (default: 10 seconds).
| intervalSeconds | How often to check game states |
Definition at line 95 of file game_state_sync.cpp.
| void GameStateSync::setTransitionalStateTimeout | ( | int | timeoutSeconds | ) |
Set timeout for transitional states (default: 60 seconds).
| timeoutSeconds | Max time a game can stay in Launching/Installing/etc |
Definition at line 100 of file game_state_sync.cpp.
| void GameStateSync::start | ( | GameLibrary * | library, |
| SteamLibraryScanner * | steamScanner ) |
Start the background sync thread.
| library | Pointer to game library to sync |
| steamScanner | Pointer to Steam scanner for verification |
Definition at line 44 of file game_state_sync.cpp.
References Logger::info().
| void GameStateSync::stop | ( | ) |
Stop the background sync thread.
Definition at line 62 of file game_state_sync.cpp.
References Logger::info().