From 6840b20bcb5a2e4193eb4a06cc79c153eb64d6dd Mon Sep 17 00:00:00 2001 From: otavepto <153766569+otavepto@users.noreply.github.com> Date: Sun, 30 Jun 2024 05:46:47 +0300 Subject: [PATCH] fix conditions for: * Steam_Apps::BIsSubscribedApp * Steam_Apps::BIsDlcInstalled * Steam_Apps::BIsAppInstalled --- dll/steam_app_ids.cpp | 36 +++++++++---------- dll/steam_apps.cpp | 24 ++++++------- dll/steam_remote_storage.cpp | 8 ++--- .../configs.user.EXAMPLE.ini | 1 + 4 files changed, 33 insertions(+), 36 deletions(-) diff --git a/dll/steam_app_ids.cpp b/dll/steam_app_ids.cpp index 07d38f72..c02673a0 100644 --- a/dll/steam_app_ids.cpp +++ b/dll/steam_app_ids.cpp @@ -5,15 +5,15 @@ // they're not really accurate const std::map steam_preowned_app_ids = { - { 0, "Base Goldsource Shared Binaries" }, - { 1, "Base Goldsource Shared Content" }, - { 2, "Base Goldsource Shared Content Localized (deprecated)" }, - { 3, "Original Platform" }, + // { 0, "Base Goldsource Shared Binaries" }, + // { 1, "Base Goldsource Shared Content" }, + // { 2, "Base Goldsource Shared Content Localized (deprecated)" }, + // { 3, "Original Platform" }, { 4, "Half-Life Dedicated Server Linux Deprecated" }, { 5, "Half-Life Dedicated Server Windows Deprecated" }, - { 6, "Base Goldsource Low Violence" }, - { 7, "WinUI (Steam v3 user interface)" }, - { 8, "WinUI2 (Steam community interface; deprecated)" }, + // { 6, "Base Goldsource Low Violence" }, + // { 7, "WinUI (Steam v3 user interface)" }, + // { 8, "WinUI2 (Steam community interface; deprecated)" }, { 10, "Counter-Strike" }, { 11, "Counter-Strike Base Content" }, { 12, "Counter-Strike French" }, @@ -106,20 +106,18 @@ const std::map steam_preowned_app_ids = { { 130, "Half-Life: Blue Shift" }, { 131, "Half-Life: Blue Shift French" }, { 132, "Half-Life: Blue Shift German" }, - { 200, "Base Source Shared" }, - { 201, "Source Engine 64bit (for x86_64/AMD64 CPU/OS, deprecated)" }, - { 202, "Source Init (VAC)" }, - { 203, "Source Shared Securom" }, - { 204, "Source Dedicated Server Linux (2006)" }, + // { 200, "Base Source Shared" }, + // { 201, "Source Engine 64bit (for x86_64/AMD64 CPU/OS, deprecated)" }, + // { 202, "Source Init (VAC)" }, + // { 203, "Source Shared Securom" }, + // { 204, "Source Dedicated Server Linux (2006)" }, { 205, "Source Dedicated Server" }, - { 205, "Source SDK Base 2006 MP Dedicated Server" }, - { 205, "Source SDK Base 2006 dedicated server (Bug: Linux files are missing.)" }, - { 206, "Base Source Shared Materials" }, - { 207, "Base Source Shared Models" }, - { 208, "Base Source Shared Sounds" }, - { 209, "Source Low Violence" }, + // { 206, "Base Source Shared Materials" }, + // { 207, "Base Source Shared Models" }, + // { 208, "Base Source Shared Sounds" }, + // { 209, "Source Low Violence" }, { 211, "Source SDK" }, - { 212, "Base Source Engine 2" }, + // { 212, "Base Source Engine 2" }, { 213, "Half-Life 2: Episode One Shared" }, { 215, "Source SDK Base 2006 (Episode One)" }, { 216, "Source 2007 Binaries" }, diff --git a/dll/steam_apps.cpp b/dll/steam_apps.cpp index 94d39a5f..3c5ce9d9 100644 --- a/dll/steam_apps.cpp +++ b/dll/steam_apps.cpp @@ -82,9 +82,9 @@ bool Steam_Apps::BIsSubscribedApp( AppId_t appID ) { PRINT_DEBUG("%u", appID); std::lock_guard lock(global_mutex); - if (appID == 0) return true; //I think appid 0 is always owned - if (appID == UINT32_MAX) return false; // check Steam_Apps::BIsAppInstalled() - if (appID == settings->get_local_game_id().AppID()) return true; + 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); } @@ -94,12 +94,12 @@ bool Steam_Apps::BIsDlcInstalled( AppId_t appID ) { PRINT_DEBUG("%u", appID); std::lock_guard lock(global_mutex); - if (appID == 0) return true; - if (appID == UINT32_MAX) return false; // check Steam_Apps::BIsAppInstalled() + if (appID == 0) return false; // steam returns false (also appid 1958220 expects false otherwise it hangs in loading screen) + if (appID == UINT32_MAX) return false; // steam returns false // Age of Empires 2: Definitive Edition expects the app itself to be an owned DLC. // otherwise it will only load the "Return of Rome" game mode, also most options are disabled - if (appID == settings->get_local_game_id().AppID()) return true; + if (appID == settings->get_local_game_id().AppID()) return true; // steam returns true return settings->hasDLC(appID); } @@ -110,8 +110,8 @@ uint32 Steam_Apps::GetEarliestPurchaseUnixTime( AppId_t nAppID ) { PRINT_DEBUG_ENTRY(); std::lock_guard lock(global_mutex); - if (nAppID == 0) return 0; //TODO is this correct? - if (nAppID == UINT32_MAX) return 0; // check Steam_Apps::BIsAppInstalled() TODO is this correct? + if (nAppID == 0) return 0; // steam returns 0 + if (nAppID == UINT32_MAX) return 0; // steam returns 0 if (nAppID == settings->get_local_game_id().AppID() || settings->hasDLC(nAppID)) { auto t = // 4 days ago @@ -319,12 +319,10 @@ bool Steam_Apps::BIsAppInstalled( AppId_t appID ) PRINT_DEBUG("%u", appID); std::lock_guard lock(global_mutex); - // "0 Base Goldsource Shared Binaries" - // https://developer.valvesoftware.com/wiki/Steam_Application_IDs - if (appID == 0) return true; + if (appID == 0) return false; // steam returns false // game LEGO 2K Drive (app id 1451810) checks for a proper steam behavior by sending uint32_max and expects false in return - if (appID == UINT32_MAX) return false; - if (appID == settings->get_local_game_id().AppID()) return true; + if (appID == UINT32_MAX) return false; // steam returns false + if (appID == settings->get_local_game_id().AppID()) return true; // steam returns true // TODO is this correct? // the docs say that this function won't work on DLCs, but HITMAN 3 uses it on every DLC diff --git a/dll/steam_remote_storage.cpp b/dll/steam_remote_storage.cpp index 04e148e3..c1684b48 100644 --- a/dll/steam_remote_storage.cpp +++ b/dll/steam_remote_storage.cpp @@ -265,7 +265,7 @@ bool Steam_Remote_Storage::FileWriteStreamCancel( UGCFileWriteStreamHandle_t wri // file information bool Steam_Remote_Storage::FileExists( const char *pchFile ) { - PRINT_DEBUG("%s", pchFile); + PRINT_DEBUG("'%s'", pchFile); std::lock_guard lock(global_mutex); if (!pchFile || !pchFile[0]) return false; @@ -274,7 +274,7 @@ bool Steam_Remote_Storage::FileExists( const char *pchFile ) bool Steam_Remote_Storage::FilePersisted( const char *pchFile ) { - PRINT_DEBUG_ENTRY(); + PRINT_DEBUG("'%s'", pchFile); std::lock_guard lock(global_mutex); if (!pchFile || !pchFile[0]) return false; @@ -283,7 +283,7 @@ bool Steam_Remote_Storage::FilePersisted( const char *pchFile ) int32 Steam_Remote_Storage::GetFileSize( const char *pchFile ) { - PRINT_DEBUG("%s", pchFile); + PRINT_DEBUG("'%s'", pchFile); std::lock_guard lock(global_mutex); if (!pchFile || !pchFile[0]) return 0; @@ -301,7 +301,7 @@ int64 Steam_Remote_Storage::GetFileTimestamp( const char *pchFile ) ERemoteStoragePlatform Steam_Remote_Storage::GetSyncPlatforms( const char *pchFile ) { - PRINT_DEBUG_ENTRY(); + PRINT_DEBUG("'%s'", pchFile); std::lock_guard lock(global_mutex); return k_ERemoteStoragePlatformAll; diff --git a/post_build/steam_settings.EXAMPLE/configs.user.EXAMPLE.ini b/post_build/steam_settings.EXAMPLE/configs.user.EXAMPLE.ini index 0875e12b..6c2e5a4d 100644 --- a/post_build/steam_settings.EXAMPLE/configs.user.EXAMPLE.ini +++ b/post_build/steam_settings.EXAMPLE/configs.user.EXAMPLE.ini @@ -9,6 +9,7 @@ account_name=gse orca account_steamid=76561197960287930 # the language reported to the app/game # look for the column 'API language code' here: https://partner.steamgames.com/doc/store/localization/languages +# this must also exist in 'supported_languages.txt', otherwise it will be ignored by the emu # default=english language=english # report a country IP if the game queries it