Merge pull request #32 from universal963/universal963-patch-1

More accurate api behaviors fix
This commit is contained in:
Detanup01 2024-08-27 15:27:32 +02:00 committed by GitHub
commit 601bb51d46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,8 +84,12 @@ bool Steam_Apps::BIsSubscribedApp( AppId_t appID )
std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (appID == 0) return false; // steam returns false
if (appID == UINT32_MAX) return true; // steam returns true
if (appID == settings->get_local_game_id().AppID()) return true; // steam returns true
return settings->hasDLC(appID);
if (appID == settings->get_local_game_id().AppID() || settings->hasDLC(appID)) return true; // steam returns true
for (auto &d : settings->depots) {
if (d == appID)
return true;
}
return false;
}
@ -112,15 +116,19 @@ uint32 Steam_Apps::GetEarliestPurchaseUnixTime( AppId_t nAppID )
std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (nAppID == 0) return 0; // steam returns 0
if (nAppID == UINT32_MAX) return 0; // steam returns 0
auto t =
// 4 days ago
startup_time
- std::chrono::hours(24 * 4);
auto duration = std::chrono::duration_cast<std::chrono::seconds>(t.time_since_epoch());
if (nAppID == settings->get_local_game_id().AppID() || settings->hasDLC(nAppID)) {
auto t =
// 4 days ago
startup_time
- std::chrono::hours(24 * 4);
auto duration = std::chrono::duration_cast<std::chrono::seconds>(t.time_since_epoch());
return (uint32)duration.count();
}
for (auto &d : settings->depots) {
if (d == nAppID)
return (uint32)duration.count();
}
//TODO ?
return 0;
}