diff --git a/PlayFabClientSDK/source/PlayFabClientModels.cs b/PlayFabClientSDK/source/PlayFabClientModels.cs index 037cae0f..ea80cec1 100644 --- a/PlayFabClientSDK/source/PlayFabClientModels.cs +++ b/PlayFabClientSDK/source/PlayFabClientModels.cs @@ -144,6 +144,11 @@ public class AndroidDevicePushNotificationRegistrationRequest /// public string ConfirmationMessege { get; set;} + /// + /// Message to display when confirming push notification. + /// + public string ConfirmationMessage { get; set;} + } public class AndroidDevicePushNotificationRegistrationResult : PlayFabResultCommon @@ -765,7 +770,7 @@ public class ExecuteCloudScriptRequest public object FunctionParameter { get; set;} /// - /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. + /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. The default value is 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. /// [JsonConverter(typeof(StringEnumConverter))] public CloudScriptRevisionOption? RevisionSelection { get; set;} diff --git a/PlayFabClientSDK/source/PlayFabErrors.cs b/PlayFabClientSDK/source/PlayFabErrors.cs index bf9c5410..ea4504fa 100644 --- a/PlayFabClientSDK/source/PlayFabErrors.cs +++ b/PlayFabClientSDK/source/PlayFabErrors.cs @@ -220,7 +220,8 @@ public enum PlayFabErrorCode EventNotFound = 1215, InvalidEventField = 1216, InvalidEventName = 1217, - CatalogNotConfigured = 1218 + CatalogNotConfigured = 1218, + OperationNotSupportedForPlatform = 1219 } public class PlayFabError diff --git a/PlayFabClientSDK/source/PlayFabSettings.cs b/PlayFabClientSDK/source/PlayFabSettings.cs index 422abb19..d0765f7c 100644 --- a/PlayFabClientSDK/source/PlayFabSettings.cs +++ b/PlayFabClientSDK/source/PlayFabSettings.cs @@ -12,8 +12,8 @@ public class PlayFabSettings }; public static Formatting JsonFormatting = Formatting.None; - public static string SdkVersion = "0.23.160414"; - public static string SdkVersionString = "CSharpSDK-0.23.160414"; + public static string SdkVersion = "0.24.160425"; + public static string SdkVersionString = "CSharpSDK-0.24.160425"; public static bool UseDevelopmentEnvironment = false; public static string DevelopmentEnvironmentUrl = ".playfabsandbox.com"; diff --git a/PlayFabSDK/source/PlayFabAdminAPI.cs b/PlayFabSDK/source/PlayFabAdminAPI.cs index 7c159cf8..f101f46d 100644 --- a/PlayFabSDK/source/PlayFabAdminAPI.cs +++ b/PlayFabSDK/source/PlayFabAdminAPI.cs @@ -114,7 +114,7 @@ public static async Task> Update } /// - /// Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval. + /// Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval and an aggregation method. /// public static async Task> CreatePlayerStatisticDefinitionAsync(CreatePlayerStatisticDefinitionRequest request) { diff --git a/PlayFabSDK/source/PlayFabClientModels.cs b/PlayFabSDK/source/PlayFabClientModels.cs index 037cae0f..ea80cec1 100644 --- a/PlayFabSDK/source/PlayFabClientModels.cs +++ b/PlayFabSDK/source/PlayFabClientModels.cs @@ -144,6 +144,11 @@ public class AndroidDevicePushNotificationRegistrationRequest /// public string ConfirmationMessege { get; set;} + /// + /// Message to display when confirming push notification. + /// + public string ConfirmationMessage { get; set;} + } public class AndroidDevicePushNotificationRegistrationResult : PlayFabResultCommon @@ -765,7 +770,7 @@ public class ExecuteCloudScriptRequest public object FunctionParameter { get; set;} /// - /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. + /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. The default value is 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. /// [JsonConverter(typeof(StringEnumConverter))] public CloudScriptRevisionOption? RevisionSelection { get; set;} diff --git a/PlayFabSDK/source/PlayFabErrors.cs b/PlayFabSDK/source/PlayFabErrors.cs index bf9c5410..ea4504fa 100644 --- a/PlayFabSDK/source/PlayFabErrors.cs +++ b/PlayFabSDK/source/PlayFabErrors.cs @@ -220,7 +220,8 @@ public enum PlayFabErrorCode EventNotFound = 1215, InvalidEventField = 1216, InvalidEventName = 1217, - CatalogNotConfigured = 1218 + CatalogNotConfigured = 1218, + OperationNotSupportedForPlatform = 1219 } public class PlayFabError diff --git a/PlayFabSDK/source/PlayFabServerAPI.cs b/PlayFabSDK/source/PlayFabServerAPI.cs index 5edd6fd9..e03f21e5 100644 --- a/PlayFabSDK/source/PlayFabServerAPI.cs +++ b/PlayFabSDK/source/PlayFabServerAPI.cs @@ -913,6 +913,31 @@ public static async Task> ConsumeItemAsync(Cons return new PlayFabResult { Result = result }; } + /// + /// Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. + /// + public static async Task> EvaluateRandomResultTableAsync(EvaluateRandomResultTableRequest request) + { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + object httpResult = await PlayFabHTTP.DoPost("/Server/EvaluateRandomResultTable", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + if(httpResult is PlayFabError) + { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler(error); + return new PlayFabResult { Error = error, }; + } + string resultRawJson = (string)httpResult; + + var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings); + var resultData = serializer.Deserialize>(new JsonTextReader(new StringReader(resultRawJson))); + + EvaluateRandomResultTableResult result = resultData.data; + + return new PlayFabResult { Result = result }; + } + /// /// Retrieves the specified character's current inventory of virtual goods /// diff --git a/PlayFabSDK/source/PlayFabServerModels.cs b/PlayFabSDK/source/PlayFabServerModels.cs index f03c49f5..18f7d483 100644 --- a/PlayFabSDK/source/PlayFabServerModels.cs +++ b/PlayFabSDK/source/PlayFabServerModels.cs @@ -627,6 +627,29 @@ public class EmptyResult : PlayFabResultCommon { } + public class EvaluateRandomResultTableRequest : PlayFabResultCommon + { + /// + /// The unique identifier of the Random Result Table to use. + /// + public string TableId { get; set;} + + /// + /// Specifies the catalog version that should be used to evaluate the Random Result Table. If unspecified, uses default/primary catalog. + /// + public string CatalogVersion { get; set;} + + } + + public class EvaluateRandomResultTableResult : PlayFabResultCommon + { + /// + /// Unique identifier for the item returned from the Random Result Table evaluation, for the given catalog. + /// + public string ResultItemId { get; set;} + + } + public class ExecuteCloudScriptResult : PlayFabResultCommon { /// @@ -688,7 +711,7 @@ public class ExecuteCloudScriptServerRequest public object FunctionParameter { get; set;} /// - /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. + /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. The default value is 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. /// [JsonConverter(typeof(StringEnumConverter))] public CloudScriptRevisionOption? RevisionSelection { get; set;} diff --git a/PlayFabSDK/source/PlayFabSettings.cs b/PlayFabSDK/source/PlayFabSettings.cs index 122cf913..57ac2cd2 100644 --- a/PlayFabSDK/source/PlayFabSettings.cs +++ b/PlayFabSDK/source/PlayFabSettings.cs @@ -12,8 +12,8 @@ public class PlayFabSettings }; public static Formatting JsonFormatting = Formatting.None; - public static string SdkVersion = "0.23.160414"; - public static string SdkVersionString = "CSharpSDK-0.23.160414"; + public static string SdkVersion = "0.24.160425"; + public static string SdkVersionString = "CSharpSDK-0.24.160425"; public static bool UseDevelopmentEnvironment = false; public static string DevelopmentEnvironmentUrl = ".playfabsandbox.com"; diff --git a/PlayFabServerSDK/source/PlayFabAdminAPI.cs b/PlayFabServerSDK/source/PlayFabAdminAPI.cs index 7c159cf8..f101f46d 100644 --- a/PlayFabServerSDK/source/PlayFabAdminAPI.cs +++ b/PlayFabServerSDK/source/PlayFabAdminAPI.cs @@ -114,7 +114,7 @@ public static async Task> Update } /// - /// Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval. + /// Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval and an aggregation method. /// public static async Task> CreatePlayerStatisticDefinitionAsync(CreatePlayerStatisticDefinitionRequest request) { diff --git a/PlayFabServerSDK/source/PlayFabErrors.cs b/PlayFabServerSDK/source/PlayFabErrors.cs index bf9c5410..ea4504fa 100644 --- a/PlayFabServerSDK/source/PlayFabErrors.cs +++ b/PlayFabServerSDK/source/PlayFabErrors.cs @@ -220,7 +220,8 @@ public enum PlayFabErrorCode EventNotFound = 1215, InvalidEventField = 1216, InvalidEventName = 1217, - CatalogNotConfigured = 1218 + CatalogNotConfigured = 1218, + OperationNotSupportedForPlatform = 1219 } public class PlayFabError diff --git a/PlayFabServerSDK/source/PlayFabServerAPI.cs b/PlayFabServerSDK/source/PlayFabServerAPI.cs index 5edd6fd9..e03f21e5 100644 --- a/PlayFabServerSDK/source/PlayFabServerAPI.cs +++ b/PlayFabServerSDK/source/PlayFabServerAPI.cs @@ -913,6 +913,31 @@ public static async Task> ConsumeItemAsync(Cons return new PlayFabResult { Result = result }; } + /// + /// Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. + /// + public static async Task> EvaluateRandomResultTableAsync(EvaluateRandomResultTableRequest request) + { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + object httpResult = await PlayFabHTTP.DoPost("/Server/EvaluateRandomResultTable", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + if(httpResult is PlayFabError) + { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler(error); + return new PlayFabResult { Error = error, }; + } + string resultRawJson = (string)httpResult; + + var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings); + var resultData = serializer.Deserialize>(new JsonTextReader(new StringReader(resultRawJson))); + + EvaluateRandomResultTableResult result = resultData.data; + + return new PlayFabResult { Result = result }; + } + /// /// Retrieves the specified character's current inventory of virtual goods /// diff --git a/PlayFabServerSDK/source/PlayFabServerModels.cs b/PlayFabServerSDK/source/PlayFabServerModels.cs index f03c49f5..18f7d483 100644 --- a/PlayFabServerSDK/source/PlayFabServerModels.cs +++ b/PlayFabServerSDK/source/PlayFabServerModels.cs @@ -627,6 +627,29 @@ public class EmptyResult : PlayFabResultCommon { } + public class EvaluateRandomResultTableRequest : PlayFabResultCommon + { + /// + /// The unique identifier of the Random Result Table to use. + /// + public string TableId { get; set;} + + /// + /// Specifies the catalog version that should be used to evaluate the Random Result Table. If unspecified, uses default/primary catalog. + /// + public string CatalogVersion { get; set;} + + } + + public class EvaluateRandomResultTableResult : PlayFabResultCommon + { + /// + /// Unique identifier for the item returned from the Random Result Table evaluation, for the given catalog. + /// + public string ResultItemId { get; set;} + + } + public class ExecuteCloudScriptResult : PlayFabResultCommon { /// @@ -688,7 +711,7 @@ public class ExecuteCloudScriptServerRequest public object FunctionParameter { get; set;} /// - /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. + /// Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. The default value is 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. /// [JsonConverter(typeof(StringEnumConverter))] public CloudScriptRevisionOption? RevisionSelection { get; set;} diff --git a/PlayFabServerSDK/source/PlayFabSettings.cs b/PlayFabServerSDK/source/PlayFabSettings.cs index d3e64803..6725daa4 100644 --- a/PlayFabServerSDK/source/PlayFabSettings.cs +++ b/PlayFabServerSDK/source/PlayFabSettings.cs @@ -12,8 +12,8 @@ public class PlayFabSettings }; public static Formatting JsonFormatting = Formatting.None; - public static string SdkVersion = "0.23.160414"; - public static string SdkVersionString = "CSharpSDK-0.23.160414"; + public static string SdkVersion = "0.24.160425"; + public static string SdkVersionString = "CSharpSDK-0.24.160425"; public static bool UseDevelopmentEnvironment = false; public static string DevelopmentEnvironmentUrl = ".playfabsandbox.com";