public static void Read(string fileName)
        {
            var path = Path.Combine(Config.Instance.ReplayDir, fileName);

            if (!File.Exists(path))
            {
                return;
            }
            const string jsonFile = "replay.json";
            string       json;

            using (var fs = new FileStream(path, FileMode.Open))
                using (var archive = new ZipArchive(fs, ZipArchiveMode.Read))
                    using (var sr = new StreamReader(archive.GetEntry(jsonFile).Open()))
                        json = sr.ReadToEnd();

            var replay = (List <ReplayKeyPoint>)JsonConvert.DeserializeObject(json, typeof(List <ReplayKeyPoint>));


            var rv = new ReplayViewer();

            rv.Show();
            rv.Load(replay);
            Viewers.Add(rv);
        }
		public static void LaunchReplayViewer(string fileName)
		{
			var replay = LoadReplay(fileName);
			var rv = new ReplayViewer();
			rv.Show();
			rv.Load(replay);
			Viewers.Add(rv);
		}
Exemplo n.º 3
0
        public static void LaunchReplayViewer(string fileName, bool showHsReplayMessage)
        {
            var replay = LoadReplay(fileName);
            var rv     = new ReplayViewer(showHsReplayMessage);

            rv.Show();
            rv.Load(replay);
            Viewers.Add(rv);
        }