game / pragma.inventory / InventoryService /

InventoryService #

class InventoryService(pragmaNode: PragmaNode, instanceId: UUID, uuidProxy: UUIDProxy = UUIDProxy(), content: InventoryServiceContent = InventoryServiceContent(), rewardsEngine: RewardsEngine = RewardsEngine(content), ledgerBuilder: LedgerBuilder = LedgerBuilder(content, uuidProxy, rewardsEngine), inventoryFilter: InventoryFilter = InventoryFilter(content), playerNotifier: PlayerNotifier = PlayerNotifier(pragmaNode), playerInventoryProxy: PlayerInventoryProxy = PlayerInventoryProxyImpl(ledgerBuilder, inventoryFilter), fulfillment: Fulfillment = Fulfillment(playerInventoryProxy, LedgerOperationsFactory(content)), purchaseConstraintsFactory: PurchaseConstraintsFactory = PurchaseConstraintsFactory(content), storeEntryPurchaser: StoreEntryPurchaser = StoreEntryPurchaser(purchaseConstraintsFactory, content), purchaseCommand: StorePurchaseCommand = StorePurchaseCommand( playerInventoryProxy, storeEntryPurchaser ), stores: Stores = Stores(content, playerInventoryProxy, storeEntryPurchaser), craftCommand: CraftCommand = CraftCommand(playerInventoryProxy, content, purchaseConstraintsFactory), updateCommand: UpdateCommand = UpdateCommand(playerInventoryProxy), grantRewardsCommand: GrantRewardsCommand = GrantRewardsCommand(playerInventoryProxy), matchEndCommand: InventoryMatchEndCommand = InventoryMatchEndCommand(pragmaNode, playerInventoryProxy), grantCommand: GrantCommand = GrantCommand(playerInventoryProxy), grantCommandBulk: GrantCommandBulk = GrantCommandBulk(), destroyCommand: DestroyCommand = DestroyCommand(playerInventoryProxy), limitedGrantCommand: LimitedGrantCommand = LimitedGrantCommand(content, playerInventoryProxy), loginDataCommand: LoginDataCommand = LoginDataCommand( content, playerInventoryProxy, stores, limitedGrantCommand ), applyContentCommand: ApplyContentChangesCommand = applyCommandFactory(pragmaNode), updateContentCommand: UpdateContentCommand = UpdateContentCommand(), planContentCommand: PlanContentChangesCommand = PlanContentChangesCommand(), contentVersionCountsCommand: ContentVersionCountsCommand = ContentVersionCountsCommand(), socialPaymentServiceClient: SocialPaymentServiceClient = SocialPaymentServiceClient(pragmaNode), applyInventoryOperationsCommand: ApplyInventoryOperationsCommand = ApplyInventoryOperationsCommand(playerInventoryProxy), itemBundleGrantCommand: ItemBundleGrantCommand = ItemBundleGrantCommand(fulfillment), getContentSourceCommand: GetContentSourceCommand = GetContentSourceCommand(), socialAccountServiceClient: SocialAccountServiceClient = SocialAccountServiceClient(), entitlementsCommand: EntitlementsCommand = EntitlementsCommand(fulfillment), playerInventoryCache: PlayerInventoryCache = PlayerInventoryCache(playerNotifier)) : DistributedService, ConfigHandler<InventoryServiceConfig>

InventoryService is responsible for interactions with Player Inventory, management of Instanced and Stackable items, reward and content grants, and store purchasing.

References

Constructors #

InventoryService

internal fun InventoryService(pragmaNode: PragmaNode, instanceId: UUID, uuidProxy: UUIDProxy = UUIDProxy(), content: InventoryServiceContent = InventoryServiceContent(), rewardsEngine: RewardsEngine = RewardsEngine(content), ledgerBuilder: LedgerBuilder = LedgerBuilder(content, uuidProxy, rewardsEngine), inventoryFilter: InventoryFilter = InventoryFilter(content), playerNotifier: PlayerNotifier = PlayerNotifier(pragmaNode), playerInventoryProxy: PlayerInventoryProxy = PlayerInventoryProxyImpl(ledgerBuilder, inventoryFilter), fulfillment: Fulfillment = Fulfillment(playerInventoryProxy, LedgerOperationsFactory(content)), purchaseConstraintsFactory: PurchaseConstraintsFactory = PurchaseConstraintsFactory(content), storeEntryPurchaser: StoreEntryPurchaser = StoreEntryPurchaser(purchaseConstraintsFactory, content), purchaseCommand: StorePurchaseCommand = StorePurchaseCommand( playerInventoryProxy, storeEntryPurchaser ), stores: Stores = Stores(content, playerInventoryProxy, storeEntryPurchaser), craftCommand: CraftCommand = CraftCommand(playerInventoryProxy, content, purchaseConstraintsFactory), updateCommand: UpdateCommand = UpdateCommand(playerInventoryProxy), grantRewardsCommand: GrantRewardsCommand = GrantRewardsCommand(playerInventoryProxy), matchEndCommand: InventoryMatchEndCommand = InventoryMatchEndCommand(pragmaNode, playerInventoryProxy), grantCommand: GrantCommand = GrantCommand(playerInventoryProxy), grantCommandBulk: GrantCommandBulk = GrantCommandBulk(), destroyCommand: DestroyCommand = DestroyCommand(playerInventoryProxy), limitedGrantCommand: LimitedGrantCommand = LimitedGrantCommand(content, playerInventoryProxy), loginDataCommand: LoginDataCommand = LoginDataCommand( content, playerInventoryProxy, stores, limitedGrantCommand ), applyContentCommand: ApplyContentChangesCommand = applyCommandFactory(pragmaNode), updateContentCommand: UpdateContentCommand = UpdateContentCommand(), planContentCommand: PlanContentChangesCommand = PlanContentChangesCommand(), contentVersionCountsCommand: ContentVersionCountsCommand = ContentVersionCountsCommand(), socialPaymentServiceClient: SocialPaymentServiceClient = SocialPaymentServiceClient(pragmaNode), applyInventoryOperationsCommand: ApplyInventoryOperationsCommand = ApplyInventoryOperationsCommand(playerInventoryProxy), itemBundleGrantCommand: ItemBundleGrantCommand = ItemBundleGrantCommand(fulfillment), getContentSourceCommand: GetContentSourceCommand = GetContentSourceCommand(), socialAccountServiceClient: SocialAccountServiceClient = SocialAccountServiceClient(), entitlementsCommand: EntitlementsCommand = EntitlementsCommand(fulfillment), playerInventoryCache: PlayerInventoryCache = PlayerInventoryCache(playerNotifier))

Functions #

NameSummary

applyContentChangesV1

suspend fun applyContentChangesV1(operatorSession: OperatorSession, request: InventoryRpc.ApplyContentChangesV1Request): InventoryRpc.ApplyContentChangesV1Response

Auto-approves new content changes and publish. Development only.

applyInventoryOperationsOperatorV1

suspend fun applyInventoryOperationsOperatorV1(session: OperatorSession, request: InventoryRpc.ApplyInventoryOperationsOperatorV1Request): InventoryRpc.ApplyInventoryOperationsOperatorV1Response

processes collections of inventory data operations: grants, updates, destroy, rewards for stackable and instanced items

applyInventoryOperationsPartnerV1

suspend fun applyInventoryOperationsPartnerV1(partnerSession: PartnerSession, request: InventoryRpc.ApplyInventoryOperationsPartnerV1Request): InventoryRpc.ApplyInventoryOperationsPartnerV1Response

processes collections of inventory data operations: grants, updates, destroy, rewards for stackable and instanced items

applyInventoryOperationsServiceV1

suspend fun applyInventoryOperationsServiceV1(partnerSession: ServiceSession, request: InventoryRpc.ApplyInventoryOperationsServiceV1Request): InventoryRpc.ApplyInventoryOperationsServiceV1Response

processes collections of inventory data operations: grants, updates, destroy, rewards for stackable and instanced items

cancelOrderV1

suspend fun cancelOrderV1(session: PlayerSession, request: InventoryRpc.CancelOrderV1Request): InventoryRpc.CancelOrderV1Response

Cancels an in-progress order that was previously started using the InitializeOrderV1Request.

clearAllInventoryCacheOperatorV1

suspend fun clearAllInventoryCacheOperatorV1(session: OperatorSession, request: InventoryRpc.ClearAllInventoryCacheOperatorV1Request): InventoryRpc.ClearAllInventoryCacheOperatorV1Response

Clears all player inventory out of the instance’s cache.

clearAllInventoryCacheServiceV1

suspend fun clearAllInventoryCacheServiceV1(session: ServiceSession, request: InventoryRpc.ClearAllInventoryCacheServiceV1Request): InventoryRpc.ClearAllInventoryCacheServiceV1Response

Clears all player inventory out of the instance’s cache.

clearPlayerInventoryCacheOperatorV1

suspend fun clearPlayerInventoryCacheOperatorV1(session: OperatorSession, request: InventoryRpc.ClearPlayerInventoryCacheOperatorV1Request): InventoryRpc.ClearPlayerInventoryCacheOperatorV1Response

Clears a player’s inventory out of the instance’s cache.

clearPlayerInventoryCachePartnerV1

suspend fun clearPlayerInventoryCachePartnerV1(session: PartnerSession, request: InventoryRpc.ClearPlayerInventoryCachePartnerV1Request): InventoryRpc.ClearPlayerInventoryCachePartnerV1Response

Clears a player’s inventory out of the instance’s cache.

clearPlayerInventoryCacheServiceV1

suspend fun clearPlayerInventoryCacheServiceV1(session: ServiceSession, request: InventoryRpc.ClearPlayerInventoryCacheServiceV1Request): InventoryRpc.ClearPlayerInventoryCacheServiceV1Response

Clears a player’s inventory out of the in-memory cache.

contentVersionCountsV1

suspend fun contentVersionCountsV1(operatorSession: OperatorSession, request: InventoryRpc.ContentVersionCountsV1Request): InventoryRpc.ContentVersionCountsV1Response

Gets all current content version numbers.

craftV1

suspend fun craftV1(session: PlayerSession, request: InventoryRpc.CraftV1Request): InventoryRpc.CraftV1Response

Performs an arbitrary transform on player inventory.

deleteAllInventoryDbAndCacheV1

suspend fun deleteAllInventoryDbAndCacheV1(session: OperatorSession, request: InventoryRpc.DeleteAllInventoryDbAndCacheV1Request): InventoryRpc.DeleteAllInventoryDbAndCacheV1Response

Permanently deletes all inventory data for all players.

deletePlayerInventoryOperatorV1

suspend fun deletePlayerInventoryOperatorV1(session: OperatorSession, request: InventoryRpc.DeletePlayerInventoryOperatorV1Request): InventoryRpc.DeletePlayerInventoryOperatorV1Response

Deletes a player’s entire inventory.

deletePlayerInventoryPartnerV1

suspend fun deletePlayerInventoryPartnerV1(session: PartnerSession, request: InventoryRpc.DeletePlayerInventoryPartnerV1Request): InventoryRpc.DeletePlayerInventoryPartnerV1Response

Deletes a player’s entire inventory.

deletePlayerInventoryServiceV1

suspend fun deletePlayerInventoryServiceV1(session: ServiceSession, request: InventoryRpc.DeletePlayerInventoryServiceV1Request): InventoryRpc.DeletePlayerInventoryServiceV1Response

Deletes a player’s entire inventory.

deletePlayerInventoryV3

suspend fun deletePlayerInventoryV3(session: PlayerSession, request: InventoryRpc.DeletePlayerInventoryV3Request): InventoryRpc.DeletePlayerInventoryV3Response

Deletes a player’s entire inventory.

destroyItemsOperatorV1

suspend fun destroyItemsOperatorV1(session: OperatorSession, request: InventoryRpc.DestroyItemsOperatorV1Request): InventoryRpc.DestroyItemsOperatorV1Response

Applies a list of InventoryCommon.ItemServerDestroyV1 item destroys for an operator to delete player inventory items.

destroyItemsPartnerV2

suspend fun destroyItemsPartnerV2(session: PartnerSession, request: InventoryRpc.DestroyItemsPartnerV2Request): InventoryRpc.DestroyItemsPartnerV2Response

Applies a list of InventoryCommon.ItemServerDestroyV1 item destroys for a partner to delete player inventory items.

destroyItemsServiceV2

suspend fun destroyItemsServiceV2(session: ServiceSession, request: InventoryRpc.DestroyItemsServiceV2Request): InventoryRpc.DestroyItemsServiceV2Response

Applies a list of InventoryCommon.ItemServerDestroyV1 item destroys to delete player inventory items.

finalizeInProgressOrdersV1

suspend fun finalizeInProgressOrdersV1(session: PlayerSession, request: InventoryRpc.FinalizeInProgressOrdersV1Request): InventoryRpc.FinalizeInProgressOrdersV1Response

Finalizes all in-progress orders that were previously started using the InitializeOrderV1Request, but were not finalized and/or fulfilled.

finalizeOrderV1

suspend fun finalizeOrderV1(session: PlayerSession, request: InventoryRpc.FinalizeOrderV1Request): InventoryRpc.FinalizeOrderV1Response

Finalizes an in-progress order that was previously started using the InitializeOrderV1Request.

getCatalogOperatorV1

suspend fun getCatalogOperatorV1(session: OperatorSession, request: InventoryRpc.GetCatalogOperatorV1Request): InventoryRpc.GetCatalogOperatorV1Response

Retrieves a specific catalog.

getContentSourceOperatorV1

suspend fun getContentSourceOperatorV1(session: OperatorSession, request: InventoryRpc.GetContentSourceOperatorV1Request): InventoryRpc.GetContentSourceOperatorV1Response

Retrieves content of a specific type grouped by source file.

getInventoryOperatorV1

suspend fun getInventoryOperatorV1(session: OperatorSession, request: InventoryRpc.GetInventoryOperatorV1Request): InventoryRpc.GetInventoryOperatorV1Response

Retrieves full inventory for a player.

getInventoryPartnerV2

suspend fun getInventoryPartnerV2(session: PartnerSession, request: InventoryRpc.GetInventoryPartnerV2Request): InventoryRpc.GetInventoryPartnerV2Response

Retrieves full inventory for a player.

getInventoryServiceV3

suspend fun getInventoryServiceV3(session: ServiceSession, request: InventoryRpc.GetInventoryServiceV3Request): InventoryRpc.GetInventoryServiceV3Response

Retrieves inventory for a player. Optionally can filter based on list of tags to include.

getInventoryV2

suspend fun getInventoryV2(session: PlayerSession, request: InventoryRpc.GetInventoryV2Request): InventoryRpc.GetInventoryV2Response

Retrieves full inventory for player.

getLoginDataServiceV2

suspend fun getLoginDataServiceV2(session: ServiceSession, request: InventoryRpc.GetLoginDataServiceV2Request): InventoryRpc.GetLoginDataServiceV2Response

Retrieves content catalogs and will execute any limited grants. Will broadcast an InventoryRpc.InventoryUpdatedV1Notification if player is given any limited grants.

getProviderEntitlementHistoryOperatorV1

suspend fun getProviderEntitlementHistoryOperatorV1(operatorSession: OperatorSession, request: InventoryRpc.GetProviderEntitlementHistoryOperatorV1Request): InventoryRpc.GetProviderEntitlementHistoryOperatorV1Response

Retrieve records of entitlements synced syncEntitlementsV1/syncEntitlementsOperatorV1/syncEntitlementsServiceV1/syncEntitlementsPartnerV1.

getProviderEntitlementHistoryPartnerV1

suspend fun getProviderEntitlementHistoryPartnerV1(partnerSession: PartnerSession, request: InventoryRpc.GetProviderEntitlementHistoryPartnerV1Request): InventoryRpc.GetProviderEntitlementHistoryPartnerV1Response

Retrieve records of entitlements synced syncEntitlementsV1/syncEntitlementsOperatorV1/syncEntitlementsServiceV1/syncEntitlementsPartnerV1.

getRawContentSourceOperatorV1

suspend fun getRawContentSourceOperatorV1(session: OperatorSession, request: InventoryRpc.GetRawContentSourceOperatorV1Request): InventoryRpc.GetRawContentSourceOperatorV1Response

Retrieves content of a specific type grouped by source file.

grantItemsBulkOperatorV1

suspend fun grantItemsBulkOperatorV1(session: OperatorSession, request: InventoryRpc.GrantItemsBulkOperatorV1Request): InventoryRpc.GrantItemsBulkOperatorV1Response

Grants a list of InventoryCommon.ItemServerGrantV1 item grants to a given list of players.

grantItemsOperatorV1

suspend fun grantItemsOperatorV1(session: OperatorSession, request: InventoryRpc.GrantItemsOperatorV1Request): InventoryRpc.GrantItemsOperatorV1Response

Grants a list of InventoryCommon.ItemServerGrantV1 item grants to a player.

grantItemsPartnerV2

suspend fun grantItemsPartnerV2(partnerSession: PartnerSession, request: InventoryRpc.GrantItemsPartnerV2Request): InventoryRpc.GrantItemsPartnerV2Response

Grants a list of InventoryCommon.ItemServerGrantV1 item grants to a player.

grantItemsServiceV2

suspend fun grantItemsServiceV2(session: ServiceSession, request: InventoryRpc.GrantItemsServiceV2Request): InventoryRpc.GrantItemsServiceV2Response

Grants a list of InventoryCommon.ItemServerGrantV1 item grants to a player.

initializeOrderV1

suspend fun initializeOrderV1(session: PlayerSession, request: InventoryRpc.InitializeOrderV1Request): InventoryRpc.InitializeOrderV1Response

Initialize an order for a product entry by its identifier with a given provider.

matchEndV4

suspend fun matchEndV4(session: ServiceSession, request: InventoryRpc.MatchEndV4Request): InventoryRpc.MatchEndV4Response

Processes match end inventory results for a specific player.

operatorGrantRewardsV0

suspend fun operatorGrantRewardsV0(session: OperatorSession, request: InventoryRpc.OperatorGrantRewardsV0Request): InventoryRpc.OperatorGrantRewardsV0Response

Grants a list of InventoryCommon.RewardGrant grants to a player.

planContentChangesOperatorV1

suspend fun planContentChangesOperatorV1(operatorSession: OperatorSession, request: InventoryRpc.PlanContentChangesOperatorV1Request): InventoryRpc.PlanContentChangesOperatorV1Response

Retrieves a summary of new content changes.

serviceGrantRewardsV2

suspend fun serviceGrantRewardsV2(session: ServiceSession, request: InventoryRpc.ServiceGrantRewardsV2Request): InventoryRpc.ServiceGrantRewardsV2Response

Grants a list of InventoryCommon.RewardGrant grants to a player.

simulateRewardsV2

suspend fun simulateRewardsV2(session: PartnerSession, request: InventoryRpc.SimulateRewardsV2Request): InventoryRpc.SimulateRewardsV2Response

Simulates the result of applying a reward grant.

storePurchaseV4

suspend fun storePurchaseV4(session: PlayerSession, request: InventoryRpc.StorePurchaseV4Request): InventoryRpc.StorePurchaseV4Response

Lets players purchase a specified amount of a InventoryContent.StoreEntry items. InventoryContent.StoreEntry defines requirements to check whether a player can purchase the entry before letting the transaction happen.

syncEntitlementsOperatorV1

suspend fun syncEntitlementsOperatorV1(session: OperatorSession, request: InventoryRpc.SyncEntitlementsOperatorV1Request): InventoryRpc.SyncEntitlementsOperatorV1Response

Syncs all available entitlements from all configured Entitlement Provider Plugins except those that currently require an authCode.

syncEntitlementsPartnerV1

suspend fun syncEntitlementsPartnerV1(session: PartnerSession, request: InventoryRpc.SyncEntitlementsPartnerV1Request): InventoryRpc.SyncEntitlementsPartnerV1Response

Syncs all available entitlements from all configured Entitlement Provider Plugins except those that currently require an authCode.

syncEntitlementsServiceV1

suspend fun syncEntitlementsServiceV1(session: ServiceSession, request: InventoryRpc.SyncEntitlementsServiceV1Request): InventoryRpc.SyncEntitlementsServiceV1Response

Syncs all available entitlements from all configured Entitlement Provider Plugins except those that currently require an authCode.

syncEntitlementsV1

suspend fun syncEntitlementsV1(session: PlayerSession, request: InventoryRpc.SyncEntitlementsV1Request): InventoryRpc.SyncEntitlementsV1Response

Syncs all available entitlements from all configured Entitlement Provider Plugins.

updateContentSourceDataV1

suspend fun updateContentSourceDataV1(session: OperatorSession, request: InventoryRpc.UpdateContentSourceDataV1Request): InventoryRpc.UpdateContentSourceDataV1Response

Updates a content source file.

updateItemsOperatorV1

suspend fun updateItemsOperatorV1(session: OperatorSession, request: InventoryRpc.UpdateItemsOperatorV1Request): InventoryRpc.UpdateItemsOperatorV1Response

Lets operators update multiple items for a given player by list of InventoryCommon.ServerItemUpdateV2.

updateItemsPartnerV2

suspend fun updateItemsPartnerV2(session: PartnerSession, request: InventoryRpc.UpdateItemsPartnerV2Request): InventoryRpc.UpdateItemsPartnerV2Response

Lets partners update multiple items for a given player by list of InventoryCommon.ServerItemUpdateV2.

updateItemsV0

suspend fun updateItemsV0(session: PlayerSession, request: InventoryRpc.UpdateItemsV0Request): InventoryRpc.UpdateItemsV0Response

Lets players update multiple items by list of InventoryCommon.ItemUpdateV2.

updateItemV4

suspend fun updateItemV4(session: PlayerSession, request: InventoryRpc.UpdateItemV4Request): InventoryRpc.UpdateItemV4Response

Lets players update an item by InventoryCommon.ItemUpdateV2.

updateRawContentSourceDataServiceV1

suspend fun updateRawContentSourceDataServiceV1(session: ServiceSession, request: InventoryRpc.UpdateRawContentSourceDataServiceV1Request): InventoryRpc.UpdateRawContentSourceDataServiceV1Response

Updates a content source file.

updateRawContentSourceDataV1

suspend fun updateRawContentSourceDataV1(session: OperatorSession, request: InventoryRpc.UpdateRawContentSourceDataV1Request): InventoryRpc.UpdateRawContentSourceDataV1Response

Updates a content source file.