Skip to content

Commit

Permalink
https://docs.microsoft.com/en-us/gaming/playfab/release-notes/#230929
Browse files Browse the repository at this point in the history
  • Loading branch information
PlayFab SDK Team authored and PlayFab SDK Team committed Oct 2, 2023
2 parents 1526439 + 60a74b7 commit d7ff7b9
Show file tree
Hide file tree
Showing 19 changed files with 801 additions and 21 deletions.
194 changes: 192 additions & 2 deletions PlayFabSDK/source/PlayFabAdminModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,64 @@ public class AbortTaskInstanceRequest : PlayFabRequestCommon

}

/// <summary>
/// The work to be performed on each entity which can only be of one type.
/// </summary>
public class Action
{
/// <summary>
/// Action content to ban player
/// </summary>
public BanPlayerContent BanPlayerContent ;

/// <summary>
/// Action content to delete player
/// </summary>
public DeletePlayerContent DeletePlayerContent ;

/// <summary>
/// Action content to execute cloud script
/// </summary>
public ExecuteCloudScriptContent ExecuteCloudScriptContent ;

/// <summary>
/// Action content to execute azure function
/// </summary>
public ExecuteFunctionContent ExecuteFunctionContent ;

/// <summary>
/// Action content to grant item
/// </summary>
public GrantItemContent GrantItemContent ;

/// <summary>
/// Action content to grant virtual currency
/// </summary>
public GrantVirtualCurrencyContent GrantVirtualCurrencyContent ;

/// <summary>
/// Action content to increment player statistic
/// </summary>
public IncrementPlayerStatisticContent IncrementPlayerStatisticContent ;

/// <summary>
/// Action content to send push notification
/// </summary>
public PushNotificationContent PushNotificationContent ;

/// <summary>
/// Action content to send email
/// </summary>
public SendEmailContent SendEmailContent ;

}

public class ActionsOnPlayersInSegmentTaskParameter
{
/// <summary>
/// ID of the action to perform on each player in segment.
/// List of actions to perform on each player in a segment. Each action object can contain only one action type.
/// </summary>
public string ActionId ;
public List<Action> Actions ;

/// <summary>
/// ID of the segment to perform actions on.
Expand Down Expand Up @@ -349,6 +401,20 @@ public class BanInfo

}

public class BanPlayerContent
{
/// <summary>
/// Duration(in hours) to ban a player. If not provided, the player will be banned permanently.
/// </summary>
public int BanDurationHours ;

/// <summary>
/// Reason to ban a player
/// </summary>
public string BanReason ;

}

public class BanPlayerSegmentAction
{
/// <summary>
Expand Down Expand Up @@ -1615,6 +1681,10 @@ public class DeleteOpenIdConnectionRequest : PlayFabRequestCommon

}

public class DeletePlayerContent
{
}

/// <summary>
/// Deletes all data associated with the player, including statistics, custom data, inventory, purchases, virtual currency
/// balances, characters and shared group memberships. Removes the player from all leaderboards and player search indexes.
Expand Down Expand Up @@ -1828,6 +1898,25 @@ public class ExecuteAzureFunctionSegmentAction

}

public class ExecuteCloudScriptContent
{
/// <summary>
/// Arguments(JSON) to be passed into the cloudscript method
/// </summary>
public string CloudScriptMethodArguments ;

/// <summary>
/// Cloudscript method name
/// </summary>
public string CloudScriptMethodName ;

/// <summary>
/// Publish cloudscript results as playstream event
/// </summary>
public bool PublishResultsToPlayStream ;

}

public class ExecuteCloudScriptResult : PlayFabResultCommon
{
/// <summary>
Expand Down Expand Up @@ -1914,6 +2003,25 @@ public class ExecuteCloudScriptSegmentAction

}

public class ExecuteFunctionContent
{
/// <summary>
/// Arguments(JSON) to be passed into the cloudscript azure function
/// </summary>
public string CloudScriptFunctionArguments ;

/// <summary>
/// Cloudscript azure function name
/// </summary>
public string CloudScriptFunctionName ;

/// <summary>
/// Publish results from executing the azure function as playstream event
/// </summary>
public bool PublishResultsToPlayStream ;

}

/// <summary>
/// Exports 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 @@ -2547,6 +2655,7 @@ public enum GenericErrorCodes
InvalidServiceConfiguration,
InvalidNamespaceMismatch,
LeaderboardColumnLengthMismatch,
InvalidStatisticScore,
MatchmakingEntityInvalid,
MatchmakingPlayerAttributesInvalid,
MatchmakingQueueNotFound,
Expand Down Expand Up @@ -2691,6 +2800,12 @@ public enum GenericErrorCodes
LobbyNewOwnerMustBeConnected,
LobbyCurrentOwnerStillConnected,
LobbyMemberIsNotOwner,
LobbyAssociatedServerMismatch,
LobbyAssociatedServerNotFound,
LobbyAssociatedToDifferentServer,
LobbyServerAlreadyAssociated,
LobbyIsNotClientOwned,
LobbyDoesNotUseConnections,
EventSamplingInvalidRatio,
EventSamplingInvalidEventNamespace,
EventSamplingInvalidEventName,
Expand Down Expand Up @@ -3757,6 +3872,25 @@ public int CompareTo(GrantedItemInstance other)

}

public class GrantItemContent
{
/// <summary>
/// Publish cloudscript results as playstream event
/// </summary>
public string CatalogVersion ;

/// <summary>
/// Publish cloudscript results as playstream event
/// </summary>
public string ItemId ;

/// <summary>
/// Publish cloudscript results as playstream event
/// </summary>
public int ItemQuantity ;

}

public class GrantItemSegmentAction
{
/// <summary>
Expand Down Expand Up @@ -3814,6 +3948,20 @@ public class GrantItemsToUsersResult : PlayFabResultCommon

}

public class GrantVirtualCurrencyContent
{
/// <summary>
/// Amount of currency to be granted to a player
/// </summary>
public int CurrencyAmount ;

/// <summary>
/// Code of the currency to be granted to a player
/// </summary>
public string CurrencyCode ;

}

public class GrantVirtualCurrencySegmentAction
{
/// <summary>
Expand Down Expand Up @@ -3860,6 +4008,20 @@ public class IncrementLimitedEditionItemAvailabilityResult : PlayFabResultCommon
{
}

public class IncrementPlayerStatisticContent
{
/// <summary>
/// Amount(in whole number) to increase the player statistic by
/// </summary>
public int StatisticChangeBy ;

/// <summary>
/// Name of the player statistic to be incremented
/// </summary>
public string StatisticName ;

}

public class IncrementPlayerStatisticSegmentAction
{
/// <summary>
Expand Down Expand Up @@ -4928,6 +5090,25 @@ public class PlayerStatisticVersion

}

public class PushNotificationContent
{
/// <summary>
/// Text of message to send.
/// </summary>
public string Message ;

/// <summary>
/// Id of the push notification template.
/// </summary>
public string PushNotificationTemplateId ;

/// <summary>
/// Subject of message to send (may not be displayed in all platforms)
/// </summary>
public string Subject ;

}

public enum PushNotificationPlatform
{
ApplePushNotificationService,
Expand Down Expand Up @@ -6164,6 +6345,15 @@ public class SendAccountRecoveryEmailResult : PlayFabResultCommon
{
}

public class SendEmailContent
{
/// <summary>
/// The email template id of the email template to send.
/// </summary>
public string EmailTemplateId ;

}

/// <summary>
/// This API lets developers set overrides for membership expirations, independent of any subscriptions setting it.
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions PlayFabSDK/source/PlayFabErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ public enum PlayFabErrorCode
InvalidServiceConfiguration = 1560,
InvalidNamespaceMismatch = 1561,
LeaderboardColumnLengthMismatch = 1562,
InvalidStatisticScore = 1563,
MatchmakingEntityInvalid = 2001,
MatchmakingPlayerAttributesInvalid = 2002,
MatchmakingQueueNotFound = 2016,
Expand Down Expand Up @@ -707,6 +708,12 @@ public enum PlayFabErrorCode
LobbyNewOwnerMustBeConnected = 13009,
LobbyCurrentOwnerStillConnected = 13010,
LobbyMemberIsNotOwner = 13011,
LobbyAssociatedServerMismatch = 13012,
LobbyAssociatedServerNotFound = 13013,
LobbyAssociatedToDifferentServer = 13014,
LobbyServerAlreadyAssociated = 13015,
LobbyIsNotClientOwned = 13016,
LobbyDoesNotUseConnections = 13017,
EventSamplingInvalidRatio = 14000,
EventSamplingInvalidEventNamespace = 14001,
EventSamplingInvalidEventName = 14002,
Expand Down
27 changes: 27 additions & 0 deletions PlayFabSDK/source/PlayFabMultiplayerAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,33 @@ public static async Task<PlayFabResult<RequestMultiplayerServerResponse>> Reques
return new PlayFabResult<RequestMultiplayerServerResponse> { Result = result, CustomData = customData };
}

/// <summary>
/// Request a party session.
/// </summary>
public static async Task<PlayFabResult<RequestPartyServiceResponse>> RequestPartyServiceAsync(RequestPartyServiceRequest request, object customData = null, Dictionary<string, string> extraHeaders = null)
{
await new PlayFabUtil.SynchronizationContextRemover();

var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
var requestSettings = PlayFabSettings.staticSettings;
if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");


var httpResult = await PlayFabHttp.DoPost("/Party/RequestPartyService", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
if (httpResult is PlayFabError)
{
var error = (PlayFabError)httpResult;
PlayFabSettings.GlobalErrorHandler?.Invoke(error);
return new PlayFabResult<RequestPartyServiceResponse> { Error = error, CustomData = customData };
}

var resultRawJson = (string)httpResult;
var resultData = PluginManager.GetPlugin<ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject<PlayFabJsonSuccess<RequestPartyServiceResponse>>(resultRawJson);
var result = resultData.data;

return new PlayFabResult<RequestPartyServiceResponse> { Result = result, CustomData = customData };
}

/// <summary>
/// Rolls over the credentials to the container registry.
/// </summary>
Expand Down
26 changes: 26 additions & 0 deletions PlayFabSDK/source/PlayFabMultiplayerInstanceAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,32 @@ public async Task<PlayFabResult<RequestMultiplayerServerResponse>> RequestMultip
return new PlayFabResult<RequestMultiplayerServerResponse> { Result = result, CustomData = customData };
}

/// <summary>
/// Request a party session.
/// </summary>
public async Task<PlayFabResult<RequestPartyServiceResponse>> RequestPartyServiceAsync(RequestPartyServiceRequest request, object customData = null, Dictionary<string, string> extraHeaders = null)
{
await new PlayFabUtil.SynchronizationContextRemover();

var requestContext = request?.AuthenticationContext ?? authenticationContext;
var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");

var httpResult = await PlayFabHttp.DoPost("/Party/RequestPartyService", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
if (httpResult is PlayFabError)
{
var error = (PlayFabError)httpResult;
PlayFabSettings.GlobalErrorHandler?.Invoke(error);
return new PlayFabResult<RequestPartyServiceResponse> { Error = error, CustomData = customData };
}

var resultRawJson = (string)httpResult;
var resultData = PluginManager.GetPlugin<ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject<PlayFabJsonSuccess<RequestPartyServiceResponse>>(resultRawJson);
var result = resultData.data;

return new PlayFabResult<RequestPartyServiceResponse> { Result = result, CustomData = customData };
}

/// <summary>
/// Rolls over the credentials to the container registry.
/// </summary>
Expand Down
Loading

0 comments on commit d7ff7b9

Please sign in to comment.