예제 #1
0
        /// <summary>Attempts to authenticate a user using a Steam Encrypted App Ticket.</summary>
        public static void AuthenticateWithSteamEncryptedAppTicket(string encodedTicket,
                                                                   Action <UserProfile> onSuccess,
                                                                   Action <WebRequestError> onError)
        {
            APIClient.RequestSteamAuthentication(encodedTicket, (t) =>
            {
                UserAuthenticationData authData = new UserAuthenticationData()
                {
                    token            = t,
                    wasTokenRejected = false,
                    steamTicket      = encodedTicket,
                    gogTicket        = null,
                };

                UserAuthenticationData.instance = authData;
                UserAccountManagement.FetchUserProfile(onSuccess, onError);
            },
                                                 (e) =>
            {
                UnityEngine.Debug.LogError(
                    $"<b>[mod.io Authentication Steam]</b> Failed with ticket: {encodedTicket}"
                    + $"{System.Environment.NewLine}{e.ToUnityDebugString()}");
                onError(e);
            }
                                                 );
        }
예제 #2
0
        /// <summary>Attempts to authenticate a user using an emailed security code.</summary>
        public static void AuthenticateWithSecurityCode(string securityCode,
                                                        Action <UserProfile> onSuccess,
                                                        Action <WebRequestError> onError)
        {
            APIClient.GetOAuthToken(securityCode, (t) =>
            {
                UserAuthenticationData authData = new UserAuthenticationData()
                {
                    token            = t,
                    wasTokenRejected = false,
                    steamTicket      = null,
                    gogTicket        = null,
                };

                UserAuthenticationData.instance = authData;
                UserAccountManagement.FetchUserProfile(onSuccess, onError);
            },
                                    onError);
        }
예제 #3
0
        /// <summary>Attempts to authenticate a user using a GOG Encrypted App Ticket.</summary>
        public static void AuthenticateWithGOGEncryptedAppTicket(string encodedTicket,
                                                                 Action <UserProfile> onSuccess,
                                                                 Action <WebRequestError> onError)
        {
            APIClient.RequestGOGAuthentication(encodedTicket, (t) =>
            {
                UserAuthenticationData authData = new UserAuthenticationData()
                {
                    token            = t,
                    wasTokenRejected = false,
                    gogTicket        = encodedTicket,
                    steamTicket      = null,
                };

                UserAuthenticationData.instance = authData;
                UserAccountManagement.FetchUserProfile(onSuccess, onError);
            },
                                               onError);
        }