Skip to content

Commit

Permalink
https://docs.microsoft.com/en-us/gaming/playfab/release-notes/#231110
Browse files Browse the repository at this point in the history
  • Loading branch information
PlayFab SDK Team authored and PlayFab SDK Team committed Nov 16, 2023
2 parents dbaa456 + 4b0ecfc commit 29f47d2
Show file tree
Hide file tree
Showing 16 changed files with 240 additions and 82 deletions.
99 changes: 96 additions & 3 deletions PlayFabSDK/source/PlayFabAdminModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,21 @@ public class AbortTaskInstanceRequest : PlayFabRequestCommon
/// </summary>
public class Action
{
/// <summary>
/// Action content to Add Inventory item v2
/// </summary>
public AddInventoryItemV2Content AddInventoryItemV2Content ;

/// <summary>
/// Action content to ban player
/// </summary>
public BanPlayerContent BanPlayerContent ;

/// <summary>
/// Action content to delete inventory item v2
/// </summary>
public DeleteInventoryItemV2Content DeleteInventoryItemV2Content ;

/// <summary>
/// Action content to delete player
/// </summary>
Expand Down Expand Up @@ -71,6 +81,11 @@ public class Action
/// </summary>
public SendEmailContent SendEmailContent ;

/// <summary>
/// Action content to Subtract Inventory item v2
/// </summary>
public SubtractInventoryItemV2Content SubtractInventoryItemV2Content ;

}

public class ActionsOnPlayersInSegmentTaskParameter
Expand Down Expand Up @@ -208,6 +223,35 @@ public class AdCampaignSegmentFilter

}

public class AddInventoryItemV2Content
{
/// <summary>
/// Amount of the item to be granted to a player
/// </summary>
public int? Amount ;

/// <summary>
/// The collection id for where the item will be granted in the player inventory
/// </summary>
public string CollectionId ;

/// <summary>
/// The duration in seconds of the subscription to be granted to a player
/// </summary>
public int? DurationInSeconds ;

/// <summary>
/// The id of item to be granted to the player
/// </summary>
public string ItemId ;

/// <summary>
/// The stack id for where the item will be granted in the player inventory
/// </summary>
public string StackId ;

}

public class AddLocalizedNewsRequest : PlayFabRequestCommon
{
/// <summary>
Expand Down Expand Up @@ -1589,6 +1633,25 @@ public class DeleteContentRequest : PlayFabRequestCommon

}

public class DeleteInventoryItemV2Content
{
/// <summary>
/// The collection id for where the item will be removed from the player inventory
/// </summary>
public string CollectionId ;

/// <summary>
/// The id of item to be removed from the player
/// </summary>
public string ItemId ;

/// <summary>
/// The stack id for where the item will be removed from the player inventory
/// </summary>
public string StackId ;

}

/// <summary>
/// Deletes all data associated with the master player account, including data from all titles the player has played, such
/// as statistics, custom data, inventory, purchases, virtual currency balances, characters, group memberships, publisher
Expand Down Expand Up @@ -2661,6 +2724,7 @@ public enum GenericErrorCodes
InvalidNamespaceMismatch,
LeaderboardColumnLengthMismatch,
InvalidStatisticScore,
LeaderboardColumnsNotSpecified,
MatchmakingEntityInvalid,
MatchmakingPlayerAttributesInvalid,
MatchmakingQueueNotFound,
Expand Down Expand Up @@ -3883,17 +3947,17 @@ public int CompareTo(GrantedItemInstance other)
public class GrantItemContent
{
/// <summary>
/// Publish cloudscript results as playstream event
/// The catalog version of the item to be granted to the player
/// </summary>
public string CatalogVersion ;

/// <summary>
/// Publish cloudscript results as playstream event
/// The id of item to be granted to the player
/// </summary>
public string ItemId ;

/// <summary>
/// Publish cloudscript results as playstream event
/// Quantity of the item to be granted to a player
/// </summary>
public int ItemQuantity ;

Expand Down Expand Up @@ -6795,6 +6859,35 @@ public enum SubscriptionProviderStatus
PaymentPending
}

public class SubtractInventoryItemV2Content
{
/// <summary>
/// Amount of the item to removed from the player
/// </summary>
public int? Amount ;

/// <summary>
/// The collection id for where the item will be removed from the player inventory
/// </summary>
public string CollectionId ;

/// <summary>
/// The duration in seconds to be removed from the subscription in the players inventory
/// </summary>
public int? DurationInSeconds ;

/// <summary>
/// The id of item to be removed from the player
/// </summary>
public string ItemId ;

/// <summary>
/// The stack id for where the item will be removed from the player inventory
/// </summary>
public string StackId ;

}

public class SubtractUserVirtualCurrencyRequest : PlayFabRequestCommon
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions PlayFabSDK/source/PlayFabErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ public enum PlayFabErrorCode
InvalidNamespaceMismatch = 1561,
LeaderboardColumnLengthMismatch = 1562,
InvalidStatisticScore = 1563,
LeaderboardColumnsNotSpecified = 1564,
MatchmakingEntityInvalid = 2001,
MatchmakingPlayerAttributesInvalid = 2002,
MatchmakingQueueNotFound = 2016,
Expand Down
34 changes: 9 additions & 25 deletions PlayFabSDK/source/PlayFabHttp/PlayFabPollyHttp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Threading.Tasks;

namespace PlayFab.Internal
{
{
/// <summary>
/// A Polly wrapped version of PlayFab Transport plug in which used
/// when making http requests to PlayFab Main Server.
Expand All @@ -38,21 +38,15 @@ public class PlayFabPollyHttp : PlayFabSysHttp, ITransportPlugin
public string Name;

/// <summary>
/// Gets the resilience policies defined.
/// Gets the PlayFab retry policies
/// </summary>
public AsyncPolicyWrap<object> CommonResilience { get; private set; }
public AsyncRetryPolicy<object> RetryPolicy { get; private set; }

/// <summary>
/// Constructor for objects of type PollyTransportPlug.
/// <remarks>
/// Sets a default resilience policy with the fololwing common settings
/// Sets a default resilience policy with the following common settings
/// 1) Sets the retry to 3 times and has an embedded backoff.
/// 2) > Sets a circuit breaker that will trigger is 25% of collapsed calls within
/// a 5 second window are failing.
/// > Period for evaluation requires a burst of >=2RPS before evaluating breaker rule,
/// requires a minimum of 10 requests in 5 seconds, and the circuit breaker will
/// will be open for 20 second.
/// More information on the client can be found here: https://github.com/App-vNext/Polly
///</remarks>
/// </summary>
public PlayFabPollyHttp()
Expand All @@ -63,25 +57,16 @@ public PlayFabPollyHttp()
.OrResult<object>(r => r != null && (r as PlayFabError) != null && HttpStatusCodesWorthRetrying.Contains((r as PlayFabError).HttpCode))
.WaitAndRetryAsync(1,
retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)) // exponential back-off: 2, 4, 8 etc
+ TimeSpan.FromMilliseconds(jitterer.Next(0, 1000))); // plus some jitter: up to 1 second

var breakerPolicy = Policy.Handle<Exception>()
.OrResult<object>(r => r != null && (r as PlayFabError) != null && HttpStatusCodesWorthRetrying.Contains((r as PlayFabError).HttpCode))
.AdvancedCircuitBreakerAsync(
failureThreshold: 0.25,
samplingDuration: TimeSpan.FromSeconds(5),
minimumThroughput: 2,
durationOfBreak: TimeSpan.FromSeconds(20));

CommonResilience = retryPolicy.WrapAsync(breakerPolicy);
+ TimeSpan.FromMilliseconds(jitterer.Next(0, 1000))); // plus some jitter: up to 1
RetryPolicy = retryPolicy;

Name = "PlayFabWithPolly";
}

/// <inheritdoc/>
public new async Task<object> DoPost(string fullPath, object request, Dictionary<string, string> headers)
{
object doPostResult = await CommonResilience
object doPostResult = await RetryPolicy
.ExecuteAsync(async () =>
{
return await base.DoPost(fullPath, request, headers);
Expand All @@ -93,10 +78,9 @@ public PlayFabPollyHttp()
/// <summary>
/// Overrides the Polly Policies to enforce.
/// </summary>
/// <exception cref="ArgumentNullException"> Thrown when retryPolicy and/or breakerPolicy is null.</exception>
public void OverridePolicies(AsyncPolicyWrap<object> policy)
public void OverridePolicies(AsyncRetryPolicy<object> policy)
{
CommonResilience = policy;
RetryPolicy = policy;
}
}
}
14 changes: 7 additions & 7 deletions PlayFabSDK/source/PlayFabMultiplayerModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ public class CreateLobbyRequest : PlayFabRequestCommon
public Dictionary<string,string> CustomTags ;

/// <summary>
/// The private key-value pairs which are only visible to members of the lobby. At most 30 key-value pairs may be stored
/// The private key-value pairs which are visible to all entities in the lobby. At most 30 key-value pairs may be stored
/// here, keys are limited to 30 characters and values to 1000. The total size of all lobbyData values may not exceed 4096
/// bytes. Keys are case sensitive.
/// </summary>
Expand Down Expand Up @@ -3023,7 +3023,7 @@ public class JoinArrangedLobbyRequest : PlayFabRequestCommon

/// <summary>
/// The private key-value pairs used by the member to communicate information to other members and the owner. Visible to all
/// members of the lobby. At most 30 key-value pairs may be stored here, keys are limited to 30 characters and values to
/// entities in the lobby. At most 30 key-value pairs may be stored here, keys are limited to 30 characters and values to
/// 1000. The total size of all memberData values may not exceed 4096 bytes. Keys are case sensitive.
/// </summary>
public Dictionary<string,string> MemberData ;
Expand Down Expand Up @@ -3071,7 +3071,7 @@ public class JoinLobbyRequest : PlayFabRequestCommon

/// <summary>
/// The private key-value pairs used by the member to communicate information to other members and the owner. Visible to all
/// members of the lobby. At most 30 key-value pairs may be stored here, keys are limited to 30 characters and values to
/// entities in the lobby. At most 30 key-value pairs may be stored here, keys are limited to 30 characters and values to
/// 1000. The total size of all memberData values may not exceed 4096 bytes.Keys are case sensitive.
/// </summary>
public Dictionary<string,string> MemberData ;
Expand Down Expand Up @@ -5455,7 +5455,7 @@ public class UpdateLobbyRequest : PlayFabRequestCommon
public Dictionary<string,string> CustomTags ;

/// <summary>
/// The private key-value pairs which are only visible to members of the lobby. Optional. Sets or updates key-value pairs on
/// The private key-value pairs which are visible to all entities in the lobby. Optional. Sets or updates key-value pairs on
/// the lobby. Only the current lobby owner can set lobby data. Keys may be an arbitrary string of at most 30 characters.
/// The total size of all lobbyData values may not exceed 4096 bytes. Values are not individually limited. There can be up
/// to 30 key-value pairs stored here. Keys are case sensitive.
Expand All @@ -5482,9 +5482,9 @@ public class UpdateLobbyRequest : PlayFabRequestCommon
/// <summary>
/// The private key-value pairs used by the member to communicate information to other members and the owner. Optional. Sets
/// or updates new key-value pairs on the caller's member data. New keys will be added with their values and existing keys
/// will be updated with the new values. Visible to all members of the lobby. At most 30 key-value pairs may be stored here,
/// keys are limited to 30 characters and values to 1000. The total size of all memberData values may not exceed 4096 bytes.
/// Keys are case sensitive. Servers cannot specifiy this.
/// will be updated with the new values. Visible to all entities in the lobby. At most 30 key-value pairs may be stored
/// here, keys are limited to 30 characters and values to 1000. The total size of all memberData values may not exceed 4096
/// bytes. Keys are case sensitive. Servers cannot specifiy this.
/// </summary>
public Dictionary<string,string> MemberData ;

Expand Down
4 changes: 2 additions & 2 deletions PlayFabSDK/source/PlayFabSDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<FileAlignment>512</FileAlignment>

<PackageId>PlayFabAllSDK</PackageId>
<Version>1.168.231101</Version>
<Version>1.169.231110</Version>
<Title>PlayFab CSharp Sdk</Title>
<Authors>Microsoft</Authors>
<Owners>Microsoft</Owners>
Expand All @@ -21,7 +21,7 @@
<Company>PlayFab</Company>
<Product>PlayFabSDK</Product>
<PackageTags>PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native</PackageTags>
<PackageReleaseNotes>https://docs.microsoft.com/gaming/playfab/release-notes#231101</PackageReleaseNotes>
<PackageReleaseNotes>https://docs.microsoft.com/gaming/playfab/release-notes#231110</PackageReleaseNotes>
<NeutralLanguage>en</NeutralLanguage>
<AssemblyVersion>1</AssemblyVersion>
<FileVersion>1</FileVersion>
Expand Down
1 change: 1 addition & 0 deletions PlayFabSDK/source/PlayFabServerModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2092,6 +2092,7 @@ public enum GenericErrorCodes
InvalidNamespaceMismatch,
LeaderboardColumnLengthMismatch,
InvalidStatisticScore,
LeaderboardColumnsNotSpecified,
MatchmakingEntityInvalid,
MatchmakingPlayerAttributesInvalid,
MatchmakingQueueNotFound,
Expand Down
4 changes: 2 additions & 2 deletions PlayFabSDK/source/PlayFabSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace PlayFab
{
public class PlayFabSettings
{
public const string SdkVersion = "1.168.231101";
public const string SdkVersion = "1.169.231110";
public const string BuildIdentifier = "adobuild_csharpsdk_114";
public const string SdkVersionString = "CSharpSDK-1.168.231101";
public const string SdkVersionString = "CSharpSDK-1.169.231110";
/// <summary> This is only for customers running a private cluster. Generally you shouldn't touch this </summary>
public static string DefaultProductionEnvironmentUrl = "playfabapi.com";

Expand Down
2 changes: 1 addition & 1 deletion PluginManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Then use PluginManager class to set custom plugins before using any other PlayFa
// will help your services follow better fault tolerance practices
// and proper retrying logic against the PlayFab services. For more
// information, see the PlayFabPollyHttp class summary.
PluginManager.SetPlugin(new PlayFabPollyHttp(), PluginContract.PlayFab_Transport, "PluginWithPolly");
PluginManager.SetPlugin(new PlayFabPollyHttp(), PluginContract.PlayFab_Transport);

// Optionally set your own custom JSON serializer
PluginManager.SetPlugin(new MyJsonSerializer(), PluginContract.PlayFab_Serializer);
Expand Down
6 changes: 3 additions & 3 deletions Plugins/CloudScript/source/PlayFabCloudScriptPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<FileAlignment>512</FileAlignment>

<PackageId>PlayFabCloudScriptPlugin</PackageId>
<Version>1.168.231101-alpha</Version>
<Version>1.169.231110-alpha</Version>
<Title>PlayFab CSharp CloudScript Plugin</Title>
<Authors>Microsoft</Authors>
<Owners>Microsoft</Owners>
Expand All @@ -21,7 +21,7 @@
<Product>PlayFabCloudScriptPlugin</Product>
<Copyright>Copyright 2023</Copyright>
<PackageTags>PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native</PackageTags>
<PackageReleaseNotes>https://docs.microsoft.com/gaming/playfab/release-notes#231101</PackageReleaseNotes>
<PackageReleaseNotes>https://docs.microsoft.com/gaming/playfab/release-notes#231110</PackageReleaseNotes>
<NeutralLanguage>en</NeutralLanguage>
<AssemblyVersion>1</AssemblyVersion>
<FileVersion>1</FileVersion>
Expand All @@ -45,7 +45,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PlayFabAllSDK" Version="1.168.231101" />
<PackageReference Include="PlayFabAllSDK" Version="1.169.231110" />
</ItemGroup>

</Project>
Loading

0 comments on commit 29f47d2

Please sign in to comment.