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

newInstanced #

abstract fun newInstanced(instancedSpec: InventoryContent.InstancedSpec, inventoryContent: InventoryServiceContent, startingInventory: InventoryData, pendingInventory: InventoryData, clientRequestExt: ExtPurchaseRequest?, serverRequestExt: ExtInstancedItemServerGrant?): InstancedItemPlugin.InstancedItemPluginResult

When granting a new Instanced Item, the newInstanced function will allow you to interact with the ext data that will be saved within each item. newInstance is called with either a valid client sourced ext or a valid server sourced ext. The other ext will be null. ExtPurchaseRequest might contain untrusted or unverified information, since it might come directly from the client. ExtInstancedItemServerGrant contains information only provided by other internal flows such as crafting.

Used By

  • InventoryService.matchEndV4
  • InventoryService.storePurchaseV4
  • InventoryService.serviceGrantRewardsV2
  • InventoryService.operatorGrantRewardsV0
  • InventoryService.grantItemsServiceV1
  • InventoryService.grantItemsOperatorV1
  • InventoryService.craftV1 - If craft results in new instanced items.
  • InventoryService.getLoginDataV2 - When limited grants are awarded.
  • InventoryService.simulateRewardsV2 - If simulated reward is a new instance item.
  • InventoryService.applyInventoryOperationsOperatorV1
  • InventoryService.applyInventoryOperationsPartnerV1
  • InventoryService.applyInventoryOperationsServiceV1

Return #

The Ext data to be added within each instanced item grant.

Parameters #

instancedSpec

The Instanced Spec definition 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 creating the InstancedItemGrant.

serverRequestExt

Ext data passed from the server to be used when creating the InstancedItemGrant.