From 949a327b8a51b0b0bf74cecc61da3e45c4bba8d0 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Wed, 4 Dec 2019 08:44:14 -0500 Subject: [PATCH] Implement inventory functions. Fix CI build. --- .gitlab-ci.yml | 1 + dll/steam_inventory.h | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3ddc48..e700c96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,6 +72,7 @@ build_windows: - DLL_FILES="$(ls dll/*.cpp | tr "\n" " ")"; sed "s|dll/\*.cpp|$DLL_FILES|g" -i *.bat - DLL_FILES="$(ls detours/*.cpp | tr "\n" " ")"; sed "s|detours/\*.cpp|$DLL_FILES|g" -i *.bat - DLL_FILES="$(ls dll/*.proto | tr "\n" " " | sed "s/.proto/.pb.cc/g")"; sed "s|dll/\*.cc|$DLL_FILES|g" -i *.bat + - DLL_FILES="$(ls steamclient_loader/*.cpp | tr "\n" " ")"; sed "s|steamclient_loader/\*.cpp|$DLL_FILES|g" -i *.bat - export WINEDEBUG=-all - wine cmd /c build_win_debug_experimental.bat - wine cmd /c build_win_release.bat diff --git a/dll/steam_inventory.h b/dll/steam_inventory.h index 32201e7..3bd8f6e 100644 --- a/dll/steam_inventory.h +++ b/dll/steam_inventory.h @@ -757,7 +757,10 @@ STEAM_CALL_RESULT( SteamInventoryRequestPricesResult_t ) SteamAPICall_t RequestPrices() { PRINT_DEBUG("RequestPrices\n"); - return 0; + SteamInventoryRequestPricesResult_t data; + data.m_result = k_EResultOK; + memcpy(data.m_rgchCurrency, "USD", 4); + return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data), 0.2); } @@ -765,6 +768,7 @@ SteamAPICall_t RequestPrices() uint32 GetNumItemsWithPrices() { PRINT_DEBUG("GetNumItemsWithPrices\n"); + return 0; } bool GetItemsWithPrices( STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pArrayItemDefs, Items with prices) SteamItemDef_t *pArrayItemDefs, @@ -773,6 +777,7 @@ bool GetItemsWithPrices( STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT( uint32 unArrayLength ) { PRINT_DEBUG("GetItemsWithPrices\n"); + return false; } // Returns item definition ids and their prices in the user's local currency. @@ -848,7 +853,7 @@ void RunCallbacks() //only gets called once //also gets called when getting items SteamInventoryDefinitionUpdate_t data = {}; - callbacks->addCBResult(data.k_iCallback, &data, sizeof(data)); + callbacks->addCBResult(data.k_iCallback, &data, sizeof(data), 0.05); } call_definition_update = false;