コード例 #1
0
 private void OnHttpResponse(WWW www)
 {
     if (www.error == null)
     {
         try
         {
             this.tokenKey    = string.Empty;
             this.tokenSecret = string.Empty;
             this.userId      = -1;
             this.uuid        = string.Empty;
             NpOAuthType npOAuthType = this.type;
             if (npOAuthType != NpOAuthType.Json)
             {
                 if (npOAuthType == NpOAuthType.MessagePack)
                 {
                     this.messagePack(www.bytes);
                 }
             }
             else
             {
                 this.json(www.text);
             }
             if (this.userId != -1)
             {
                 this.isInitialized      = true;
                 this.isInitializedError = false;
                 this.mErrData           = new NpOAuthErrData();
             }
             else if (this.isInitializedError)
             {
                 this.isInitialized = false;
             }
             else
             {
                 this.isInitialized         = false;
                 this.isInitializedError    = true;
                 this.mErrData.FailedCode   = NpOatuhFailedCodeE.NoneUserID;
                 this.mErrData.NativeErrLog = "no user_id";
             }
         }
         catch (Exception ex)
         {
             this.isInitialized         = false;
             this.isInitializedError    = true;
             this.mErrData.FailedCode   = NpOatuhFailedCodeE.OtherException;
             this.mErrData.NativeErrLog = ex.Message;
         }
     }
     else
     {
         this.isInitialized         = false;
         this.isInitializedError    = true;
         this.mErrData.FailedCode   = NpOatuhFailedCodeE.WWWFaield;
         this.mErrData.NativeErrLog = www.error;
     }
 }
コード例 #2
0
 private NpOAuth()
 {
     this.initURL            = string.Empty;
     this.counsumerKey       = string.Empty;
     this.counsumerSecret    = string.Empty;
     this.timeOut            = 10f;
     this.type               = NpOAuthType.Json;
     this.X_AppVer           = string.Empty;
     this.tokenKey           = string.Empty;
     this.tokenSecret        = string.Empty;
     this.userId             = -1;
     this.guid               = string.Empty;
     this.countryCode        = string.Empty;
     this.uuid               = string.Empty;
     this.isInitialized      = false;
     this.isInitializedError = false;
     this.mErrData           = new NpOAuthErrData();
 }