Exemple #1
0
        } // OnTimeOut

        protected void RestartTransaction(Transaction transaction)
        {
            this.UpdateTransactionTry(transaction.id);
            this.SetTransactionStatus(transaction.id, transactionStatus.needResend);
            this.SetTransactionStartTime(transaction.id, Ucss.Common.GetSeconds());

            HTTPRequest request = (HTTPRequest)transaction.request;

            StopCoroutine(request.coroutine);
            transaction.www.Dispose();
            this.SetTransactionWWW(transaction.id, null);
            request.coroutine = StartCoroutine(request.coroutineFactory());
        } // RestartTransaction
Exemple #2
0
        public string GetMovie(string url, EventHandlerMovieTexture movieCallback, EventHandlerServiceError onError = null, EventHandlerServiceTimeOut onTimeOut = null, int timeOut = 0)
        {
            HTTPRequest request = new HTTPRequest();

            request.url                  = url;
            request.transactionId        = UCSS.GenerateTransactionId(Common.Md5Sum(url));
            request.movieTextureCallback = movieCallback;
            request.onError              = onError;
            request.onTimeOut            = onTimeOut;
            request.timeOut              = timeOut;

            request.coroutineFactory = RunGetDataCoroutineFactory(request);
            request.coroutine        = StartCoroutine(request.coroutineFactory());
            return(request.transactionId);
        }
Exemple #3
0
        public string PostForm(string url, WWWForm formData, EventHandlerHTTPBytes bytesCallback, EventHandlerServiceError onError = null, EventHandlerServiceTimeOut onTimeOut = null, int timeOut = 0)
        {
            HTTPRequest request = new HTTPRequest();

            request.url           = url;
            request.formData      = formData;
            request.transactionId = UCSS.GenerateTransactionId(Common.Md5Sum(url));
            request.bytesCallback = bytesCallback;
            request.onError       = onError;
            request.onTimeOut     = onTimeOut;
            request.timeOut       = timeOut;

            request.coroutineFactory = RunPostFormCoroutineFactory(request);
            request.coroutine        = StartCoroutine(request.coroutineFactory());
            return(request.transactionId);
        }
Exemple #4
0
        public string PostBytes(string url, byte[] bytes, Dictionary <string, string> headers, EventHandlerHTTPString stringCallback, EventHandlerServiceError onError = null, EventHandlerServiceTimeOut onTimeOut = null, int timeOut = 0)
        {
            HTTPRequest request = new HTTPRequest();

            request.url            = url;
            request.bytes          = bytes;
            request.headers        = headers;
            request.transactionId  = UCSS.GenerateTransactionId(Common.Md5Sum(url));
            request.stringCallback = stringCallback;
            request.onError        = onError;
            request.onTimeOut      = onTimeOut;
            request.timeOut        = timeOut;

            request.coroutineFactory = RunPostBytesCoroutineFactory(request);
            request.coroutine        = StartCoroutine(request.coroutineFactory());
            return(request.transactionId);
        }
Exemple #5
0
        // *** END post bytes ***

        // *** POST FORM ***
        public void PostForm(HTTPRequest request)
        {
            request.coroutineFactory = RunPostFormCoroutineFactory(request);
            request.coroutine        = StartCoroutine(request.coroutineFactory());
        }
Exemple #6
0
        // *** END AudioClip ***

        // *** Movie ***
#if UNITY_PRO_LICENSE && !UNITY_WEBGL
        public void GetMovie(HTTPRequest request)
        {
            request.coroutineFactory = RunGetDataCoroutineFactory(request);
            request.coroutine        = StartCoroutine(request.coroutineFactory());
        }
Exemple #7
0
 public void GetAssetBundleOrCache(HTTPRequest request)
 {
     request.coroutineFactory = RunGetAssetBundleCoroutineFactory(request);
     request.coroutine        = StartCoroutine(request.coroutineFactory());
 }