public virtual void Initialize(DownloadState downloadState, ServerConfiguration serverConfiguration, DownloadPresenter downloadPresenter) { this.downloadState = downloadState; this.serverConfiguration = serverConfiguration; this.downloadPresenter = downloadPresenter; }
public override void Initialize(DownloadState downloadState, ServerConfiguration serverConfiguration, DownloadPresenter downloadPresenter) { base.Initialize(downloadState, serverConfiguration, downloadPresenter); var port = int.Parse(serverConfiguration.FileDownloadServerPort); //Make payload.json request var uri = DownloadState.GetUri(serverConfiguration.FileDownloadServerUrl, port, "downloads/launcher/payload.json"); var request = UnityWebRequest.Get(uri); request.SendWebRequest().completed += operation => { if (request.isHttpError || request.isNetworkError) { var error = $"Error while making initial request to server: {request.error}"; downloadState.StopAndShowError(error); return; } var payloadDictionary = JToken.Parse(request.downloadHandler.text); var files = payloadDictionary["Files"].Select(x => x["Name"].Value <string>()); //Find the files with the right extension var filesToDownload = files.Where(x => DownloadState.NeededUoFileExtensions.Any(x.Contains)).ToList(); //Get rid of paths with backslash in them now to prevent downloading files from subdirectories filesToDownload.RemoveAll(x => x.Contains("\\")); downloadState.SetFileListAndDownload(filesToDownload, "downloads/launcher/client/"); }; }
public DownloadState(DownloadPresenter downloadPresenter, bool forceDownloadsInEditor, Canvas inGameDebugConsoleCanvas) { this.downloadPresenter = downloadPresenter; this.inGameDebugConsoleCanvas = inGameDebugConsoleCanvas; downloadPresenter.backButtonPressed += OnBackButtonPressed; this.forceDownloadsInEditor = forceDownloadsInEditor; }
public DownloadState(DownloadPresenter downloadPresenter, Canvas inGameDebugConsoleCanvas) { this.downloadPresenter = downloadPresenter; this.inGameDebugConsoleCanvas = inGameDebugConsoleCanvas; downloadPresenter.BackButtonPressed += OnBackButtonPressed; downloadPresenter.CellularWarningYesButtonPressed += OnCellularWarningYesButtonPressed; downloadPresenter.CellularWarningNoButtonPressed += OnCellularWarningNoButtonPressed; }
public override void Initialize(DownloadState downloadState, ServerConfiguration serverConfiguration, DownloadPresenter downloadPresenter) { base.Initialize(downloadState, serverConfiguration, downloadPresenter); port = int.Parse(serverConfiguration.FileDownloadServerPort); //Make version request var uri = DownloadState.GetUri(serverConfiguration.FileDownloadServerUrl, port, "Version"); var request = UnityWebRequest.Get(uri); request.SendWebRequest().completed += operation => { if (request.isHttpError || request.isNetworkError) { var error = $"Error while making initial request to server: {request.error}"; downloadState.StopAndShowError(error); return; } var outlandsVersion = request.downloadHandler.text; Debug.Log($"Request result text (outlands version): {outlandsVersion}"); var previousOutlandsVersion = PlayerPrefs.GetString(OUTLANDS_VERSION_PREF_KEY, string.Empty); if (string.IsNullOrEmpty(previousOutlandsVersion)) { //First time reaching to outlands servers PlayerPrefs.SetString(OUTLANDS_VERSION_PREF_KEY, outlandsVersion); } else if (previousOutlandsVersion == outlandsVersion) { //Same as before } else { //New version } GetManifest(); }; }
public DownloadState(DownloadPresenter downloadPresenter) { this.downloadPresenter = downloadPresenter; downloadPresenter.backButtonPressed += OnBackButtonPressed; }
public FileDownloader Create(DownloadPresenter presenter, bool allowCancellation, IWebProxy proxy = null) { return(new BasicFileDownloader(presenter, allowCancellation, proxy)); }
public override void Initialize(DownloadState downloadState, ServerConfiguration serverConfiguration, DownloadPresenter downloadPresenter) { base.Initialize(downloadState, serverConfiguration, downloadPresenter); pathToSaveFiles = serverConfiguration.GetPathToSaveFiles(); port = int.Parse(serverConfiguration.FileDownloadServerPort); filesToDownload = downloadState.FilesToDownload; resourcePathForFilesToDownload = downloadState.ResourcePathForFilesToDownload ?? ""; numberOfFilesToDownload = filesToDownload.Count; downloadPresenter.SetFileList(filesToDownload); downloadCoroutine = downloadPresenter.StartCoroutine(DownloadFiles()); }
public BasicFileDownloader(DownloadPresenter presenter, bool allowCancellation, IWebProxy proxy) { _presenter = presenter; _allowCancellation = allowCancellation; _proxy = proxy; }
public virtual void Dispose() { downloadState = null; serverConfiguration = null; downloadPresenter = null; }
public DownloadState(DownloadPresenter downloadPresenter, bool forceDownloadsInEditor) { this.downloadPresenter = downloadPresenter; downloadPresenter.backButtonPressed += OnBackButtonPressed; this.forceDownloadsInEditor = forceDownloadsInEditor; }