Class AirshipPlatformInventoryService

Allows management of platform inventory for a player. These functions manipluate a persistent inventory that the player owns. Items, Accessories, and Profile Pictures are all managed by this inventory and the configurations must be registered on the https://create.airship.gg website.

It is NOT recommended to use this inventory system for things like a game economy or persisting game inventory between servers. This inventory is meant to be used for items, accessories, and profile pictures that may have real money value or that players may wish to trade or sell outside of the game. This inventory is the way that the game can interact with the wider platform economy.

Some examples of potential items to include in this inventory:

  • Weapon skins
  • Playable characters
  • Trading cards
  • Content purchased with real money
  • Content that players may want to trade or sell to other players

Methods

  • Deletes the given item instance from the users inventory.

    Parameters

    • instanceId: string

    Returns Promise<Result<ItemInstanceDto, undefined>>

  • Gets all items in a users inventory.

    Parameters

    • userId: string
    • Optional query: ItemQueryParameters

    Returns Promise<Result<ItemInstanceDto[], undefined>>

  • Grants a user the provided item.

    Parameters

    • userId: string
    • classId: string

    Returns Promise<Result<ItemInstanceDto, undefined>>

  • Performs a trade between two players. Trades are atomic, if the transaction does not succeed, no items are lost or modified.

    Parameters

    • user1: {
          itemInstanceIds: string[];
          uid: string;
      }

      The first user and items from their inventory that will be traded to the second user.

      • itemInstanceIds: string[]
      • uid: string
    • user2: {
          itemInstanceIds: string[];
          uid: string;
      }

      The second user and items from their inventory that will be traded to the first user.

      • itemInstanceIds: string[]
      • uid: string

    Returns Promise<Result<Transaction, undefined>>