From e1987515d81dd92ed481b0d2ba6201a2c17359cf Mon Sep 17 00:00:00 2001 From: acidicoala <67734819+acidicoala@users.noreply.github.com> Date: Sat, 11 Mar 2023 19:05:48 +0400 Subject: [PATCH] Fixed koalabox calls --- src/store_mode/steamclient/steamclient.cpp | 1 - src/store_mode/store_api.cpp | 2 +- src/store_mode/store_cache.cpp | 6 ++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/store_mode/steamclient/steamclient.cpp b/src/store_mode/steamclient/steamclient.cpp index 6fb0b38..c86d270 100644 --- a/src/store_mode/steamclient/steamclient.cpp +++ b/src/store_mode/steamclient/steamclient.cpp @@ -35,7 +35,6 @@ namespace store::steamclient { construct_ordinal_map(#INTERFACE, ordinal_map[#INTERFACE], function_selector_address); #define HOOK_FUNCTION(INTERFACE, FUNC) hook::swap_virtual_func_or_throw( \ - globals::address_map, \ interface, \ #INTERFACE"_"#FUNC, \ ordinal_map[#INTERFACE][#FUNC], \ diff --git a/src/store_mode/store_api.cpp b/src/store_mode/store_api.cpp index 1286bc3..7db481c 100644 --- a/src/store_mode/store_api.cpp +++ b/src/store_mode/store_api.cpp @@ -7,7 +7,7 @@ namespace store::api { try { const String url = "https://raw.githubusercontent.com/acidicoala/public-entitlements/main/steam/v2/store_config.json"; - const auto kg_config_json = koalabox::http_client::fetch_json(url); + const auto kg_config_json = koalabox::http_client::get_json(url); return kg_config_json.get(); } catch (const Exception& e) { diff --git a/src/store_mode/store_cache.cpp b/src/store_mode/store_cache.cpp index e49a2fd..1faa4f1 100644 --- a/src/store_mode/store_cache.cpp +++ b/src/store_mode/store_cache.cpp @@ -7,9 +7,7 @@ namespace store::store_cache { std::optional get_store_config() { try { - const auto config_json = koalabox::cache::read_from_cache(KEY_KG_CONFIG); - - return config_json.get(); + return koalabox::cache::get(KEY_KG_CONFIG, Json(nullptr)).get(); } catch (const Exception& e) { LOG_ERROR("Failed to get cached store_mode config: {}", e.what()) @@ -21,7 +19,7 @@ namespace store::store_cache { try { LOG_DEBUG("Caching store_mode config") - return koalabox::cache::save_to_cache(KEY_KG_CONFIG, Json(config)); + return koalabox::cache::put(KEY_KG_CONFIG, Json(config)); } catch (const Exception& e) { LOG_ERROR("Failed to cache store_mode config: {}", e.what())