Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dll/playtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ void PlaytimeCounter::load()
playtime_seconds = 0;

std::string data(32, '\0');
if (local_storage->get_data("", playtime_filename, data.data(), static_cast<unsigned int>(data.size()), 0) > 0 &&
std::all_of(data.begin(), data.end(), ::isdigit)) {
if (local_storage->get_data("", playtime_filename, data.data(), static_cast<unsigned int>(data.size()), 0) > 0) {
try {
playtime_seconds = std::stoull(data);
} catch (...) {}
Expand Down
8 changes: 4 additions & 4 deletions dll/steam_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ void Steam_Client::background_thread_proc()
network->Run(); // networking must run first since it receives messages used by each run_callback()
run_every_runcb->run(); // call each run_callback()

if (settings_client->record_playtime) {
playtime_counter->tick(); // update playtime counter
}

// update the time counter to avoid overlap
last_cb_run = (unsigned long long)std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
}

if (settings_client->record_playtime) {
playtime_counter->tick(); // update playtime counter
}
}

Steam_Client::Steam_Client()
Expand Down