docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SteamInventory

    Purpose: Steam Inventory query and manipulation API

    Inheritance
    object
    SteamInventory
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Steamworks.Interop
    Assembly: Unity.Steamworks.Interop.dll
    Syntax
    public static class SteamInventory

    Methods

    AddPromoItem(out SteamInventoryResult_t, SteamItemDef_t)

    AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of scanning for all eligible promotional items, the check is restricted to a single item definition or set of item definitions. This can be useful if your game has custom UI for showing a specific promo item to the user.

    Declaration
    public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::AddPromoItem.

    SteamItemDef_t itemDef

    Passed through to ISteamInventory::AddPromoItem.

    Returns
    Type Description
    bool

    The value ISteamInventory::AddPromoItem returns.

    AddPromoItems(out SteamInventoryResult_t, SteamItemDef_t[], uint)

    Calls the Steamworks ISteamInventory::AddPromoItems method.

    Declaration
    public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::AddPromoItems.

    SteamItemDef_t[] pArrayItemDefs

    Passed through to ISteamInventory::AddPromoItems.

    uint unArrayLength

    Passed through to ISteamInventory::AddPromoItems.

    Returns
    Type Description
    bool

    The value ISteamInventory::AddPromoItems returns.

    CheckResultSteamID(SteamInventoryResult_t, CSteamID)

    Returns true if the result belongs to the target steam ID, false if the result does not. This is important when using DeserializeResult, to verify that a remote player is not pretending to have a different user's inventory.

    Declaration
    public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected)
    Parameters
    Type Name Description
    SteamInventoryResult_t resultHandle

    Passed through to ISteamInventory::CheckResultSteamID.

    CSteamID steamIDExpected

    Passed through to ISteamInventory::CheckResultSteamID.

    Returns
    Type Description
    bool

    The value ISteamInventory::CheckResultSteamID returns.

    ConsumeItem(out SteamInventoryResult_t, SteamItemInstanceID_t, uint)

    ConsumeItem() removes items from the inventory, permanently. They cannot be recovered. Not for the faint of heart - if your game implements item removal at all, a high-friction UI confirmation process is highly recommended.

    Declaration
    public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::ConsumeItem.

    SteamItemInstanceID_t itemConsume

    Passed through to ISteamInventory::ConsumeItem.

    uint unQuantity

    Passed through to ISteamInventory::ConsumeItem.

    Returns
    Type Description
    bool

    The value ISteamInventory::ConsumeItem returns.

    DeserializeResult(out SteamInventoryResult_t, byte[], uint, bool)

    Deserializes a result set and verifies the signature bytes. Returns false if bRequireFullOnlineVerify is set but Steam is running in Offline mode. Otherwise returns true and then delivers error codes via GetResultStatus. The bRESERVED_MUST_BE_FALSE flag is reserved for future use and should not be set to true by your game at this time. DeserializeResult has a potential soft-failure mode where the handle status is set to k_EResultExpired. GetResultItems() still succeeds 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 determine how old the data is. You could simply ignore the "expired" result code and continue as normal, or you could challenge the player with expired data to send an updated result set.

    Declaration
    public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE = false)
    Parameters
    Type Name Description
    SteamInventoryResult_t pOutResultHandle

    Passed through to ISteamInventory::DeserializeResult.

    byte[] pBuffer

    Passed through to ISteamInventory::DeserializeResult.

    uint unBufferSize

    Passed through to ISteamInventory::DeserializeResult.

    bool bRESERVED_MUST_BE_FALSE

    Passed through to ISteamInventory::DeserializeResult.

    Returns
    Type Description
    bool

    The value ISteamInventory::DeserializeResult returns.

    DestroyResult(SteamInventoryResult_t)

    Destroys a result handle and frees all associated memory.

    Declaration
    public static void DestroyResult(SteamInventoryResult_t resultHandle)
    Parameters
    Type Name Description
    SteamInventoryResult_t resultHandle

    Passed through to ISteamInventory::DestroyResult.

    ExchangeItems(out SteamInventoryResult_t, SteamItemDef_t[], uint[], uint, SteamItemInstanceID_t[], uint[], uint)

    ExchangeItems() is an atomic combination of item generation and consumption. It can be used to implement crafting recipes or transmutations, or items which unpack themselves into other items (e.g., a chest). Exchange recipes are defined in the ItemDef, and explicitly list the required item types and resulting generated type. Exchange recipes are evaluated atomically by the Inventory Service; if the supplied components do not match the recipe, or do not contain sufficient quantity, the exchange will fail.

    Declaration
    public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::ExchangeItems.

    SteamItemDef_t[] pArrayGenerate

    Passed through to ISteamInventory::ExchangeItems.

    uint[] punArrayGenerateQuantity

    Passed through to ISteamInventory::ExchangeItems.

    uint unArrayGenerateLength

    Passed through to ISteamInventory::ExchangeItems.

    SteamItemInstanceID_t[] pArrayDestroy

    Passed through to ISteamInventory::ExchangeItems.

    uint[] punArrayDestroyQuantity

    Passed through to ISteamInventory::ExchangeItems.

    uint unArrayDestroyLength

    Passed through to ISteamInventory::ExchangeItems.

    Returns
    Type Description
    bool

    The value ISteamInventory::ExchangeItems returns.

    GenerateItems(out SteamInventoryResult_t, SteamItemDef_t[], uint[], uint)

    INVENTORY ASYNC MODIFICATION GenerateItems() creates one or more items and then generates a SteamInventoryCallback_t notification with a matching nCallbackContext parameter. This API is only intended for prototyping - it is only usable by Steam accounts that belong to the publisher group for your game. If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should describe the quantity of each item to generate.

    Declaration
    public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::GenerateItems.

    SteamItemDef_t[] pArrayItemDefs

    Passed through to ISteamInventory::GenerateItems.

    uint[] punArrayQuantity

    Passed through to ISteamInventory::GenerateItems.

    uint unArrayLength

    Passed through to ISteamInventory::GenerateItems.

    Returns
    Type Description
    bool

    The value ISteamInventory::GenerateItems returns.

    GetAllItems(out SteamInventoryResult_t)

    INVENTORY ASYNC QUERY Captures the entire state of the current user's Steam inventory. You must call DestroyResult on this handle when you are done with it. Returns false and sets *pResultHandle to zero if inventory is unavailable. Note: calls to this function are subject to rate limits and may return cached results if called too frequently. It is suggested that you call this function only when you are about to display the user's full inventory, or if you expect that the inventory may have changed.

    Declaration
    public static bool GetAllItems(out SteamInventoryResult_t pResultHandle)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::GetAllItems.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetAllItems returns.

    GetEligiblePromoItemDefinitionIDs(CSteamID, SteamItemDef_t[], ref uint)

    After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this function to pull out the list of item definition ids that the user can be manually granted via the AddPromoItems() call.

    Declaration
    public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize)
    Parameters
    Type Name Description
    CSteamID steamID

    Passed through to ISteamInventory::GetEligiblePromoItemDefinitionIDs.

    SteamItemDef_t[] pItemDefIDs

    Passed through to ISteamInventory::GetEligiblePromoItemDefinitionIDs.

    uint punItemDefIDsArraySize

    Passed through to ISteamInventory::GetEligiblePromoItemDefinitionIDs.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetEligiblePromoItemDefinitionIDs returns.

    GetItemDefinitionIDs(SteamItemDef_t[], ref uint)

    GetItemDefinitionIDs returns the set of all defined item definition IDs (which are defined via Steamworks configuration, and not necessarily contiguous integers). If pItemDefIDs is null, the call will return true and *punItemDefIDsArraySize will contain the total size necessary for a subsequent call. Otherwise, the call will return false if and only if there is not enough space in the output array.

    Declaration
    public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize)
    Parameters
    Type Name Description
    SteamItemDef_t[] pItemDefIDs

    Passed through to ISteamInventory::GetItemDefinitionIDs.

    uint punItemDefIDsArraySize

    Passed through to ISteamInventory::GetItemDefinitionIDs.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetItemDefinitionIDs returns.

    GetItemDefinitionProperty(SteamItemDef_t, string, out string, ref uint)

    GetItemDefinitionProperty returns a string property from a given item definition. Note that some properties (for example, "name") may be localized and will depend on the current Steam language settings (see ISteamApps::GetCurrentGameLanguage). Property names are always composed of ASCII letters, numbers, and/or underscores. Pass a NULL pointer for pchPropertyName to get a comma - separated list of available property names. If pchValueBuffer is NULL, *punValueBufferSize will contain the suggested buffer size. Otherwise it will be the number of bytes actually copied to pchValueBuffer. If the results do not fit in the given buffer, partial results may be copied.

    Declaration
    public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut)
    Parameters
    Type Name Description
    SteamItemDef_t iDefinition

    Passed through to ISteamInventory::GetItemDefinitionProperty.

    string pchPropertyName

    Passed through to ISteamInventory::GetItemDefinitionProperty.

    string pchValueBuffer

    Receives the string ISteamInventory::GetItemDefinitionProperty writes.

    uint punValueBufferSizeOut

    Passed through to ISteamInventory::GetItemDefinitionProperty.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetItemDefinitionProperty returns.

    GetItemPrice(SteamItemDef_t, out ulong, out ulong)

    Retrieves the price for the item definition id Returns false if there is no price stored for the item definition.

    Declaration
    public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPrice, out ulong pBasePrice)
    Parameters
    Type Name Description
    SteamItemDef_t iDefinition

    Passed through to ISteamInventory::GetItemPrice.

    ulong pCurrentPrice

    Passed through to ISteamInventory::GetItemPrice.

    ulong pBasePrice

    Passed through to ISteamInventory::GetItemPrice.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetItemPrice returns.

    GetItemsByID(out SteamInventoryResult_t, SteamItemInstanceID_t[], uint)

    Captures the state of a subset of the current user's Steam inventory, identified by an array of item instance IDs. The results from this call can be serialized and passed to other players to "prove" that the current user owns specific items, without exposing the user's entire inventory. For example, you could call GetItemsByID with the IDs of the user's currently equipped cosmetic items and serialize this to a buffer, and then transmit this buffer to other players upon joining a game.

    Declaration
    public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::GetItemsByID.

    SteamItemInstanceID_t[] pInstanceIDs

    Passed through to ISteamInventory::GetItemsByID.

    uint unCountInstanceIDs

    Passed through to ISteamInventory::GetItemsByID.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetItemsByID returns.

    GetItemsWithPrices(SteamItemDef_t[], ulong[], ulong[], uint)

    Returns item definition ids and their prices in the user's local currency. Need to call RequestPrices() first.

    Declaration
    public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] pCurrentPrices, ulong[] pBasePrices, uint unArrayLength)
    Parameters
    Type Name Description
    SteamItemDef_t[] pArrayItemDefs

    Passed through to ISteamInventory::GetItemsWithPrices.

    ulong[] pCurrentPrices

    Passed through to ISteamInventory::GetItemsWithPrices.

    ulong[] pBasePrices

    Passed through to ISteamInventory::GetItemsWithPrices.

    uint unArrayLength

    Passed through to ISteamInventory::GetItemsWithPrices.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetItemsWithPrices returns.

    GetNumItemsWithPrices()

    Returns the number of items with prices. Need to call RequestPrices() first.

    Declaration
    public static uint GetNumItemsWithPrices()
    Returns
    Type Description
    uint

    The value ISteamInventory::GetNumItemsWithPrices returns.

    GetResultItemProperty(SteamInventoryResult_t, uint, string, out string, ref uint)

    In combination with GetResultItems, you can use GetResultItemProperty to retrieve dynamic string properties for a given item returned in the result set. Property names are always composed of ASCII letters, numbers, and/or underscores. Pass a NULL pointer for pchPropertyName to get a comma - separated list of available property names. If pchValueBuffer is NULL, *punValueBufferSize will contain the suggested buffer size. Otherwise it will be the number of bytes actually copied to pchValueBuffer. If the results do not fit in the given buffer, partial results may be copied.

    Declaration
    public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, uint unItemIndex, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut)
    Parameters
    Type Name Description
    SteamInventoryResult_t resultHandle

    Passed through to ISteamInventory::GetResultItemProperty.

    uint unItemIndex

    Passed through to ISteamInventory::GetResultItemProperty.

    string pchPropertyName

    Passed through to ISteamInventory::GetResultItemProperty.

    string pchValueBuffer

    Receives the string ISteamInventory::GetResultItemProperty writes.

    uint punValueBufferSizeOut

    Passed through to ISteamInventory::GetResultItemProperty.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetResultItemProperty returns.

    GetResultItems(SteamInventoryResult_t, SteamItemDetails_t[], ref uint)

    Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used.

    Declaration
    public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize)
    Parameters
    Type Name Description
    SteamInventoryResult_t resultHandle

    Passed through to ISteamInventory::GetResultItems.

    SteamItemDetails_t[] pOutItemsArray

    Passed through to ISteamInventory::GetResultItems.

    uint punOutItemsArraySize

    Passed through to ISteamInventory::GetResultItems.

    Returns
    Type Description
    bool

    The value ISteamInventory::GetResultItems returns.

    GetResultStatus(SteamInventoryResult_t)

    INVENTORY ASYNC RESULT MANAGEMENT Asynchronous inventory queries always output a result handle which can be used with GetResultStatus, GetResultItems, etc. A SteamInventoryResultReady_t callback will be triggered when the asynchronous result becomes ready (or fails). Find out the status of an asynchronous inventory result handle. Possible values: k_EResultPending - still in progress k_EResultOK - done, result ready k_EResultExpired - done, result ready, maybe out of date (see DeserializeResult) k_EResultInvalidParam - ERROR: invalid API call parameters k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits k_EResultFail - ERROR: unknown / generic error

    Declaration
    public static EResult GetResultStatus(SteamInventoryResult_t resultHandle)
    Parameters
    Type Name Description
    SteamInventoryResult_t resultHandle

    Passed through to ISteamInventory::GetResultStatus.

    Returns
    Type Description
    EResult

    The value ISteamInventory::GetResultStatus returns.

    GetResultTimestamp(SteamInventoryResult_t)

    Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age.

    Declaration
    public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle)
    Parameters
    Type Name Description
    SteamInventoryResult_t resultHandle

    Passed through to ISteamInventory::GetResultTimestamp.

    Returns
    Type Description
    uint

    The value ISteamInventory::GetResultTimestamp returns.

    GrantPromoItems(out SteamInventoryResult_t)

    GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only). On success, the result set will include items which were granted, if any. If no items were granted because the user isn't eligible for any promotions, this is still considered a success.

    Declaration
    public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::GrantPromoItems.

    Returns
    Type Description
    bool

    The value ISteamInventory::GrantPromoItems returns.

    InspectItem(out SteamInventoryResult_t, string)

    Calls the Steamworks ISteamInventory::InspectItem method.

    Declaration
    public static bool InspectItem(out SteamInventoryResult_t pResultHandle, string pchItemToken)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::InspectItem.

    string pchItemToken

    Passed through to ISteamInventory::InspectItem.

    Returns
    Type Description
    bool

    The value ISteamInventory::InspectItem returns.

    LoadItemDefinitions()

    ITEM DEFINITIONS Item definitions are a mapping of "definition IDs" (integers between 1 and 1000000) to a set of string properties. Some of these properties are required to display items on the Steam community web site. Other properties can be defined by applications. Use of these functions is optional; there is no reason to call LoadItemDefinitions if your game hardcodes the numeric definition IDs (eg, purple face mask = 20, blue weapon mod = 55) and does not allow for adding new item types without a client patch. LoadItemDefinitions triggers the automatic load and refresh of item definitions. Every time new item definitions are available (eg, from the dynamic addition of new item types while players are still in-game), a SteamInventoryDefinitionUpdate_t callback will be fired.

    Declaration
    public static bool LoadItemDefinitions()
    Returns
    Type Description
    bool

    The value ISteamInventory::LoadItemDefinitions returns.

    RemoveProperty(SteamInventoryUpdateHandle_t, SteamItemInstanceID_t, string)

    Remove the property on the item

    Declaration
    public static bool RemoveProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName)
    Parameters
    Type Name Description
    SteamInventoryUpdateHandle_t handle

    Passed through to ISteamInventory::RemoveProperty.

    SteamItemInstanceID_t nItemID

    Passed through to ISteamInventory::RemoveProperty.

    string pchPropertyName

    Passed through to ISteamInventory::RemoveProperty.

    Returns
    Type Description
    bool

    The value ISteamInventory::RemoveProperty returns.

    RequestEligiblePromoItemDefinitionsIDs(CSteamID)

    Request the list of "eligible" promo items that can be manually granted to the given user. These are promo items of type "manual" that won't be granted automatically. An example usage of this is an item that becomes available every week.

    Declaration
    public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID steamID)
    Parameters
    Type Name Description
    CSteamID steamID

    Passed through to ISteamInventory::RequestEligiblePromoItemDefinitionsIDs.

    Returns
    Type Description
    SteamAPICall_t

    The value ISteamInventory::RequestEligiblePromoItemDefinitionsIDs returns.

    RequestEligiblePromoItemDefinitionsIDsAsync(CSteamID)

    Async version of RequestEligiblePromoItemDefinitionsIDs(CSteamID).

    Declaration
    public static Task<SteamInventoryEligiblePromoItemDefIDs_t> RequestEligiblePromoItemDefinitionsIDsAsync(CSteamID steamID)
    Parameters
    Type Name Description
    CSteamID steamID

    Passed through to ISteamInventory::RequestEligiblePromoItemDefinitionsIDs.

    Returns
    Type Description
    Task<SteamInventoryEligiblePromoItemDefIDs_t>

    The SteamInventoryEligiblePromoItemDefIDs_t Steam reports once the call completes.

    RequestPrices()

    Request current prices for all applicable item definitions

    Declaration
    public static SteamAPICall_t RequestPrices()
    Returns
    Type Description
    SteamAPICall_t

    The value ISteamInventory::RequestPrices returns.

    RequestPricesAsync()

    Async version of RequestPrices().

    Declaration
    public static Task<SteamInventoryRequestPricesResult_t> RequestPricesAsync()
    Returns
    Type Description
    Task<SteamInventoryRequestPricesResult_t>

    The SteamInventoryRequestPricesResult_t Steam reports once the call completes.

    SendItemDropHeartbeat()

    TIMED DROPS AND PLAYTIME CREDIT Deprecated. Calling this method is not required for proper playtime accounting.

    Declaration
    public static void SendItemDropHeartbeat()

    SerializeResult(SteamInventoryResult_t, byte[], out uint)

    RESULT SERIALIZATION AND AUTHENTICATION Serialized result sets contain a short signature which can't be forged or replayed across different game sessions. A result set can be serialized on the local client, transmitted to other players via your game networking, and deserialized by the remote players. This is a secure way of preventing hackers from lying about posessing rare/high-value items. Serializes a result set with signature bytes to an output buffer. Pass NULL as an output buffer to get the required size via punOutBufferSize. The size of a serialized result depends on the number items which are being serialized. When securely transmitting items to other players, it is recommended to use "GetItemsByID" first to create a minimal result set. Results have a built-in timestamp which will be considered "expired" after an hour has elapsed. See DeserializeResult for expiration handling.

    Declaration
    public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize)
    Parameters
    Type Name Description
    SteamInventoryResult_t resultHandle

    Passed through to ISteamInventory::SerializeResult.

    byte[] pOutBuffer

    Passed through to ISteamInventory::SerializeResult.

    uint punOutBufferSize

    Passed through to ISteamInventory::SerializeResult.

    Returns
    Type Description
    bool

    The value ISteamInventory::SerializeResult returns.

    SetProperty(SteamInventoryUpdateHandle_t, SteamItemInstanceID_t, string, bool)

    Calls the Steamworks ISteamInventory::SetProperty method.

    Declaration
    public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, bool bValue)
    Parameters
    Type Name Description
    SteamInventoryUpdateHandle_t handle

    Passed through to ISteamInventory::SetProperty.

    SteamItemInstanceID_t nItemID

    Passed through to ISteamInventory::SetProperty.

    string pchPropertyName

    Passed through to ISteamInventory::SetProperty.

    bool bValue

    Passed through to ISteamInventory::SetProperty.

    Returns
    Type Description
    bool

    The value ISteamInventory::SetProperty returns.

    SetProperty(SteamInventoryUpdateHandle_t, SteamItemInstanceID_t, string, long)

    Calls the Steamworks ISteamInventory::SetProperty method.

    Declaration
    public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, long nValue)
    Parameters
    Type Name Description
    SteamInventoryUpdateHandle_t handle

    Passed through to ISteamInventory::SetProperty.

    SteamItemInstanceID_t nItemID

    Passed through to ISteamInventory::SetProperty.

    string pchPropertyName

    Passed through to ISteamInventory::SetProperty.

    long nValue

    Passed through to ISteamInventory::SetProperty.

    Returns
    Type Description
    bool

    The value ISteamInventory::SetProperty returns.

    SetProperty(SteamInventoryUpdateHandle_t, SteamItemInstanceID_t, string, float)

    Calls the Steamworks ISteamInventory::SetProperty method.

    Declaration
    public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, float flValue)
    Parameters
    Type Name Description
    SteamInventoryUpdateHandle_t handle

    Passed through to ISteamInventory::SetProperty.

    SteamItemInstanceID_t nItemID

    Passed through to ISteamInventory::SetProperty.

    string pchPropertyName

    Passed through to ISteamInventory::SetProperty.

    float flValue

    Passed through to ISteamInventory::SetProperty.

    Returns
    Type Description
    bool

    The value ISteamInventory::SetProperty returns.

    SetProperty(SteamInventoryUpdateHandle_t, SteamItemInstanceID_t, string, string)

    Calls the Steamworks ISteamInventory::SetProperty method.

    Declaration
    public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, string pchPropertyValue)
    Parameters
    Type Name Description
    SteamInventoryUpdateHandle_t handle

    Passed through to ISteamInventory::SetProperty.

    SteamItemInstanceID_t nItemID

    Passed through to ISteamInventory::SetProperty.

    string pchPropertyName

    Passed through to ISteamInventory::SetProperty.

    string pchPropertyValue

    Passed through to ISteamInventory::SetProperty.

    Returns
    Type Description
    bool

    The value ISteamInventory::SetProperty returns.

    StartPurchase(SteamItemDef_t[], uint[], uint)

    Starts the purchase process for the given item definitions. The callback SteamInventoryStartPurchaseResult_t will be posted if Steam was able to initialize the transaction. Once the purchase has been authorized and completed by the user, the callback SteamInventoryResultReady_t will be posted.

    Declaration
    public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength)
    Parameters
    Type Name Description
    SteamItemDef_t[] pArrayItemDefs

    Passed through to ISteamInventory::StartPurchase.

    uint[] punArrayQuantity

    Passed through to ISteamInventory::StartPurchase.

    uint unArrayLength

    Passed through to ISteamInventory::StartPurchase.

    Returns
    Type Description
    SteamAPICall_t

    The value ISteamInventory::StartPurchase returns.

    StartPurchaseAsync(SteamItemDef_t[], uint[], uint)

    Async version of StartPurchase(SteamItemDef_t[], uint[], uint).

    Declaration
    public static Task<SteamInventoryStartPurchaseResult_t> StartPurchaseAsync(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength)
    Parameters
    Type Name Description
    SteamItemDef_t[] pArrayItemDefs

    Passed through to ISteamInventory::StartPurchase.

    uint[] punArrayQuantity

    Passed through to ISteamInventory::StartPurchase.

    uint unArrayLength

    Passed through to ISteamInventory::StartPurchase.

    Returns
    Type Description
    Task<SteamInventoryStartPurchaseResult_t>

    The SteamInventoryStartPurchaseResult_t Steam reports once the call completes.

    StartUpdateProperties()

    Create a request to update properties on items

    Declaration
    public static SteamInventoryUpdateHandle_t StartUpdateProperties()
    Returns
    Type Description
    SteamInventoryUpdateHandle_t

    The value ISteamInventory::StartUpdateProperties returns.

    SubmitUpdateProperties(SteamInventoryUpdateHandle_t, out SteamInventoryResult_t)

    Submit the update request by handle

    Declaration
    public static bool SubmitUpdateProperties(SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle)
    Parameters
    Type Name Description
    SteamInventoryUpdateHandle_t handle

    Passed through to ISteamInventory::SubmitUpdateProperties.

    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::SubmitUpdateProperties.

    Returns
    Type Description
    bool

    The value ISteamInventory::SubmitUpdateProperties returns.

    TradeItems(out SteamInventoryResult_t, CSteamID, SteamItemInstanceID_t[], uint[], uint, SteamItemInstanceID_t[], uint[], uint)

    Deprecated. This method is not supported.

    Declaration
    public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, SteamItemInstanceID_t[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, SteamItemInstanceID_t[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::TradeItems.

    CSteamID steamIDTradePartner

    Passed through to ISteamInventory::TradeItems.

    SteamItemInstanceID_t[] pArrayGive

    Passed through to ISteamInventory::TradeItems.

    uint[] pArrayGiveQuantity

    Passed through to ISteamInventory::TradeItems.

    uint nArrayGiveLength

    Passed through to ISteamInventory::TradeItems.

    SteamItemInstanceID_t[] pArrayGet

    Passed through to ISteamInventory::TradeItems.

    uint[] pArrayGetQuantity

    Passed through to ISteamInventory::TradeItems.

    uint nArrayGetLength

    Passed through to ISteamInventory::TradeItems.

    Returns
    Type Description
    bool

    The value ISteamInventory::TradeItems returns.

    TransferItemQuantity(out SteamInventoryResult_t, SteamItemInstanceID_t, uint, SteamItemInstanceID_t)

    TransferItemQuantity() is intended for use with items which are "stackable" (can have quantity greater than one). It can be used to split a stack into two, or to transfer quantity from one stack into another stack of identical items. To split one stack into two, pass k_SteamItemInstanceIDInvalid for itemIdDest and a new item will be generated.

    Declaration
    public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::TransferItemQuantity.

    SteamItemInstanceID_t itemIdSource

    Passed through to ISteamInventory::TransferItemQuantity.

    uint unQuantity

    Passed through to ISteamInventory::TransferItemQuantity.

    SteamItemInstanceID_t itemIdDest

    Passed through to ISteamInventory::TransferItemQuantity.

    Returns
    Type Description
    bool

    The value ISteamInventory::TransferItemQuantity returns.

    TriggerItemDrop(out SteamInventoryResult_t, SteamItemDef_t)

    Playtime credit must be consumed and turned into item drops by your game. Only item definitions which are marked as "playtime item generators" can be spawned. The call will return an empty result set if there is not enough playtime credit for a drop. Your game should call TriggerItemDrop at an appropriate time for the user to receive new items, such as between rounds or while the player is dead. Note that players who hack their clients could modify the value of "dropListDefinition", so do not use it to directly control rarity. See your Steamworks configuration to set playtime drop rates for individual itemdefs. The client library will suppress too-frequent calls to this method.

    Declaration
    public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition)
    Parameters
    Type Name Description
    SteamInventoryResult_t pResultHandle

    Passed through to ISteamInventory::TriggerItemDrop.

    SteamItemDef_t dropListDefinition

    Passed through to ISteamInventory::TriggerItemDrop.

    Returns
    Type Description
    bool

    The value ISteamInventory::TriggerItemDrop returns.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)