Skip to content

Commit 02a2d0d

Browse files
author
Playfab Jenkins Bot
committed
https://api.playfab.com/releaseNotes#160711
1 parent 0320411 commit 02a2d0d

File tree

15 files changed

+445
-15
lines changed

15 files changed

+445
-15
lines changed

Diff for: PlayFabClientSDK.unitypackage

558 Bytes
Binary file not shown.

Diff for: PlayFabClientSample/Assets/PlayFabSDK/Public/PlayFabClientAPI.cs

+75
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public static class PlayFabClientAPI
3333
public delegate void LoginWithPlayFabResponseCallback(string urlPath, int callId, LoginWithPlayFabRequest request, LoginResult result, PlayFabError error, object customData);
3434
public delegate void LoginWithSteamRequestCallback(string urlPath, int callId, LoginWithSteamRequest request, object customData);
3535
public delegate void LoginWithSteamResponseCallback(string urlPath, int callId, LoginWithSteamRequest request, LoginResult result, PlayFabError error, object customData);
36+
public delegate void LoginWithTwitchRequestCallback(string urlPath, int callId, LoginWithTwitchRequest request, object customData);
37+
public delegate void LoginWithTwitchResponseCallback(string urlPath, int callId, LoginWithTwitchRequest request, LoginResult result, PlayFabError error, object customData);
3638
public delegate void RegisterPlayFabUserRequestCallback(string urlPath, int callId, RegisterPlayFabUserRequest request, object customData);
3739
public delegate void RegisterPlayFabUserResponseCallback(string urlPath, int callId, RegisterPlayFabUserRequest request, RegisterPlayFabUserResult result, PlayFabError error, object customData);
3840
public delegate void AddUsernamePasswordRequestCallback(string urlPath, int callId, AddUsernamePasswordRequest request, object customData);
@@ -51,6 +53,8 @@ public static class PlayFabClientAPI
5153
public delegate void GetPlayFabIDsFromKongregateIDsResponseCallback(string urlPath, int callId, GetPlayFabIDsFromKongregateIDsRequest request, GetPlayFabIDsFromKongregateIDsResult result, PlayFabError error, object customData);
5254
public delegate void GetPlayFabIDsFromSteamIDsRequestCallback(string urlPath, int callId, GetPlayFabIDsFromSteamIDsRequest request, object customData);
5355
public delegate void GetPlayFabIDsFromSteamIDsResponseCallback(string urlPath, int callId, GetPlayFabIDsFromSteamIDsRequest request, GetPlayFabIDsFromSteamIDsResult result, PlayFabError error, object customData);
56+
public delegate void GetPlayFabIDsFromTwitchIDsRequestCallback(string urlPath, int callId, GetPlayFabIDsFromTwitchIDsRequest request, object customData);
57+
public delegate void GetPlayFabIDsFromTwitchIDsResponseCallback(string urlPath, int callId, GetPlayFabIDsFromTwitchIDsRequest request, GetPlayFabIDsFromTwitchIDsResult result, PlayFabError error, object customData);
5458
public delegate void GetUserCombinedInfoRequestCallback(string urlPath, int callId, GetUserCombinedInfoRequest request, object customData);
5559
public delegate void GetUserCombinedInfoResponseCallback(string urlPath, int callId, GetUserCombinedInfoRequest request, GetUserCombinedInfoResult result, PlayFabError error, object customData);
5660
public delegate void LinkAndroidDeviceIDRequestCallback(string urlPath, int callId, LinkAndroidDeviceIDRequest request, object customData);
@@ -69,6 +73,8 @@ public static class PlayFabClientAPI
6973
public delegate void LinkKongregateResponseCallback(string urlPath, int callId, LinkKongregateAccountRequest request, LinkKongregateAccountResult result, PlayFabError error, object customData);
7074
public delegate void LinkSteamAccountRequestCallback(string urlPath, int callId, LinkSteamAccountRequest request, object customData);
7175
public delegate void LinkSteamAccountResponseCallback(string urlPath, int callId, LinkSteamAccountRequest request, LinkSteamAccountResult result, PlayFabError error, object customData);
76+
public delegate void LinkTwitchRequestCallback(string urlPath, int callId, LinkTwitchAccountRequest request, object customData);
77+
public delegate void LinkTwitchResponseCallback(string urlPath, int callId, LinkTwitchAccountRequest request, LinkTwitchAccountResult result, PlayFabError error, object customData);
7278
public delegate void ReportPlayerRequestCallback(string urlPath, int callId, ReportPlayerClientRequest request, object customData);
7379
public delegate void ReportPlayerResponseCallback(string urlPath, int callId, ReportPlayerClientRequest request, ReportPlayerClientResult result, PlayFabError error, object customData);
7480
public delegate void SendAccountRecoveryEmailRequestCallback(string urlPath, int callId, SendAccountRecoveryEmailRequest request, object customData);
@@ -89,6 +95,8 @@ public static class PlayFabClientAPI
8995
public delegate void UnlinkKongregateResponseCallback(string urlPath, int callId, UnlinkKongregateAccountRequest request, UnlinkKongregateAccountResult result, PlayFabError error, object customData);
9096
public delegate void UnlinkSteamAccountRequestCallback(string urlPath, int callId, UnlinkSteamAccountRequest request, object customData);
9197
public delegate void UnlinkSteamAccountResponseCallback(string urlPath, int callId, UnlinkSteamAccountRequest request, UnlinkSteamAccountResult result, PlayFabError error, object customData);
98+
public delegate void UnlinkTwitchRequestCallback(string urlPath, int callId, UnlinkTwitchAccountRequest request, object customData);
99+
public delegate void UnlinkTwitchResponseCallback(string urlPath, int callId, UnlinkTwitchAccountRequest request, UnlinkTwitchAccountResult result, PlayFabError error, object customData);
92100
public delegate void UpdateUserTitleDisplayNameRequestCallback(string urlPath, int callId, UpdateUserTitleDisplayNameRequest request, object customData);
93101
public delegate void UpdateUserTitleDisplayNameResponseCallback(string urlPath, int callId, UpdateUserTitleDisplayNameRequest request, UpdateUserTitleDisplayNameResult result, PlayFabError error, object customData);
94102
public delegate void GetFriendLeaderboardRequestCallback(string urlPath, int callId, GetFriendLeaderboardRequest request, object customData);
@@ -483,6 +491,28 @@ public static void LoginWithSteamResultAction(LoginResult result, CallRequestCon
483491

484492
}
485493

494+
/// <summary>
495+
/// Signs the user in using a Twitch access token.
496+
/// </summary>
497+
public static void LoginWithTwitch(LoginWithTwitchRequest request, PlayFabResultCommon.ProcessApiCallback<LoginResult> resultCallback, ErrorCallback errorCallback, object customData = null)
498+
{
499+
request.TitleId = request.TitleId ?? PlayFabSettings.TitleId;
500+
if (request.TitleId == null) throw new Exception("Must be have PlayFabSettings.TitleId set to call this method");
501+
502+
string serializedJson = JsonWrapper.SerializeObject(request, PlayFabUtil.ApiSerializerStrategy);
503+
Action<CallRequestContainer> callback = delegate(CallRequestContainer requestContainer)
504+
{
505+
ResultContainer<LoginResult>.HandleResults(requestContainer, resultCallback, errorCallback, LoginWithTwitchResultAction);
506+
};
507+
PlayFabHttp.Post("/Client/LoginWithTwitch", serializedJson, null, null, callback, request, customData);
508+
}
509+
public static void LoginWithTwitchResultAction(LoginResult result, CallRequestContainer requestContainer)
510+
{
511+
_authKey = result.SessionTicket ?? _authKey;
512+
MultiStepClientLogin(result.SettingsForUser.NeedsAttribution);
513+
514+
}
515+
486516
/// <summary>
487517
/// Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply either a username or an email address.
488518
/// </summary>
@@ -625,6 +655,21 @@ public static void GetPlayFabIDsFromSteamIDs(GetPlayFabIDsFromSteamIDsRequest re
625655
PlayFabHttp.Post("/Client/GetPlayFabIDsFromSteamIDs", serializedJson, "X-Authorization", _authKey, callback, request, customData);
626656
}
627657

658+
/// <summary>
659+
/// Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for the user accounts, available as "_id" from the Twitch API methods(ex: https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser).
660+
/// </summary>
661+
public static void GetPlayFabIDsFromTwitchIDs(GetPlayFabIDsFromTwitchIDsRequest request, PlayFabResultCommon.ProcessApiCallback<GetPlayFabIDsFromTwitchIDsResult> resultCallback, ErrorCallback errorCallback, object customData = null)
662+
{
663+
if (_authKey == null) throw new Exception("Must be logged in to call this method");
664+
665+
string serializedJson = JsonWrapper.SerializeObject(request, PlayFabUtil.ApiSerializerStrategy);
666+
Action<CallRequestContainer> callback = delegate(CallRequestContainer requestContainer)
667+
{
668+
ResultContainer<GetPlayFabIDsFromTwitchIDsResult>.HandleResults(requestContainer, resultCallback, errorCallback, null);
669+
};
670+
PlayFabHttp.Post("/Client/GetPlayFabIDsFromTwitchIDs", serializedJson, "X-Authorization", _authKey, callback, request, customData);
671+
}
672+
628673
/// <summary>
629674
/// NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user.
630675
/// </summary>
@@ -760,6 +805,21 @@ public static void LinkSteamAccount(LinkSteamAccountRequest request, PlayFabResu
760805
PlayFabHttp.Post("/Client/LinkSteamAccount", serializedJson, "X-Authorization", _authKey, callback, request, customData);
761806
}
762807

808+
/// <summary>
809+
/// Links the Twitch account associated with the token to the user's PlayFab account
810+
/// </summary>
811+
public static void LinkTwitch(LinkTwitchAccountRequest request, PlayFabResultCommon.ProcessApiCallback<LinkTwitchAccountResult> resultCallback, ErrorCallback errorCallback, object customData = null)
812+
{
813+
if (_authKey == null) throw new Exception("Must be logged in to call this method");
814+
815+
string serializedJson = JsonWrapper.SerializeObject(request, PlayFabUtil.ApiSerializerStrategy);
816+
Action<CallRequestContainer> callback = delegate(CallRequestContainer requestContainer)
817+
{
818+
ResultContainer<LinkTwitchAccountResult>.HandleResults(requestContainer, resultCallback, errorCallback, null);
819+
};
820+
PlayFabHttp.Post("/Client/LinkTwitch", serializedJson, "X-Authorization", _authKey, callback, request, customData);
821+
}
822+
763823
/// <summary>
764824
/// Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players.
765825
/// </summary>
@@ -909,6 +969,21 @@ public static void UnlinkSteamAccount(UnlinkSteamAccountRequest request, PlayFab
909969
PlayFabHttp.Post("/Client/UnlinkSteamAccount", serializedJson, "X-Authorization", _authKey, callback, request, customData);
910970
}
911971

972+
/// <summary>
973+
/// Unlinks the related Twitch account from the user's PlayFab account
974+
/// </summary>
975+
public static void UnlinkTwitch(UnlinkTwitchAccountRequest request, PlayFabResultCommon.ProcessApiCallback<UnlinkTwitchAccountResult> resultCallback, ErrorCallback errorCallback, object customData = null)
976+
{
977+
if (_authKey == null) throw new Exception("Must be logged in to call this method");
978+
979+
string serializedJson = JsonWrapper.SerializeObject(request, PlayFabUtil.ApiSerializerStrategy);
980+
Action<CallRequestContainer> callback = delegate(CallRequestContainer requestContainer)
981+
{
982+
ResultContainer<UnlinkTwitchAccountResult>.HandleResults(requestContainer, resultCallback, errorCallback, null);
983+
};
984+
PlayFabHttp.Post("/Client/UnlinkTwitch", serializedJson, "X-Authorization", _authKey, callback, request, customData);
985+
}
986+
912987
/// <summary>
913988
/// Updates the title specific display name for the user
914989
/// </summary>

Diff for: PlayFabClientSample/Assets/PlayFabSDK/Public/PlayFabClientModels.cs

+98-1
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,24 @@ public class GetPlayFabIDsFromSteamIDsResult : PlayFabResultCommon
18081808
public List<SteamPlayFabIdPair> Data { get; set;}
18091809
}
18101810

1811+
public class GetPlayFabIDsFromTwitchIDsRequest
1812+
{
1813+
1814+
/// <summary>
1815+
/// Array of unique Twitch identifiers (Twitch's _id) for which the title needs to get PlayFab identifiers.
1816+
/// </summary>
1817+
public List<string> TwitchIds { get; set;}
1818+
}
1819+
1820+
public class GetPlayFabIDsFromTwitchIDsResult : PlayFabResultCommon
1821+
{
1822+
1823+
/// <summary>
1824+
/// Mapping of Twitch identifiers to PlayFab identifiers.
1825+
/// </summary>
1826+
public List<TwitchPlayFabIdPair> Data { get; set;}
1827+
}
1828+
18111829
public class GetPublisherDataRequest
18121830
{
18131831

@@ -2462,6 +2480,19 @@ public class LinkSteamAccountResult : PlayFabResultCommon
24622480
{
24632481
}
24642482

2483+
public class LinkTwitchAccountRequest
2484+
{
2485+
2486+
/// <summary>
2487+
/// Valid token issued by Twitch
2488+
/// </summary>
2489+
public string AccessToken { get; set;}
2490+
}
2491+
2492+
public class LinkTwitchAccountResult : PlayFabResultCommon
2493+
{
2494+
}
2495+
24652496
public class ListUsersCharactersRequest
24662497
{
24672498

@@ -2812,6 +2843,30 @@ public class LoginWithSteamRequest
28122843
public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;}
28132844
}
28142845

2846+
public class LoginWithTwitchRequest
2847+
{
2848+
2849+
/// <summary>
2850+
/// Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected
2851+
/// </summary>
2852+
public string TitleId { get; set;}
2853+
2854+
/// <summary>
2855+
/// Token issued by Twitch's API for the user.
2856+
/// </summary>
2857+
public string AccessToken { get; set;}
2858+
2859+
/// <summary>
2860+
/// Automatically create a PlayFab account if one is not currently linked to this Twitch account.
2861+
/// </summary>
2862+
public bool? CreateAccount { get; set;}
2863+
2864+
/// <summary>
2865+
/// Flags for which pieces of info to return for the user.
2866+
/// </summary>
2867+
public GetPlayerCombinedInfoRequestParams InfoRequestParameters { get; set;}
2868+
}
2869+
28152870
public class LogStatement
28162871
{
28172872

@@ -3883,6 +3938,20 @@ public enum TransactionStatus
38833938
Failed
38843939
}
38853940

3941+
public class TwitchPlayFabIdPair
3942+
{
3943+
3944+
/// <summary>
3945+
/// Unique Twitch identifier for a user.
3946+
/// </summary>
3947+
public string TwitchId { get; set;}
3948+
3949+
/// <summary>
3950+
/// Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Twitch identifier.
3951+
/// </summary>
3952+
public string PlayFabId { get; set;}
3953+
}
3954+
38863955
public class UnlinkAndroidDeviceIDRequest
38873956
{
38883957

@@ -3962,6 +4031,14 @@ public class UnlinkSteamAccountResult : PlayFabResultCommon
39624031
{
39634032
}
39644033

4034+
public class UnlinkTwitchAccountRequest
4035+
{
4036+
}
4037+
4038+
public class UnlinkTwitchAccountResult : PlayFabResultCommon
4039+
{
4040+
}
4041+
39654042
public class UnlockContainerInstanceRequest
39664043
{
39674044

@@ -4238,6 +4315,11 @@ public class UserAccountInfo
42384315
/// </summary>
42394316
public UserKongregateInfo KongregateInfo { get; set;}
42404317

4318+
/// <summary>
4319+
/// User Twitch account information, if a Twitch account has been linked
4320+
/// </summary>
4321+
public UserTwitchInfo TwitchInfo { get; set;}
4322+
42414323
/// <summary>
42424324
/// User PSN account information, if a PSN account has been linked
42434325
/// </summary>
@@ -4392,7 +4474,8 @@ public enum UserOrigination
43924474
GameCenter,
43934475
CustomId,
43944476
XboxLive,
4395-
Parse
4477+
Parse,
4478+
Twitch
43964479
}
43974480

43984481
public class UserPrivateAccountInfo
@@ -4485,6 +4568,20 @@ public class UserTitleInfo
44854568
public bool? isBanned { get; set;}
44864569
}
44874570

4571+
public class UserTwitchInfo
4572+
{
4573+
4574+
/// <summary>
4575+
/// Twitch ID
4576+
/// </summary>
4577+
public string TwitchId { get; set;}
4578+
4579+
/// <summary>
4580+
/// Twitch Username
4581+
/// </summary>
4582+
public string TwitchUserName { get; set;}
4583+
}
4584+
44884585
public class UserXboxInfo
44894586
{
44904587

Diff for: PlayFabClientSample/Assets/PlayFabSDK/Public/PlayFabSettings.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public enum PlayFabLogLevel
1818

1919
public static class PlayFabSettings
2020
{
21-
public const string SdkVersion = "0.31.160705";
21+
public const string SdkVersion = "0.32.160711";
2222
public const string BuildIdentifier = "jbuild_unitysdk_1";
23-
public const string VersionString = "UnitySDK-0.31.160705";
23+
public const string VersionString = "UnitySDK-0.32.160711";
2424

2525
internal static bool HideCallbackErrors = false; // This should only be used by unit-tests that test deliberately throwing errors
2626
private const string GLOBAL_KEY = "GLOBAL";

Diff for: PlayFabClientSample/Assets/Plugins/PlayFabShared/PlayFabErrors.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ public enum PlayFabErrorCode
232232
GameServerBuildCountLimitExceeded = 1228,
233233
VirtualCurrencyCountLimitExceeded = 1229,
234234
VirtualCurrencyCodeExists = 1230,
235-
TitleNewsItemCountLimitExceeded = 1231
235+
TitleNewsItemCountLimitExceeded = 1231,
236+
InvalidTwitchToken = 1232,
237+
TwitchResponseError = 1233
236238
}
237239

238240
public delegate void ErrorCallback(PlayFabError error);

Diff for: PlayFabCombinedTestingSample/Assets/PlayFabSDK/Public/PlayFabAdminModels.cs

+21-1
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,11 @@ public class UserAccountInfo
22072207
/// </summary>
22082208
public UserKongregateInfo KongregateInfo { get; set;}
22092209

2210+
/// <summary>
2211+
/// User Twitch account information, if a Twitch account has been linked
2212+
/// </summary>
2213+
public UserTwitchInfo TwitchInfo { get; set;}
2214+
22102215
/// <summary>
22112216
/// User PSN account information, if a PSN account has been linked
22122217
/// </summary>
@@ -2375,7 +2380,8 @@ public enum UserOrigination
23752380
GameCenter,
23762381
CustomId,
23772382
XboxLive,
2378-
Parse
2383+
Parse,
2384+
Twitch
23792385
}
23802386

23812387
public class UserPrivateAccountInfo
@@ -2459,6 +2465,20 @@ public class UserTitleInfo
24592465
public bool? isBanned { get; set;}
24602466
}
24612467

2468+
public class UserTwitchInfo
2469+
{
2470+
2471+
/// <summary>
2472+
/// Twitch ID
2473+
/// </summary>
2474+
public string TwitchId { get; set;}
2475+
2476+
/// <summary>
2477+
/// Twitch Username
2478+
/// </summary>
2479+
public string TwitchUserName { get; set;}
2480+
}
2481+
24622482
public class UserXboxInfo
24632483
{
24642484

0 commit comments

Comments
 (0)