mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2026-01-27 23:12:51 -05:00
[WIP] Koalageddon mode
This commit is contained in:
@@ -157,7 +157,7 @@ namespace steam_apps {
|
||||
logger->debug("{} -> App ID: {}", function_name, app_id);
|
||||
}
|
||||
|
||||
// Compute count only once
|
||||
// Compute count only once // FIXME: This doesn't work in Koalageddon mode
|
||||
static int total_count = [&]() {
|
||||
original_dlc_count = original_function();
|
||||
logger->debug("{} -> Original DLC count: {}", function_name, original_dlc_count);
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace steam_inventory {
|
||||
uint32_t unItemIndex,
|
||||
const char* pchPropertyName,
|
||||
char* pchValueBuffer,
|
||||
const uint32_t* punValueBufferSizeOut,
|
||||
uint32_t* punValueBufferSizeOut,
|
||||
const std::function<bool()>& original_function
|
||||
);
|
||||
|
||||
@@ -97,14 +97,6 @@ namespace steam_inventory {
|
||||
const std::function<bool()>& original_function
|
||||
);
|
||||
|
||||
bool GetItemDefinitionProperty(
|
||||
const String& function_name,
|
||||
SteamItemDef_t iDefinition,
|
||||
const char* pchPropertyName,
|
||||
char* pchValueBuffer,
|
||||
const uint32_t* punValueBufferSizeOut,
|
||||
const std::function<bool()>& original_function
|
||||
);
|
||||
|
||||
bool CheckResultSteamID(
|
||||
const String& function_name,
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace steam_inventory {
|
||||
uint32_t unItemIndex,
|
||||
const char* pchPropertyName,
|
||||
char* pchValueBuffer,
|
||||
const uint32_t* punValueBufferSizeOut,
|
||||
uint32_t* punValueBufferSizeOut,
|
||||
const std::function<bool()>& original_function
|
||||
) {
|
||||
const auto common_info = fmt::format(
|
||||
@@ -210,37 +210,13 @@ namespace steam_inventory {
|
||||
if (pItemDefIDs) { // Definitions were copied
|
||||
for (int i = 0; i < *punItemDefIDsArraySize; i++) {
|
||||
const auto& def = pItemDefIDs[i];
|
||||
logger->debug(" Index: {}, ID: {}", i, def);
|
||||
logger->debug(" Index: {}, ID: {}", i, def);
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool GetItemDefinitionProperty(
|
||||
const String& function_name,
|
||||
SteamItemDef_t iDefinition,
|
||||
const char* pchPropertyName,
|
||||
char* pchValueBuffer,
|
||||
const uint32_t* punValueBufferSizeOut,
|
||||
const std::function<bool()>& original_function
|
||||
) {
|
||||
const auto common_info = fmt::format(
|
||||
"{} -> Definition ID: {}, Name: '{}'", function_name, iDefinition, pchPropertyName
|
||||
);
|
||||
|
||||
const auto success = original_function();
|
||||
|
||||
if (!success) {
|
||||
logger->warn("{}, Result is false", common_info);
|
||||
return false;
|
||||
}
|
||||
|
||||
logger->debug("{}, Buffer: '{}'", common_info, String(pchValueBuffer, *punValueBufferSizeOut - 1));
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CheckResultSteamID(
|
||||
const String& function_name,
|
||||
SteamInventoryResult_t resultHandle,
|
||||
|
||||
Reference in New Issue
Block a user