コード例 #1
0
        private static AsyncHTTPClient CreateJSONRequestDelete(string url, AssetStoreClient.DoneCallback callback)
        {
            AsyncHTTPClient asyncHttpClient = new AsyncHTTPClient(url, "DELETE");

            asyncHttpClient.header["X-Unity-Session"] = AssetStoreClient.ActiveOrUnauthSessionID + AssetStoreClient.GetToken();
            asyncHttpClient.doneCallback = AssetStoreClient.WrapJsonCallback(callback);
            asyncHttpClient.Begin();
            return(asyncHttpClient);
        }
コード例 #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();
     }
 }
コード例 #3
0
        private static AsyncHTTPClient CreateJSONRequestPost(string url, Dictionary <string, string> param, AssetStoreClient.DoneCallback callback)
        {
            AsyncHTTPClient asyncHttpClient = new AsyncHTTPClient(url);

            asyncHttpClient.header["X-Unity-Session"] = AssetStoreClient.ActiveOrUnauthSessionID + AssetStoreClient.GetToken();
            asyncHttpClient.postDictionary            = param;
            asyncHttpClient.doneCallback = AssetStoreClient.WrapJsonCallback(callback);
            asyncHttpClient.Begin();
            return(asyncHttpClient);
        }
コード例 #4
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();
     }
 }