From 6873aa474f9d501f2a782760755205b10d849972 Mon Sep 17 00:00:00 2001 From: Paul Gilmore Date: Mon, 25 Apr 2016 10:32:33 -0700 Subject: [PATCH 1/3] https://api.playfab.com/releaseNotes#160425 (#69) * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins --- .../source/PlayFabClientModels.cs | 7 +++++- PlayFabClientSDK/source/PlayFabErrors.cs | 3 ++- PlayFabClientSDK/source/PlayFabSettings.cs | 4 +-- PlayFabSDK/source/PlayFabAdminAPI.cs | 2 +- PlayFabSDK/source/PlayFabClientModels.cs | 7 +++++- PlayFabSDK/source/PlayFabErrors.cs | 3 ++- PlayFabSDK/source/PlayFabServerAPI.cs | 25 +++++++++++++++++++ PlayFabSDK/source/PlayFabServerModels.cs | 25 ++++++++++++++++++- PlayFabSDK/source/PlayFabSettings.cs | 4 +-- PlayFabServerSDK/source/PlayFabAdminAPI.cs | 2 +- PlayFabServerSDK/source/PlayFabErrors.cs | 3 ++- PlayFabServerSDK/source/PlayFabServerAPI.cs | 25 +++++++++++++++++++ .../source/PlayFabServerModels.cs | 25 ++++++++++++++++++- PlayFabServerSDK/source/PlayFabSettings.cs | 4 +-- 14 files changed, 124 insertions(+), 15 deletions(-) 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"; From 9423c9ff00d71f2245a8e3e8dc79fa4275f1a942 Mon Sep 17 00:00:00 2001 From: Paul Gilmore Date: Mon, 2 May 2016 10:31:40 -0700 Subject: [PATCH 2/3] https://api.playfab.com/releaseNotes#160502 (#71) * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins * Automated build from Jenkins --- .../source/PlayFabClientModels.cs | 10 ----- PlayFabClientSDK/source/PlayFabErrors.cs | 4 +- PlayFabClientSDK/source/PlayFabSettings.cs | 4 +- PlayFabSDK/source/PlayFabAdminAPI.cs | 25 +++++++++++++ PlayFabSDK/source/PlayFabAdminModels.cs | 37 +++++++++++++++++++ PlayFabSDK/source/PlayFabClientModels.cs | 10 ----- PlayFabSDK/source/PlayFabErrors.cs | 4 +- PlayFabSDK/source/PlayFabSettings.cs | 4 +- PlayFabServerSDK/source/PlayFabAdminAPI.cs | 25 +++++++++++++ PlayFabServerSDK/source/PlayFabAdminModels.cs | 37 +++++++++++++++++++ PlayFabServerSDK/source/PlayFabErrors.cs | 4 +- PlayFabServerSDK/source/PlayFabSettings.cs | 4 +- 12 files changed, 139 insertions(+), 29 deletions(-) diff --git a/PlayFabClientSDK/source/PlayFabClientModels.cs b/PlayFabClientSDK/source/PlayFabClientModels.cs index ea80cec1..9c3ac368 100644 --- a/PlayFabClientSDK/source/PlayFabClientModels.cs +++ b/PlayFabClientSDK/source/PlayFabClientModels.cs @@ -139,11 +139,6 @@ public class AndroidDevicePushNotificationRegistrationRequest /// public bool? SendPushNotificationConfirmation { get; set;} - /// - /// Message to display when confirming push notification. - /// - public string ConfirmationMessege { get; set;} - /// /// Message to display when confirming push notification. /// @@ -2225,11 +2220,6 @@ public class LinkFacebookAccountRequest /// public string AccessToken { get; set;} - /// - /// If another user is already linked to the account, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } public class LinkFacebookAccountResult : PlayFabResultCommon diff --git a/PlayFabClientSDK/source/PlayFabErrors.cs b/PlayFabClientSDK/source/PlayFabErrors.cs index ea4504fa..764e8d3c 100644 --- a/PlayFabClientSDK/source/PlayFabErrors.cs +++ b/PlayFabClientSDK/source/PlayFabErrors.cs @@ -221,7 +221,9 @@ public enum PlayFabErrorCode InvalidEventField = 1216, InvalidEventName = 1217, CatalogNotConfigured = 1218, - OperationNotSupportedForPlatform = 1219 + OperationNotSupportedForPlatform = 1219, + SegmentNotFound = 1220, + StoreNotFound = 1221 } public class PlayFabError diff --git a/PlayFabClientSDK/source/PlayFabSettings.cs b/PlayFabClientSDK/source/PlayFabSettings.cs index d0765f7c..1be674c8 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.24.160425"; - public static string SdkVersionString = "CSharpSDK-0.24.160425"; + public static string SdkVersion = "0.25.160502"; + public static string SdkVersionString = "CSharpSDK-0.25.160502"; public static bool UseDevelopmentEnvironment = false; public static string DevelopmentEnvironmentUrl = ".playfabsandbox.com"; diff --git a/PlayFabSDK/source/PlayFabAdminAPI.cs b/PlayFabSDK/source/PlayFabAdminAPI.cs index f101f46d..904bcef4 100644 --- a/PlayFabSDK/source/PlayFabAdminAPI.cs +++ b/PlayFabSDK/source/PlayFabAdminAPI.cs @@ -863,6 +863,31 @@ public static async Task> SetStoreItemsAsy return new PlayFabResult { Result = result }; } + /// + /// Sets up a store to be used in an AB test using segments + /// + public static async Task> SetStoreSegmentOverridesAsync(SetStoreSegmentOverridesRequest request) + { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + object httpResult = await PlayFabHTTP.DoPost("/Admin/SetStoreSegmentOverrides", 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))); + + SetStoreSegemntOverridesResult result = resultData.data; + + return new PlayFabResult { Result = result }; + } + /// /// Creates and updates the key-value store of custom title settings /// diff --git a/PlayFabSDK/source/PlayFabAdminModels.cs b/PlayFabSDK/source/PlayFabAdminModels.cs index f5e56a7c..759b3627 100644 --- a/PlayFabSDK/source/PlayFabAdminModels.cs +++ b/PlayFabSDK/source/PlayFabAdminModels.cs @@ -1870,6 +1870,29 @@ public class SetPublisherDataResult : PlayFabResultCommon { } + public class SetStoreSegemntOverridesResult : PlayFabResultCommon + { + } + + public class SetStoreSegmentOverridesRequest + { + /// + /// Catalog version to use for the request. Defaults to most recent catalog if null. + /// + public string CatalogVersion { get; set;} + + /// + /// The id of the store being overridden. Requests from the client api to store will return the store associated with the override + /// + public string BaseStoreId { get; set;} + + /// + /// The list of overrides in order of evaluation. + /// + public List Overrides { get; set;} + + } + public class SetTitleDataRequest { /// @@ -1981,6 +2004,20 @@ public int CompareTo(StoreItem other) } + public class StoreSegmentNamePair + { + /// + /// The id of the store being referenced + /// + public string StoreId { get; set;} + + /// + /// The name of the segment being referenced + /// + public string SegmentName { get; set;} + + } + public class SubtractUserVirtualCurrencyRequest { /// diff --git a/PlayFabSDK/source/PlayFabClientModels.cs b/PlayFabSDK/source/PlayFabClientModels.cs index ea80cec1..9c3ac368 100644 --- a/PlayFabSDK/source/PlayFabClientModels.cs +++ b/PlayFabSDK/source/PlayFabClientModels.cs @@ -139,11 +139,6 @@ public class AndroidDevicePushNotificationRegistrationRequest /// public bool? SendPushNotificationConfirmation { get; set;} - /// - /// Message to display when confirming push notification. - /// - public string ConfirmationMessege { get; set;} - /// /// Message to display when confirming push notification. /// @@ -2225,11 +2220,6 @@ public class LinkFacebookAccountRequest /// public string AccessToken { get; set;} - /// - /// If another user is already linked to the account, unlink the other user and re-link. - /// - public bool? ForceLink { get; set;} - } public class LinkFacebookAccountResult : PlayFabResultCommon diff --git a/PlayFabSDK/source/PlayFabErrors.cs b/PlayFabSDK/source/PlayFabErrors.cs index ea4504fa..764e8d3c 100644 --- a/PlayFabSDK/source/PlayFabErrors.cs +++ b/PlayFabSDK/source/PlayFabErrors.cs @@ -221,7 +221,9 @@ public enum PlayFabErrorCode InvalidEventField = 1216, InvalidEventName = 1217, CatalogNotConfigured = 1218, - OperationNotSupportedForPlatform = 1219 + OperationNotSupportedForPlatform = 1219, + SegmentNotFound = 1220, + StoreNotFound = 1221 } public class PlayFabError diff --git a/PlayFabSDK/source/PlayFabSettings.cs b/PlayFabSDK/source/PlayFabSettings.cs index 57ac2cd2..96cbe713 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.24.160425"; - public static string SdkVersionString = "CSharpSDK-0.24.160425"; + public static string SdkVersion = "0.25.160502"; + public static string SdkVersionString = "CSharpSDK-0.25.160502"; public static bool UseDevelopmentEnvironment = false; public static string DevelopmentEnvironmentUrl = ".playfabsandbox.com"; diff --git a/PlayFabServerSDK/source/PlayFabAdminAPI.cs b/PlayFabServerSDK/source/PlayFabAdminAPI.cs index f101f46d..904bcef4 100644 --- a/PlayFabServerSDK/source/PlayFabAdminAPI.cs +++ b/PlayFabServerSDK/source/PlayFabAdminAPI.cs @@ -863,6 +863,31 @@ public static async Task> SetStoreItemsAsy return new PlayFabResult { Result = result }; } + /// + /// Sets up a store to be used in an AB test using segments + /// + public static async Task> SetStoreSegmentOverridesAsync(SetStoreSegmentOverridesRequest request) + { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + object httpResult = await PlayFabHTTP.DoPost("/Admin/SetStoreSegmentOverrides", 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))); + + SetStoreSegemntOverridesResult result = resultData.data; + + return new PlayFabResult { Result = result }; + } + /// /// Creates and updates the key-value store of custom title settings /// diff --git a/PlayFabServerSDK/source/PlayFabAdminModels.cs b/PlayFabServerSDK/source/PlayFabAdminModels.cs index f5e56a7c..759b3627 100644 --- a/PlayFabServerSDK/source/PlayFabAdminModels.cs +++ b/PlayFabServerSDK/source/PlayFabAdminModels.cs @@ -1870,6 +1870,29 @@ public class SetPublisherDataResult : PlayFabResultCommon { } + public class SetStoreSegemntOverridesResult : PlayFabResultCommon + { + } + + public class SetStoreSegmentOverridesRequest + { + /// + /// Catalog version to use for the request. Defaults to most recent catalog if null. + /// + public string CatalogVersion { get; set;} + + /// + /// The id of the store being overridden. Requests from the client api to store will return the store associated with the override + /// + public string BaseStoreId { get; set;} + + /// + /// The list of overrides in order of evaluation. + /// + public List Overrides { get; set;} + + } + public class SetTitleDataRequest { /// @@ -1981,6 +2004,20 @@ public int CompareTo(StoreItem other) } + public class StoreSegmentNamePair + { + /// + /// The id of the store being referenced + /// + public string StoreId { get; set;} + + /// + /// The name of the segment being referenced + /// + public string SegmentName { get; set;} + + } + public class SubtractUserVirtualCurrencyRequest { /// diff --git a/PlayFabServerSDK/source/PlayFabErrors.cs b/PlayFabServerSDK/source/PlayFabErrors.cs index ea4504fa..764e8d3c 100644 --- a/PlayFabServerSDK/source/PlayFabErrors.cs +++ b/PlayFabServerSDK/source/PlayFabErrors.cs @@ -221,7 +221,9 @@ public enum PlayFabErrorCode InvalidEventField = 1216, InvalidEventName = 1217, CatalogNotConfigured = 1218, - OperationNotSupportedForPlatform = 1219 + OperationNotSupportedForPlatform = 1219, + SegmentNotFound = 1220, + StoreNotFound = 1221 } public class PlayFabError diff --git a/PlayFabServerSDK/source/PlayFabSettings.cs b/PlayFabServerSDK/source/PlayFabSettings.cs index 6725daa4..17e4a32d 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.24.160425"; - public static string SdkVersionString = "CSharpSDK-0.24.160425"; + public static string SdkVersion = "0.25.160502"; + public static string SdkVersionString = "CSharpSDK-0.25.160502"; public static bool UseDevelopmentEnvironment = false; public static string DevelopmentEnvironmentUrl = ".playfabsandbox.com"; From 32cc47f4db45055a30646869acbec790bc9168b5 Mon Sep 17 00:00:00 2001 From: Paul Gilmore Date: Mon, 2 May 2016 10:47:04 -0700 Subject: [PATCH 3/3] Update README.md --- README.md | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 532e6175..9f3af274 100644 --- a/README.md +++ b/README.md @@ -23,31 +23,10 @@ This package contains three different versions of the PlayFab SDK. * PlayFabSDK - Contains all APIs in one SDK, as well as a unit-test project -#### NuGet - -https://www.nuget.org/packages/PlayFabAllSDK/ - - 4. Usage Instructions: ---- -#### Current Status: -[![Build status](https://ci.appveyor.com/api/projects/status/n3aw3s8jpgx9bhbq?svg=true)](https://ci.appveyor.com/project/MattAugustine/csharpsdk-jrl6i) - - -Full: - -https://playfab-csharp-sdk-builds.s3-us-west-2.amazonaws.com/PlayFabSDK/bin/Release/PlayFabAllSDK.dll -https://playfab-csharp-sdk-builds.s3-us-west-2.amazonaws.com/PlayFabSDK/bin/Release/PlayFabAllSDK.pdb - -Client: - -https://playfab-csharp-sdk-builds.s3-us-west-2.amazonaws.com/PlayFabClientSDK/bin/Release/PlayFabClientSDK.dll -https://playfab-csharp-sdk-builds.s3-us-west-2.amazonaws.com/PlayFabClientSDK/bin/Release/PlayFabClientSDK.pdb - -Server: - -https://playfab-csharp-sdk-builds.s3-us-west-2.amazonaws.com/PlayFabServerSDK/bin/Release/PlayFabServerSDK.dll -https://playfab-csharp-sdk-builds.s3-us-west-2.amazonaws.com/PlayFabServerSDK/bin/Release/PlayFabServerSDK.pdb +1) All users will want to download the latest SDK: https://github.com/PlayFab/CSharpSDK/releases +2) For beginners or quick evaluation, please start with the included example project, and add your own logic and api calls. For advanced users, or users with an existing project, please copy the source from one of the SDK folders into your project. 5. Troubleshooting: