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; }
We will try to keep this list of your items automatically up to date.

Methods

static async Task<InventoryResult> AddPromoItemAsync( Data.InventoryDefId id )
Trigger a promo item drop. You can call this at startup, it won't give users multiple promo drops.
static async Task<InventoryResult> CraftItemAsync( InventoryItem.Amount[] list, InventoryDef target )
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..
static InventoryDef FindDefinition( Data.InventoryDefId defId )
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
static async Task<InventoryResult> GrantPromoItemsAsync()
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.
static async Task<Data.InventoryPurchaseResult> StartPurchaseAsync( InventoryDef[] items )
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.
static async Task<InventoryResult> TriggerItemDropAsync( Data.InventoryDefId id )
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

Page Links


Special Pages


Wikis

?

Render Time: 60ms

DB GetPage 43
Generate Html 1
SaveChanges (1) 12
Render Body 0
Render Sidebar 1