mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2026-01-25 22:12:52 -05:00
Implemented ISteamGameServer
This commit is contained in:
@@ -5,10 +5,9 @@
|
||||
#include "smoke_api/config.hpp"
|
||||
|
||||
DLL_EXPORT(bool) SteamAPI_RestartAppIfNecessary(const AppId_t unOwnAppID) {
|
||||
if(smoke_api::config::instance.override_app_id != 0) {
|
||||
LOG_DEBUG("{} -> {}. Preventing app restart", unOwnAppID, __func__);
|
||||
return false;
|
||||
}
|
||||
LOG_INFO("{} -> unOwnAppID: {}", __func__, unOwnAppID);
|
||||
|
||||
// Restart can be suppressed if needed
|
||||
|
||||
AUTO_CALL(SteamAPI_RestartAppIfNecessary, unOwnAppID);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// ISteamApps
|
||||
|
||||
DLL_EXPORT(bool) SteamAPI_ISteamApps_BIsSubscribedApp(void* self, AppId_t dlcID) {
|
||||
DLL_EXPORT(bool) SteamAPI_ISteamApps_BIsSubscribedApp(void* self, const AppId_t dlcID) {
|
||||
try {
|
||||
return smoke_api::steam_apps::IsDlcUnlocked(
|
||||
__func__,
|
||||
@@ -23,7 +23,7 @@ DLL_EXPORT(bool) SteamAPI_ISteamApps_BIsSubscribedApp(void* self, AppId_t dlcID)
|
||||
}
|
||||
}
|
||||
|
||||
DLL_EXPORT(bool) SteamAPI_ISteamApps_BIsDlcInstalled(void* self, AppId_t dlcID) {
|
||||
DLL_EXPORT(bool) SteamAPI_ISteamApps_BIsDlcInstalled(void* self, const AppId_t dlcID) {
|
||||
try {
|
||||
return smoke_api::steam_apps::IsDlcUnlocked(
|
||||
__func__,
|
||||
@@ -294,3 +294,28 @@ DLL_EXPORT(EUserHasLicenseForAppResult) SteamAPI_ISteamUser_UserHasLicenseForApp
|
||||
return k_EUserHasLicenseResultDoesNotHaveLicense;
|
||||
}
|
||||
}
|
||||
|
||||
// ISteamGameServer
|
||||
|
||||
DLL_EXPORT(EUserHasLicenseForAppResult) SteamAPI_ISteamGameServer_UserHasLicenseForApp(
|
||||
void* self,
|
||||
const CSteamID steamID,
|
||||
const AppId_t dlcID
|
||||
) {
|
||||
try {
|
||||
return smoke_api::steam_user::UserHasLicenseForApp(
|
||||
__func__,
|
||||
steam_interface::get_app_id(),
|
||||
dlcID,
|
||||
MODULE_CALL_CLOSURE(
|
||||
SteamAPI_ISteamGameServer_UserHasLicenseForApp,
|
||||
self,
|
||||
steamID,
|
||||
dlcID
|
||||
)
|
||||
);
|
||||
} catch(const std::exception& e) {
|
||||
LOG_ERROR("{} -> Error: {}", __func__, e.what());
|
||||
return k_EUserHasLicenseResultDoesNotHaveLicense;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <map>
|
||||
|
||||
#include <koalabox/logger.hpp>
|
||||
#include <koalabox/util.hpp>
|
||||
#include <koalabox/win.hpp>
|
||||
|
||||
#include "smoke_api.hpp"
|
||||
@@ -34,7 +33,7 @@ namespace {
|
||||
return version_map[version_prefix];
|
||||
}
|
||||
|
||||
throw kb::util::exception("No match found for '{}'", version_prefix);
|
||||
throw std::runtime_error(std::format("No match found for '{}'", version_prefix));
|
||||
} catch(const std::exception& ex) {
|
||||
LOG_ERROR(
|
||||
"Failed to get versioned interface: {}."
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include <koalabox/hook.hpp>
|
||||
#include <koalabox/logger.hpp>
|
||||
#include <koalabox/util.hpp>
|
||||
#include <koalabox/win.hpp>
|
||||
|
||||
#include "smoke_api.hpp"
|
||||
@@ -67,17 +66,11 @@ namespace {
|
||||
}
|
||||
},
|
||||
{
|
||||
STEAM_INVENTORY,
|
||||
STEAM_GAME_SERVER,
|
||||
interface_data{
|
||||
.fallback_version = "STEAMINVENTORY_INTERFACE_V003",
|
||||
.fallback_version = "SteamGameServer015",
|
||||
.entry_map = {
|
||||
ENTRY(ISteamInventory, GetResultStatus),
|
||||
ENTRY(ISteamInventory, GetResultItems),
|
||||
ENTRY(ISteamInventory, CheckResultSteamID),
|
||||
ENTRY(ISteamInventory, GetAllItems),
|
||||
ENTRY(ISteamInventory, GetItemsByID),
|
||||
ENTRY(ISteamInventory, SerializeResult),
|
||||
ENTRY(ISteamInventory, GetItemDefinitionIDs),
|
||||
ENTRY(ISteamGameServer, UserHasLicenseForApp),
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <koalabox/logger.hpp>
|
||||
|
||||
#include "smoke_api.hpp"
|
||||
#include "smoke_api/interfaces/steam_apps.hpp"
|
||||
#include "steam_api/steam_interface.hpp"
|
||||
#include "steam_api/virtuals/steam_api_virtuals.hpp"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <koalabox/logger.hpp>
|
||||
|
||||
#include "smoke_api.hpp"
|
||||
#include "steam_api/steam_client.hpp"
|
||||
#include "steam_api/virtuals/steam_api_virtuals.hpp"
|
||||
|
||||
|
||||
21
src/steam_api/virtuals/isteamgameserver.cpp
Normal file
21
src/steam_api/virtuals/isteamgameserver.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <koalabox/logger.hpp>
|
||||
|
||||
#include "smoke_api/interfaces/steam_user.hpp"
|
||||
#include "steam_api/steam_interface.hpp"
|
||||
#include "steam_api/virtuals/steam_api_virtuals.hpp"
|
||||
|
||||
VIRTUAL(EUserHasLicenseForAppResult) ISteamGameServer_UserHasLicenseForApp(
|
||||
PARAMS(const CSteamID steamID, const AppId_t dlc_id)
|
||||
) {
|
||||
try {
|
||||
return smoke_api::steam_user::UserHasLicenseForApp(
|
||||
__func__,
|
||||
steam_interface::get_app_id(),
|
||||
dlc_id,
|
||||
HOOKED_CALL_CLOSURE(ISteamGameServer_UserHasLicenseForApp, ARGS(steamID, dlc_id))
|
||||
);
|
||||
} catch(const std::exception& e) {
|
||||
LOG_ERROR("{} -> Error: {}", __func__, e.what());
|
||||
return k_EUserHasLicenseResultDoesNotHaveLicense;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "smoke_api.hpp"
|
||||
#include "smoke_api/interfaces/steam_inventory.hpp"
|
||||
#include "steam_api/virtuals/steam_api_virtuals.hpp"
|
||||
|
||||
@@ -130,7 +129,7 @@ VIRTUAL(bool) ISteamInventory_GetItemDefinitionIDs(
|
||||
}
|
||||
|
||||
VIRTUAL(bool) ISteamInventory_CheckResultSteamID(
|
||||
PARAMS(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected)
|
||||
PARAMS(const SteamInventoryResult_t resultHandle, CSteamID steamIDExpected)
|
||||
) {
|
||||
return smoke_api::steam_inventory::CheckResultSteamID(
|
||||
__func__,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <koalabox/logger.hpp>
|
||||
|
||||
#include "smoke_api.hpp"
|
||||
#include "smoke_api/interfaces/steam_user.hpp"
|
||||
#include "steam_api/steam_interface.hpp"
|
||||
#include "steam_api/virtuals/steam_api_virtuals.hpp"
|
||||
|
||||
@@ -33,3 +33,8 @@ VIRTUAL(bool) ISteamInventory_CheckResultSteamID(PARAMS(SteamInventoryResult_t,
|
||||
|
||||
// ISteamUser
|
||||
VIRTUAL(EUserHasLicenseForAppResult) ISteamUser_UserHasLicenseForApp(PARAMS(CSteamID, AppId_t));
|
||||
|
||||
// ISteamGameServer
|
||||
VIRTUAL(EUserHasLicenseForAppResult) ISteamGameServer_UserHasLicenseForApp(
|
||||
PARAMS(CSteamID, AppId_t)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user