Facepunch.Steamworks Wiki

Steamworks.SteamInventory

Undocumented Parental Settings

Events

static event Action OnDefinitionsUpdated
static event Action<InventoryResult> OnInventoryUpdated

Properties

static string Currency { get; }
static InventoryDef[] Definitions { get; }
static InventoryItem[] Items { get; }
A list of all items available. We will try to keep this list of your items automatically up to date.

Methods

Trigger a promo item drop. You can call this at startup, it won't give users multiple promo drops.
Crafting! Uses the passed items to buy the target item. You need to have set up the appropriate exchange rules in your item definitions. This assumes all the items passed in aren't stacked.
static async Task<InventoryResult> DeserializeAsync( byte[] data, int dataLength = -1 )
Deserializes a result set and verifies the signature bytes. This call has a potential soft-failure mode where the Result is expired, it will still succeed in this mode.The "expired" result could indicate that the data may be out of date - not just due to timed expiration( one hour ), but also because one of the items in the result set may have been traded or consumed since the result set was generated.You could compare the timestamp from GetResultTimestamp to ISteamUtils::GetServerRealTime to d..
Try to find the definition that matches this definition ID. Uses a dictionary so should be about as fast as possible.
static async Task<InventoryResult> GenerateItemAsync( InventoryDef target, int amount )
This is used to grant a specific item to the user. This should only be used for development prototyping, from a trusted server, or if you don't care about hacked clients granting arbitrary items. This call can be disabled by a setting on Steamworks.
static bool GetAllItems()
Update the list of Items[]
static async Task<InventoryResult> GetAllItemsAsync()
Get all items and return the InventoryResult
Grant all promotional items the user is eligible for
static void LoadItemDefinitions()
Call this if you're going to want to access definition information. You should be able to get away with calling this once at the start if your game, assuming your items don't change all the time. This will trigger OnDefinitionsUpdated at which point Definitions should be set.
Start buying a cart load of items. This will return a positive result is the purchase has begun. You should listen out for SteamUser.OnMicroTxnAuthorizationResponse for a success.
Trigger an item drop for this user. This is for timed drops.
static async Task<bool> WaitForDefinitions( float timeoutSeconds = 30 )
Will call LoadItemDefinitions and wait until Definitions is not null