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

Record of a single game play session. More...

#include <game.h>

Public Member Functions

std::string getFormattedDuration () const
 Get formatted duration string.
bool isActive () const
 Check if session is still active.

Public Attributes

float avgFps = 0.0f
 Average FPS during session (0 if not captured).
float avgFrametime = 0.0f
 Average frametime in ms.
double durationSeconds = 0
 Session duration in seconds.
time_t endTime = 0
 Unix timestamp when session ended (0 if still running).
int exitCode = 0
 Process exit code.
std::string exitReason
 "normal", "crash", "timeout", "force_stop"
float minFps = 0.0f
 Minimum FPS during session.
std::string protonVersion
 Proton/Wine version used.
int64_t sessionId = 0
 Unique session ID (auto-generated).
time_t startTime = 0
 Unix timestamp when session started.

Detailed Description

Record of a single game play session.

Tracks individual play sessions with start/end times, duration, and metadata about the session. Enables detailed playtime analytics and session history viewing (like Playnite).

Definition at line 629 of file game.h.

Member Function Documentation

◆ getFormattedDuration()

std::string PlaySession::getFormattedDuration ( ) const

Get formatted duration string.

Returns
Duration in "Xh Ym" format

Definition at line 391 of file game.cpp.

References durationSeconds.

◆ isActive()

bool PlaySession::isActive ( ) const
inline

Check if session is still active.

Definition at line 649 of file game.h.

References endTime.

Member Data Documentation

◆ avgFps

float PlaySession::avgFps = 0.0f

Average FPS during session (0 if not captured).

Definition at line 642 of file game.h.

◆ avgFrametime

float PlaySession::avgFrametime = 0.0f

Average frametime in ms.

Definition at line 644 of file game.h.

◆ durationSeconds

double PlaySession::durationSeconds = 0

Session duration in seconds.

Definition at line 634 of file game.h.

Referenced by getFormattedDuration().

◆ endTime

time_t PlaySession::endTime = 0

Unix timestamp when session ended (0 if still running).

Definition at line 633 of file game.h.

Referenced by isActive().

◆ exitCode

int PlaySession::exitCode = 0

Process exit code.

Definition at line 639 of file game.h.

◆ exitReason

std::string PlaySession::exitReason

"normal", "crash", "timeout", "force_stop"

Definition at line 638 of file game.h.

◆ minFps

float PlaySession::minFps = 0.0f

Minimum FPS during session.

Definition at line 643 of file game.h.

◆ protonVersion

std::string PlaySession::protonVersion

Proton/Wine version used.

Definition at line 637 of file game.h.

◆ sessionId

int64_t PlaySession::sessionId = 0

Unique session ID (auto-generated).

Definition at line 631 of file game.h.

◆ startTime

time_t PlaySession::startTime = 0

Unix timestamp when session started.

Definition at line 632 of file game.h.


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