-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95ceac3
commit 73a05f1
Showing
10 changed files
with
258 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,81 @@ | ||
#include <game_mode/virtuals/steam_api_virtuals.hpp> | ||
#include <koalabox/util.hpp> | ||
#include <steam_impl/steam_apps.hpp> | ||
#include <steam_impl/steam_impl.hpp> | ||
|
||
VIRTUAL(bool) ISteamApps_BIsSubscribedApp(PARAMS(AppId_t appID)) { | ||
return steam_apps::IsDlcUnlocked( | ||
__func__, 0, appID, [&]() { | ||
GET_ORIGINAL_FUNCTION_STEAMAPI(ISteamApps_BIsSubscribedApp) | ||
VIRTUAL(bool) ISteamApps_BIsSubscribedApp(PARAMS(AppId_t dlc_id)) { | ||
try { | ||
static const auto app_id = steam_impl::get_app_id_or_throw(); | ||
return steam_apps::IsDlcUnlocked( | ||
__func__, app_id, dlc_id, [&]() { | ||
GET_ORIGINAL_HOOKED_FUNCTION(ISteamApps_BIsSubscribedApp) | ||
return ISteamApps_BIsSubscribedApp_o(ARGS(dlc_id)); | ||
} | ||
); | ||
} catch (const Exception& e) { | ||
LOG_ERROR("{} -> Error: {}", __func__, e.what()) | ||
|
||
return ISteamApps_BIsSubscribedApp_o(ARGS(appID)); | ||
} | ||
); | ||
return false; | ||
} | ||
} | ||
|
||
VIRTUAL(bool) ISteamApps_BIsDlcInstalled(PARAMS(AppId_t appID)) { | ||
return steam_apps::IsDlcUnlocked( | ||
__func__, 0, appID, [&]() { | ||
GET_ORIGINAL_FUNCTION_STEAMAPI(ISteamApps_BIsDlcInstalled) | ||
VIRTUAL(bool) ISteamApps_BIsDlcInstalled(PARAMS(AppId_t dlc_id)) { | ||
try { | ||
static const auto app_id = steam_impl::get_app_id_or_throw(); | ||
return steam_apps::IsDlcUnlocked( | ||
__func__, app_id, dlc_id, [&]() { | ||
GET_ORIGINAL_HOOKED_FUNCTION(ISteamApps_BIsDlcInstalled) | ||
return ISteamApps_BIsDlcInstalled_o(ARGS(dlc_id)); | ||
} | ||
); | ||
} catch (const Exception& e) { | ||
LOG_ERROR("{} -> Error: {}", __func__, e.what()) | ||
|
||
return ISteamApps_BIsDlcInstalled_o(ARGS(appID)); | ||
} | ||
); | ||
return false; | ||
} | ||
} | ||
|
||
VIRTUAL(int) ISteamApps_GetDLCCount(PARAMS()) { | ||
GET_ORIGINAL_HOOKED_FUNCTION(ISteamApps_GetDLCCount) | ||
try { | ||
static const auto app_id = steam_impl::get_app_id_or_throw(); | ||
return steam_apps::GetDLCCount( | ||
__func__, app_id, [&]() { | ||
GET_ORIGINAL_HOOKED_FUNCTION(ISteamApps_GetDLCCount) | ||
return ISteamApps_GetDLCCount_o(ARGS()); | ||
} | ||
); | ||
} catch (const Exception& e) { | ||
LOG_ERROR("{} -> Error: {}", __func__, e.what()) | ||
|
||
return steam_apps::GetDLCCount( | ||
__func__, 0, [&]() { | ||
return ISteamApps_GetDLCCount_o(ARGS()); | ||
} | ||
); | ||
return 0; | ||
} | ||
} | ||
|
||
VIRTUAL(bool) ISteamApps_BGetDLCDataByIndex( | ||
PARAMS( | ||
int iDLC, | ||
AppId_t* pAppID, | ||
AppId_t* p_dlc_id, | ||
bool* pbAvailable, | ||
char* pchName, | ||
int cchNameBufferSize | ||
) | ||
) { | ||
return steam_apps::GetDLCDataByIndex( | ||
__func__, 0, iDLC, pAppID, pbAvailable, pchName, cchNameBufferSize, | ||
[&]() { | ||
GET_ORIGINAL_HOOKED_FUNCTION(ISteamApps_BGetDLCDataByIndex) | ||
|
||
return ISteamApps_BGetDLCDataByIndex_o( | ||
ARGS(iDLC, pAppID, pbAvailable, pchName, cchNameBufferSize) | ||
); | ||
}, | ||
[&](AppId_t dlc_id) { | ||
return ISteamApps_BIsDlcInstalled(ARGS(dlc_id)); | ||
} | ||
); | ||
try { | ||
static const auto app_id = steam_impl::get_app_id_or_throw(); | ||
return steam_apps::GetDLCDataByIndex( | ||
__func__, app_id, iDLC, p_dlc_id, pbAvailable, pchName, cchNameBufferSize, | ||
[&]() { | ||
GET_ORIGINAL_HOOKED_FUNCTION(ISteamApps_BGetDLCDataByIndex) | ||
return ISteamApps_BGetDLCDataByIndex_o( | ||
ARGS(iDLC, p_dlc_id, pbAvailable, pchName, cchNameBufferSize) | ||
); | ||
}, | ||
[&](AppId_t dlc_id) { | ||
return ISteamApps_BIsDlcInstalled(ARGS(dlc_id)); | ||
} | ||
); | ||
} catch (const Exception& e) { | ||
LOG_ERROR("{} -> Error: {}", __func__, e.what()) | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.