// Token: 0x0600512D RID: 20781 RVA: 0x001BB4F8 File Offset: 0x001B98F8 private IEnumerator DownloadAndLoadLocalPluginCoroutine(AssetBundleDownload download) { if (!string.IsNullOrEmpty(download.pluginUrl)) { WWW www = new WWW(download.pluginUrl); www.threadPriority = UnityEngine.ThreadPriority.Normal; while (!www.isDone) { yield return(null); } if (string.IsNullOrEmpty(www.error)) { if (this.CheckForCancellation(download)) { yield break; } try { PluginManager.Instance.Load(download.pluginUrl, www.bytes); } catch (Exception ex) { download.OnPluginLoadError(ex.Message); } } else { Debug.LogError("Error loading plugin from " + download.pluginUrl + ": " + www.error); download.OnDownloadError("Error loading plugin from " + download.pluginUrl + ": " + www.error, LoadErrorReason.PluginLoadFailed); } } yield break; }
// Token: 0x0600512E RID: 20782 RVA: 0x001BB51C File Offset: 0x001B991C private IEnumerator DownloadAndLoadRemotePluginCoroutine(AssetBundleDownload download) { if (Player.Instance != null && Player.Instance.isInternal) { Debug.Log(string.Concat(new object[] { "[", download.downloadId, "] Requires plugin. About to download ", download.pluginUrl })); } if (!PluginManager.IsAllowedUrl(download.pluginUrl)) { yield break; } HTTPRequest pluginReq = null; try { pluginReq = new HTTPRequest(new Uri(download.pluginUrl), null); } catch (Exception ex) { download.OnDownloadError("Bad plugin url: " + ex.Message, LoadErrorReason.InvalidURL); yield break; } if (download.forceRefreshCache) { HTTPCacheService.DeleteEntity(pluginReq.CurrentUri, true); } pluginReq.OnProgress = new OnDownloadProgressDelegate(download.OnDownloadProgress); pluginReq.Send(); yield return(base.StartCoroutine(pluginReq)); VRC.Network.ValidateCompletedHTTPRequest(pluginReq, delegate(HTTPResponse response) { if (!this.CheckForCancellation(download)) { VRC.Core.Logger.Log("[" + download.downloadId + "] Downloaded and loading plugin...", DebugLevel.AssetBundleDownloadManager); try { PluginManager.Instance.Load(download.pluginUrl, pluginReq.Response.Data); } catch (Exception ex2) { download.OnPluginLoadError(ex2.Message); } } }, delegate(string errorStr) { string text = "Failed to download plugin from " + download.pluginUrl + " - " + errorStr; VRC.Core.Logger.LogError(string.Concat(new object[] { "[", download.downloadId, "] ", text }), DebugLevel.AssetBundleDownloadManager); download.OnDownloadError(text, LoadErrorReason.ConnectionError); }); yield break; }