game-common / pragma.inventory / InstancedItemPlugin / update /

update #

abstract suspend fun update(initialInstancedItem: InstancedItem, instancedSpec: InventoryContent.InstancedSpec, updateEntry: InventoryContent.UpdateEntry, inventoryContent: InventoryServiceContent, startingInventory: InventoryData, pendingInventory: InventoryData, clientRequestExt: ExtInstancedItemUpdate?, serverRequestExt: ExtInstancedItemServerUpdate?): InstancedItemPlugin.InstancedItemPluginResult

When modifying an existing Instanced Item, the update function will allow you to interact with the ext data that will be saved within the item. update is called with either a valid client sourced ext or a valid server sourced ext. The other ext will be null. ExtInstancedItemUpdate might contain untrusted or unverified information, since it might come directly from the client. ExtInstancedItemServerUpdate contains information only provided by other internal flows such as from inventory match end updates.

Used By

  • InventoryService.updateItemV4
  • InventoryService.updateItemsV0
  • InventoryService.applyInventoryOperationsOperatorV1
  • InventoryService.applyInventoryOperationsPartnerV1
  • InventoryService.applyInventoryOperationsServiceV1

Return #

The updated Ext data to be added within the instanced item.

Parameters #

initialInstancedItem

The Instanced Item to modify.

instancedSpec

The Instanced Spec definition from the catalog.

updateEntry

The update entry from the catalog.

inventoryContent

InventoryServiceContent object used to reference all the content specs.

startingInventory

InventoryData - object that contains all the player’s instanced and stackable items.

pendingInventory

InventoryData - object that contains the current in-flight representation of a player’s instanced and stackable items.

clientRequestExt

Ext data passed from the client to be used when updating the Instanced Item.

serverRequestExt

Ext data passed from the server to be used when updating the Instanced Item.