Skip to content

Commit

Permalink
Merge pull request #55 from PlayFab/master
Browse files Browse the repository at this point in the history
Weekly Versioning PR: 160208
  • Loading branch information
zac-playfab committed Feb 8, 2016
2 parents d1d4395 + 7109961 commit dfb378b
Show file tree
Hide file tree
Showing 16 changed files with 445 additions and 52 deletions.
29 changes: 27 additions & 2 deletions PlayFabClientSDK/source/PlayFabClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,32 @@ public static async Task<PlayFabResult<ModifyUserVirtualCurrencyResult>> Subtrac
}

/// <summary>
/// Unlocks a container item in the user's inventory and consumes a key item of the type indicated by the container item
/// Opens the specified container, with the specified key (when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.
/// </summary>
public static async Task<PlayFabResult<UnlockContainerItemResult>> UnlockContainerInstanceAsync(UnlockContainerInstanceRequest request)
{
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

object httpResult = await PlayFabHTTP.DoPost(PlayFabSettings.GetURL() + "/Client/UnlockContainerInstance", request, "X-Authorization", _authKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<UnlockContainerItemResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<UnlockContainerItemResult>>(new JsonTextReader(new StringReader(resultRawJson)));

UnlockContainerItemResult result = resultData.data;

return new PlayFabResult<UnlockContainerItemResult> { Result = result };
}

/// <summary>
/// Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.
/// </summary>
public static async Task<PlayFabResult<UnlockContainerItemResult>> UnlockContainerItemAsync(UnlockContainerItemRequest request)
{
Expand Down Expand Up @@ -2553,7 +2578,7 @@ public static async Task<PlayFabResult<RunCloudScriptResult>> RunCloudScriptAsyn
}

/// <summary>
/// This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://support.playfab.com/support/discussions/topics/1000059929
/// This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service
/// </summary>
public static async Task<PlayFabResult<GetContentDownloadUrlResult>> GetContentDownloadUrlAsync(GetContentDownloadUrlRequest request)
{
Expand Down
37 changes: 33 additions & 4 deletions PlayFabClientSDK/source/PlayFabClientModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ public class GetPlayFabIDsFromSteamIDsRequest
/// <summary>
/// Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers.
/// </summary>
public List<uint> SteamIDs { get; set;}
public List<ulong> SteamIDs { get; set;}


}
Expand Down Expand Up @@ -4462,7 +4462,7 @@ public class SteamPlayFabIdPair
/// <summary>
/// Unique Steam identifier for a user.
/// </summary>
public uint SteamId { get; set;}
public ulong SteamId { get; set;}

/// <summary>
/// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier.
Expand Down Expand Up @@ -4881,17 +4881,46 @@ public class UnlinkXboxAccountResult



public class UnlockContainerInstanceRequest
{


/// <summary>
/// Unique PlayFab assigned ID for a specific character owned by a user
/// </summary>
public string CharacterId { get; set;}

/// <summary>
/// ItemInstanceId of the container to unlock.
/// </summary>
public string ContainerItemInstanceId { get; set;}

/// <summary>
/// ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this parameter is required.
/// </summary>
public string KeyItemInstanceId { get; set;}

/// <summary>
/// Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog associated with the item instance.
/// </summary>
public string CatalogVersion { get; set;}


}



public class UnlockContainerItemRequest
{


/// <summary>
/// Category ItemId of the container type to unlock.
/// Catalog ItemId of the container type to unlock.
/// </summary>
public string ContainerItemId { get; set;}

/// <summary>
/// Catalog version of the container.
/// Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary catalog.
/// </summary>
public string CatalogVersion { get; set;}

Expand Down
3 changes: 2 additions & 1 deletion PlayFabClientSDK/source/PlayFabErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ public enum PlayFabErrorCode
InvalidDropTable = 1201,
StatisticVersionAlreadyIncrementedForScheduledInterval = 1202,
StatisticCountLimitExceeded = 1203,
StatisticVersionIncrementRateExceeded = 1204
StatisticVersionIncrementRateExceeded = 1204,
ContainerKeyInvalid = 1205
}

public class PlayFabError
Expand Down
2 changes: 1 addition & 1 deletion PlayFabClientSDK/source/PlayFabVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace PlayFab.Internal
{
public class PlayFabVersion
{
public static string SdkRevision = "0.16.160201";
public static string SdkRevision = "0.17.160208";

public static string getVersionString()
{
Expand Down
31 changes: 15 additions & 16 deletions PlayFabSDK/source/PlayFabAdminModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,13 @@ public class CreatePlayerStatisticDefinitionRequest
/// <summary>
/// unique name of the statistic
/// </summary>
public string Name { get; set;}
public string StatisticName { get; set;}

/// <summary>
/// interval at which the values of the statistic for all players are reset. Resets begin at the next interval boundary
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public Interval? VersionChangeInterval { get; set;}
public StatisticResetIntervalOption? VersionChangeInterval { get; set;}


}
Expand Down Expand Up @@ -1592,18 +1592,6 @@ public class IncrementPlayerStatisticVersionResult



public enum Interval
{
FiveMinutes,
FifteenMinutes,
Hour,
Day,
Week,
Month
}



public class ItemGrant
{

Expand Down Expand Up @@ -2004,7 +1992,7 @@ public class PlayerStatisticDefinition
/// interval at which the values of the statistic for all players are reset
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public Interval? VersionChangeInterval { get; set;}
public StatisticResetIntervalOption? VersionChangeInterval { get; set;}


}
Expand Down Expand Up @@ -2517,6 +2505,17 @@ public class SetupPushNotificationResult



public enum StatisticResetIntervalOption
{
Never,
Hour,
Day,
Week,
Month
}



public enum StatisticVersionArchivalStatus
{
NotScheduled,
Expand Down Expand Up @@ -2676,7 +2675,7 @@ public class UpdatePlayerStatisticDefinitionRequest
/// interval at which the values of the statistic for all players are reset. Changes are effective at the next interval boundary
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public Interval? VersionChangeInterval { get; set;}
public StatisticResetIntervalOption? VersionChangeInterval { get; set;}


}
Expand Down
29 changes: 27 additions & 2 deletions PlayFabSDK/source/PlayFabClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,32 @@ public static async Task<PlayFabResult<ModifyUserVirtualCurrencyResult>> Subtrac
}

/// <summary>
/// Unlocks a container item in the user's inventory and consumes a key item of the type indicated by the container item
/// Opens the specified container, with the specified key (when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.
/// </summary>
public static async Task<PlayFabResult<UnlockContainerItemResult>> UnlockContainerInstanceAsync(UnlockContainerInstanceRequest request)
{
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

object httpResult = await PlayFabHTTP.DoPost(PlayFabSettings.GetURL() + "/Client/UnlockContainerInstance", request, "X-Authorization", _authKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<UnlockContainerItemResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<UnlockContainerItemResult>>(new JsonTextReader(new StringReader(resultRawJson)));

UnlockContainerItemResult result = resultData.data;

return new PlayFabResult<UnlockContainerItemResult> { Result = result };
}

/// <summary>
/// Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.
/// </summary>
public static async Task<PlayFabResult<UnlockContainerItemResult>> UnlockContainerItemAsync(UnlockContainerItemRequest request)
{
Expand Down Expand Up @@ -2553,7 +2578,7 @@ public static async Task<PlayFabResult<RunCloudScriptResult>> RunCloudScriptAsyn
}

/// <summary>
/// This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://support.playfab.com/support/discussions/topics/1000059929
/// This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service
/// </summary>
public static async Task<PlayFabResult<GetContentDownloadUrlResult>> GetContentDownloadUrlAsync(GetContentDownloadUrlRequest request)
{
Expand Down
37 changes: 33 additions & 4 deletions PlayFabSDK/source/PlayFabClientModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ public class GetPlayFabIDsFromSteamIDsRequest
/// <summary>
/// Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers.
/// </summary>
public List<uint> SteamIDs { get; set;}
public List<ulong> SteamIDs { get; set;}


}
Expand Down Expand Up @@ -4462,7 +4462,7 @@ public class SteamPlayFabIdPair
/// <summary>
/// Unique Steam identifier for a user.
/// </summary>
public uint SteamId { get; set;}
public ulong SteamId { get; set;}

/// <summary>
/// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier.
Expand Down Expand Up @@ -4881,17 +4881,46 @@ public class UnlinkXboxAccountResult



public class UnlockContainerInstanceRequest
{


/// <summary>
/// Unique PlayFab assigned ID for a specific character owned by a user
/// </summary>
public string CharacterId { get; set;}

/// <summary>
/// ItemInstanceId of the container to unlock.
/// </summary>
public string ContainerItemInstanceId { get; set;}

/// <summary>
/// ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this parameter is required.
/// </summary>
public string KeyItemInstanceId { get; set;}

/// <summary>
/// Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog associated with the item instance.
/// </summary>
public string CatalogVersion { get; set;}


}



public class UnlockContainerItemRequest
{


/// <summary>
/// Category ItemId of the container type to unlock.
/// Catalog ItemId of the container type to unlock.
/// </summary>
public string ContainerItemId { get; set;}

/// <summary>
/// Catalog version of the container.
/// Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary catalog.
/// </summary>
public string CatalogVersion { get; set;}

Expand Down
3 changes: 2 additions & 1 deletion PlayFabSDK/source/PlayFabErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ public enum PlayFabErrorCode
InvalidDropTable = 1201,
StatisticVersionAlreadyIncrementedForScheduledInterval = 1202,
StatisticCountLimitExceeded = 1203,
StatisticVersionIncrementRateExceeded = 1204
StatisticVersionIncrementRateExceeded = 1204,
ContainerKeyInvalid = 1205
}

public class PlayFabError
Expand Down
52 changes: 51 additions & 1 deletion PlayFabSDK/source/PlayFabServerAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,56 @@ public static async Task<PlayFabResult<ModifyUserVirtualCurrencyResult>> Subtrac
return new PlayFabResult<ModifyUserVirtualCurrencyResult> { Result = result };
}

/// <summary>
/// Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.
/// </summary>
public static async Task<PlayFabResult<UnlockContainerItemResult>> UnlockContainerInstanceAsync(UnlockContainerInstanceRequest request)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

object httpResult = await PlayFabHTTP.DoPost(PlayFabSettings.GetURL() + "/Server/UnlockContainerInstance", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<UnlockContainerItemResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<UnlockContainerItemResult>>(new JsonTextReader(new StringReader(resultRawJson)));

UnlockContainerItemResult result = resultData.data;

return new PlayFabResult<UnlockContainerItemResult> { Result = result };
}

/// <summary>
/// Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.
/// </summary>
public static async Task<PlayFabResult<UnlockContainerItemResult>> UnlockContainerItemAsync(UnlockContainerItemRequest request)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

object httpResult = await PlayFabHTTP.DoPost(PlayFabSettings.GetURL() + "/Server/UnlockContainerItem", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<UnlockContainerItemResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<UnlockContainerItemResult>>(new JsonTextReader(new StringReader(resultRawJson)));

UnlockContainerItemResult result = resultData.data;

return new PlayFabResult<UnlockContainerItemResult> { Result = result };
}

/// <summary>
/// Updates the key-value pair data tagged to the specified item, which is read-only from the client.
/// </summary>
Expand Down Expand Up @@ -1439,7 +1489,7 @@ public static async Task<PlayFabResult<UpdateSharedGroupDataResult>> UpdateShare
}

/// <summary>
/// This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://support.playfab.com/support/discussions/topics/1000059929
/// This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service
/// </summary>
public static async Task<PlayFabResult<GetContentDownloadUrlResult>> GetContentDownloadUrlAsync(GetContentDownloadUrlRequest request)
{
Expand Down
Loading

0 comments on commit dfb378b

Please sign in to comment.