game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
GameStatistics Struct Reference

Play statistics and usage tracking for a game. More...

#include <game.h>

Public Member Functions

 GameStatistics ()
 Constructor with defaults.

Public Attributes

int crashCount
 Number of times game has crashed.
time_t dateAdded
 Unix timestamp when added to library.
time_t dateInstalled
 Unix timestamp when installed.
std::map< std::string, std::string > lastEnvironmentVars
 Environment variables from last launch.
std::string lastExitReason
 Reason game stopped: "normal", "crash", "timeout", "unknown".
time_t lastExitTime
 Unix timestamp of last exit.
std::string lastLaunchCommand
 Full command used for last launch (with env vars).
time_t lastPlayed
 Unix timestamp of last play session.
std::string lastProtonVersion
 Proton version used in last launch.
int timesLaunched
 Number of times game was launched.
double totalPlayTimeSeconds
 Total play time in seconds (for all sessions).

Detailed Description

Play statistics and usage tracking for a game.

Tracks how often and how long a game has been played, as well as important dates (when added, when installed, when last played). This data is used for "Recently Played" and "Most Played" features.

Definition at line 711 of file game.h.

Constructor & Destructor Documentation

◆ GameStatistics()

GameStatistics::GameStatistics ( )
inline

Constructor with defaults.

Initializes all counters and timestamps to zero.

Definition at line 735 of file game.h.

References crashCount, dateAdded, dateInstalled, lastExitTime, lastPlayed, timesLaunched, and totalPlayTimeSeconds.

Member Data Documentation

◆ crashCount

int GameStatistics::crashCount

Number of times game has crashed.

Definition at line 728 of file game.h.

Referenced by GameStatistics(), GameDatabase::insertGame(), and DetailsPanelManager::Impl::update().

◆ dateAdded

time_t GameStatistics::dateAdded

Unix timestamp when added to library.

Definition at line 716 of file game.h.

Referenced by GameStatistics(), GameLibrary::addGame(), GameDatabase::insertGame(), and core::GameLibraryController::Impl::sortGames().

◆ dateInstalled

time_t GameStatistics::dateInstalled

Unix timestamp when installed.

Definition at line 717 of file game.h.

Referenced by GameStatistics(), and GameDatabase::insertGame().

◆ lastEnvironmentVars

std::map<std::string, std::string> GameStatistics::lastEnvironmentVars

Environment variables from last launch.

Definition at line 723 of file game.h.

Referenced by GameDatabase::getSchemaVersion(), GameDatabase::insertGame(), and GameProcessManager::launchGame().

◆ lastExitReason

std::string GameStatistics::lastExitReason

Reason game stopped: "normal", "crash", "timeout", "unknown".

Definition at line 726 of file game.h.

Referenced by GameDatabase::insertGame().

◆ lastExitTime

time_t GameStatistics::lastExitTime

Unix timestamp of last exit.

Definition at line 727 of file game.h.

Referenced by GameStatistics(), and GameDatabase::insertGame().

◆ lastLaunchCommand

std::string GameStatistics::lastLaunchCommand

Full command used for last launch (with env vars).

Definition at line 720 of file game.h.

Referenced by GameDatabase::insertGame(), and GameProcessManager::launchGame().

◆ lastPlayed

◆ lastProtonVersion

std::string GameStatistics::lastProtonVersion

Proton version used in last launch.

Definition at line 721 of file game.h.

Referenced by GameDatabase::insertGame(), and GameProcessManager::launchGame().

◆ timesLaunched

int GameStatistics::timesLaunched

Number of times game was launched.

Definition at line 713 of file game.h.

Referenced by GameStatistics(), GameDatabase::insertGame(), GameProcessManager::launchGame(), and DetailsPanelManager::Impl::update().

◆ totalPlayTimeSeconds

double GameStatistics::totalPlayTimeSeconds

The documentation for this struct was generated from the following file: