mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 11:15:34 +08:00
More accurate api behaviors
This commit is contained in:
parent
b0d92a48c1
commit
fd1af0d7ff
@ -84,8 +84,12 @@ bool Steam_Apps::BIsSubscribedApp( AppId_t appID )
|
|||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
if (appID == 0) return false; // steam returns false
|
if (appID == 0) return false; // steam returns false
|
||||||
if (appID == UINT32_MAX) return true; // steam returns true
|
if (appID == UINT32_MAX) return true; // steam returns true
|
||||||
if (appID == settings->get_local_game_id().AppID()) return true; // steam returns true
|
if (appID == settings->get_local_game_id().AppID() || settings->hasDLC(appID)) return true; // steam returns true
|
||||||
return settings->hasDLC(appID);
|
for (auto &d : settings->depots) {
|
||||||
|
if (d == appID)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -112,14 +116,18 @@ uint32 Steam_Apps::GetEarliestPurchaseUnixTime( AppId_t nAppID )
|
|||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
if (nAppID == 0) return 0; // steam returns 0
|
if (nAppID == 0) return 0; // steam returns 0
|
||||||
if (nAppID == UINT32_MAX) 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)) {
|
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();
|
return (uint32)duration.count();
|
||||||
}
|
}
|
||||||
|
for (auto &d : settings->depots) {
|
||||||
|
if (d == nAppID)
|
||||||
|
return (uint32)duration.count();
|
||||||
|
}
|
||||||
|
|
||||||
//TODO ?
|
//TODO ?
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user