コード例 #1
0
 public virtual void Initialize(DownloadState downloadState, ServerConfiguration serverConfiguration,
                                DownloadPresenter downloadPresenter)
 {
     this.downloadState       = downloadState;
     this.serverConfiguration = serverConfiguration;
     this.downloadPresenter   = downloadPresenter;
 }
コード例 #2
0
    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/");
        };
    }
コード例 #3
0
ファイル: DownloadState.cs プロジェクト: binff04/MobileUO
    public DownloadState(DownloadPresenter downloadPresenter, bool forceDownloadsInEditor, Canvas inGameDebugConsoleCanvas)
    {
        this.downloadPresenter        = downloadPresenter;
        this.inGameDebugConsoleCanvas = inGameDebugConsoleCanvas;

        downloadPresenter.backButtonPressed += OnBackButtonPressed;
        this.forceDownloadsInEditor          = forceDownloadsInEditor;
    }
コード例 #4
0
ファイル: DownloadState.cs プロジェクト: kgns/MobileUO
    public DownloadState(DownloadPresenter downloadPresenter, Canvas inGameDebugConsoleCanvas)
    {
        this.downloadPresenter        = downloadPresenter;
        this.inGameDebugConsoleCanvas = inGameDebugConsoleCanvas;

        downloadPresenter.BackButtonPressed += OnBackButtonPressed;
        downloadPresenter.CellularWarningYesButtonPressed += OnCellularWarningYesButtonPressed;
        downloadPresenter.CellularWarningNoButtonPressed  += OnCellularWarningNoButtonPressed;
    }
コード例 #5
0
    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();
        };
    }
コード例 #6
0
ファイル: DownloadState.cs プロジェクト: Juzzver/MobileUO
 public DownloadState(DownloadPresenter downloadPresenter)
 {
     this.downloadPresenter = downloadPresenter;
     downloadPresenter.backButtonPressed += OnBackButtonPressed;
 }
コード例 #7
0
 public FileDownloader Create(DownloadPresenter presenter, bool allowCancellation, IWebProxy proxy = null)
 {
     return(new BasicFileDownloader(presenter, allowCancellation, proxy));
 }
コード例 #8
0
    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());
    }
コード例 #9
0
 public BasicFileDownloader(DownloadPresenter presenter, bool allowCancellation, IWebProxy proxy)
 {
     _presenter         = presenter;
     _allowCancellation = allowCancellation;
     _proxy             = proxy;
 }
コード例 #10
0
 public virtual void Dispose()
 {
     downloadState       = null;
     serverConfiguration = null;
     downloadPresenter   = null;
 }
コード例 #11
0
 public DownloadState(DownloadPresenter downloadPresenter, bool forceDownloadsInEditor)
 {
     this.downloadPresenter = downloadPresenter;
     downloadPresenter.backButtonPressed += OnBackButtonPressed;
     this.forceDownloadsInEditor          = forceDownloadsInEditor;
 }