コード例 #1
0
        public async Task <bool> UpdateClientFiles()
        {
            var currentClientVersion = GetCurrentClientVersion();

            if (currentClientVersion == null)
            {
                return(await TryDownloadNewClientFiles());
            }

            var newestClientVersion = await TryGetNewestClientVersion();

            if (newestClientVersion == null)
            {
                return(true);
            }

            _logger.Write($"Current client version: {currentClientVersion}, newest client version: {newestClientVersion}");

            if (currentClientVersion == newestClientVersion)
            {
                return(true);
            }

#if DEBUG
            return(true);
#endif

            if (!ShouldDownloadNewClientVersion(currentClientVersion, newestClientVersion))
            {
                return(true);
            }

            _splashScreenProgressProvider.SetCurrentStep(SplashScreenProgressStep.DownloadNewClient);
            return(await TryDownloadNewClientFiles());
        }
コード例 #2
0
        public async Task <Process> LaunchGame(GameLaunchMode launchMode, bool joinServer = false)
        {
            if (!_settingsProvider.GetCurrentSettings().AcceptedEula)
            {
                return(null);
            }

            if (IsLaunching)
            {
                return(null);
            }

            IsLaunching = true;

            if (!joinServer)
            {
                SetJoinServerAddress(null);
            }

            _logger.Write($"Launching game. ({launchMode})");

            _notificationService.ShowNotification("Launching game...", Notification.ShortMessageDelay);
            _splashScreenProgressProvider.SetCurrentStep(SplashScreenProgressStep.Initializing);

            var gameProcess = launchMode == GameLaunchMode.Multiplayer ? await ExecuteGrandTheftMultiplayerLaunchSteps() : await ExecuteGtaLaunchSteps();

            IsLaunching = false;

            return(gameProcess);
        }