game-common / pragma.inventory / LimitedGrantPlugin / shouldGrant /

shouldGrant #

open suspend fun shouldGrant(playerInventory: InventoryData, limitedGrant: InventoryContent.LimitedGrant): Boolean

Allows for implementing custom requirements when performing a limited grant. LimitedGrant content entry and the player’s InventoryData are provided to help determine if the grant should be allowed.

Used by

  • InventoryService.getLoginDataServiceV2 - endpoint responsible for processing limited grants.
  • GameDataService.getLoginDataV3 - player endpoint that will call InventoryService.getLoginDataServiceV2 through the DefaultPragmaLoginDataPlugin

Return #

True if player should be given this limited grant, false otherwise.

Parameters #

playerInventory

The full inventory of the player

limitedGrant

the limited grant content entry to potentially be given.