public void PlayReplay(Replay replay, GameVersion version)
        {
            LocalGameVersion local = _localVersionsService.GetManagedVersions().FirstOrDefault(x => x.LocalVersion.Version == version.Version).LocalVersion;

            if (local is null)
            {
                throw new InvalidOperationException("This version is not available.");
            }

            PlayReplay(replay, local);
        }
        public void PlayReplay(Replay replay, LocalGameVersion version)
        {
            string           executable = Path.Combine(version.Path, "WorldOfTanks.exe");
            ProcessStartInfo startInfo  = new ProcessStartInfo(executable)
            {
                Arguments        = string.Format("\"{0}\"", replay.Path),
                WorkingDirectory = version.Path
            };

            Process.Start(startInfo);
        }
示例#3
0
        public ImportStatus CanImport(string path)
        {
            LocalGameVersion ver = null;

            try
            {
                ver = new LocalGameVersion(Helpers.GetGameVersion(path), path);
            }
            catch (Exception ex) { }

            if (ver == null || ver.Version == null)
            {
                return(ImportStatus.INVALID_PATH);
            }

            if (_mvs.Contains(new GameVersion(ver.Version)))
            {
                return(ImportStatus.ALREADY_EXISTS);
            }

            return(ImportStatus.CAN_IMPORT);
        }