[U] add PlayFab SDK and SNS login improvements
- Add PlayFabSDK as local package dependency - Add PlayFabTool.cs for PlayFab API integration - Implement LoginBySns method in TYSdkFacade - Add Android SNS login support in SDKManager and UnityBridgeFunc - Add Build Android With Debug menu option - Improve exception handling and timeout management 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
#if ENABLE_PLAYFABSERVER_API && !DISABLE_PLAYFAB_STATIC_API
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using PlayFab.MatchmakerModels;
|
||||
using PlayFab.Internal;
|
||||
|
||||
namespace PlayFab
|
||||
{
|
||||
/// <summary>
|
||||
/// Enables the use of an external match-making service in conjunction with PlayFab hosted Game Server instances
|
||||
/// </summary>
|
||||
public static class PlayFabMatchmakerAPI
|
||||
{
|
||||
static PlayFabMatchmakerAPI() {}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Clear the Client SessionToken which allows this Client to call API calls requiring login.
|
||||
/// A new/fresh login will be required after calling this.
|
||||
/// </summary>
|
||||
public static void ForgetAllCredentials()
|
||||
{
|
||||
PlayFabSettings.staticPlayer.ForgetAllCredentials();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates a user with the PlayFab service
|
||||
/// </summary>
|
||||
[Obsolete("No longer available", true)]
|
||||
public static void AuthUser(AuthUserRequest request, Action<AuthUserResponse> resultCallback, Action<PlayFabError> errorCallback, object customData = null, Dictionary<string, string> extraHeaders = null)
|
||||
{
|
||||
var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;
|
||||
var callSettings = PlayFabSettings.staticSettings;
|
||||
if (string.IsNullOrEmpty(callSettings.DeveloperSecretKey)) { throw new PlayFabException(PlayFabExceptionCode.DeveloperKeyNotSet, "Must set DeveloperSecretKey in settings to call this method"); }
|
||||
|
||||
|
||||
PlayFabHttp.MakeApiCall("/Matchmaker/AuthUser", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData, extraHeaders, context, callSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified
|
||||
/// </summary>
|
||||
[Obsolete("No longer available", true)]
|
||||
public static void PlayerJoined(PlayerJoinedRequest request, Action<PlayerJoinedResponse> resultCallback, Action<PlayFabError> errorCallback, object customData = null, Dictionary<string, string> extraHeaders = null)
|
||||
{
|
||||
var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;
|
||||
var callSettings = PlayFabSettings.staticSettings;
|
||||
if (string.IsNullOrEmpty(callSettings.DeveloperSecretKey)) { throw new PlayFabException(PlayFabExceptionCode.DeveloperKeyNotSet, "Must set DeveloperSecretKey in settings to call this method"); }
|
||||
|
||||
|
||||
PlayFabHttp.MakeApiCall("/Matchmaker/PlayerJoined", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData, extraHeaders, context, callSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified
|
||||
/// </summary>
|
||||
[Obsolete("No longer available", true)]
|
||||
public static void PlayerLeft(PlayerLeftRequest request, Action<PlayerLeftResponse> resultCallback, Action<PlayFabError> errorCallback, object customData = null, Dictionary<string, string> extraHeaders = null)
|
||||
{
|
||||
var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;
|
||||
var callSettings = PlayFabSettings.staticSettings;
|
||||
if (string.IsNullOrEmpty(callSettings.DeveloperSecretKey)) { throw new PlayFabException(PlayFabExceptionCode.DeveloperKeyNotSet, "Must set DeveloperSecretKey in settings to call this method"); }
|
||||
|
||||
|
||||
PlayFabHttp.MakeApiCall("/Matchmaker/PlayerLeft", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData, extraHeaders, context, callSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the relevant details for a specified user, which the external match-making service can then use to compute
|
||||
/// effective matches
|
||||
/// </summary>
|
||||
[Obsolete("No longer available", true)]
|
||||
public static void UserInfo(UserInfoRequest request, Action<UserInfoResponse> resultCallback, Action<PlayFabError> errorCallback, object customData = null, Dictionary<string, string> extraHeaders = null)
|
||||
{
|
||||
var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;
|
||||
var callSettings = PlayFabSettings.staticSettings;
|
||||
if (string.IsNullOrEmpty(callSettings.DeveloperSecretKey)) { throw new PlayFabException(PlayFabExceptionCode.DeveloperKeyNotSet, "Must set DeveloperSecretKey in settings to call this method"); }
|
||||
|
||||
|
||||
PlayFabHttp.MakeApiCall("/Matchmaker/UserInfo", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData, extraHeaders, context, callSettings);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user