Ejemplo n.º 1
0
 internal static void LoginWithCredentials(string username, string password, bool rememberMe, AssetStoreClient.DoneLoginCallback callback)
 {
     if (AssetStoreClient.sLoginState == AssetStoreClient.LoginState.IN_PROGRESS)
     {
         Debug.LogError((object)"Tried to login with credentials while already in progress of logging in");
     }
     else
     {
         AssetStoreClient.sLoginState     = AssetStoreClient.LoginState.IN_PROGRESS;
         AssetStoreClient.RememberSession = rememberMe;
         string str = AssetStoreClient.AssetStoreUrl + "/login?skip_terms=1";
         AssetStoreClient.sLoginErrorMessage = (string)null;
         AsyncHTTPClient asyncHttpClient = new AsyncHTTPClient(str.Replace("http://", "https://"));
         asyncHttpClient.postData = "user="******"&pass="******"X-Unity-Session"] = "26c4202eb475d02864b40827dfff11a14657aa41" + AssetStoreClient.GetToken();
         asyncHttpClient.doneCallback = AssetStoreClient.WrapLoginCallback(callback);
         asyncHttpClient.Begin();
     }
 }
Ejemplo n.º 2
0
 internal static void LoginWithRememberedSession(AssetStoreClient.DoneLoginCallback callback)
 {
     if (AssetStoreClient.sLoginState == AssetStoreClient.LoginState.IN_PROGRESS)
     {
         Debug.LogError((object)"Tried to login with remembered session while already in progress of logging in");
     }
     else
     {
         AssetStoreClient.sLoginState = AssetStoreClient.LoginState.IN_PROGRESS;
         if (!AssetStoreClient.RememberSession)
         {
             AssetStoreClient.SavedSessionID = string.Empty;
         }
         string _toUrl = AssetStoreClient.AssetStoreUrl + "/login?skip_terms=1&reuse_session=" + AssetStoreClient.SavedSessionID;
         AssetStoreClient.sLoginErrorMessage = (string)null;
         AsyncHTTPClient asyncHttpClient = new AsyncHTTPClient(_toUrl);
         asyncHttpClient.header["X-Unity-Session"] = "26c4202eb475d02864b40827dfff11a14657aa41" + AssetStoreClient.GetToken();
         asyncHttpClient.doneCallback = AssetStoreClient.WrapLoginCallback(callback);
         asyncHttpClient.Begin();
     }
 }