Exemplo n.º 1
0
        public async Task RevokeInventoryItems(string playFabId, List <ItemInstance> inventory)
        {
            var items = new List <RevokeInventoryItem> {
            };

            foreach (var item in inventory)
            {
                items.Add(new RevokeInventoryItem
                {
                    PlayFabId      = playFabId,
                    ItemInstanceId = item.ItemInstanceId
                });
            }

            var reqGetInventory = new RevokeInventoryItemsRequest
            {
                Items = items
            };

            var result = await PlayFabAdminAPI.RevokeInventoryItemsAsync(reqGetInventory);

            if (result.Error != null)
            {
                Console.WriteLine(result.Error.ErrorMessage);
            }
        }