Example #1
0
 public static void OpenTrade(params string[] offeredInventoryInstanceIds)
 {
     var openRequest = new ClientModels.OpenTradeRequest();
     // Optional field: null is anybody, alternately if specified, this is a targeted trade request
     //   In this example, we restrict the trade to ourselves (because I don't have multiple clients for this example)
     //   A normal trade process would use all the same steps, but would interact between multliple clients
     openRequest.AllowedPlayerIds = new List<string>() { PfSharedModelEx.globalClientUser.playFabId };
     // Offering the items you have
     openRequest.OfferedInventoryInstanceIds = new List<string>();
     openRequest.OfferedInventoryInstanceIds.AddRange(offeredInventoryInstanceIds);
     // Listing the items you want
     openRequest.RequestedCatalogItemIds = new List<string>() { PfSharedModelEx.swillItemId };
     PlayFabClientAPI.OpenTrade(openRequest, OpenTradeCallback, PfSharedControllerEx.FailCallback("OpenTrade"));
 }
Example #2
0
        public static void OpenTrade(params string[] offeredInventoryInstanceIds)
        {
            var openRequest = new ClientModels.OpenTradeRequest();

            // Optional field: null is anybody, alternately if specified, this is a targeted trade request
            //   In this example, we restrict the trade to ourselves (because I don't have multiple clients for this example)
            //   A normal trade process would use all the same steps, but would interact between multliple clients
            openRequest.AllowedPlayerIds = new List <string>()
            {
                PfSharedModelEx.globalClientUser.playFabId
            };
            // Offering the items you have
            openRequest.OfferedInventoryInstanceIds = new List <string>();
            openRequest.OfferedInventoryInstanceIds.AddRange(offeredInventoryInstanceIds);
            // Listing the items you want
            openRequest.RequestedCatalogItemIds = new List <string>()
            {
                PfSharedModelEx.swillItemId
            };
            PlayFabClientAPI.OpenTrade(openRequest, OpenTradeCallback, PfSharedControllerEx.FailCallback("OpenTrade"));
        }