private void Verify_Click(object sender, RoutedEventArgs e) { string torrentUrl; if (!GameUpdater.HttpGet("http://www.zombies.nu/dayzerotorrent.txt", out torrentUrl)) { InfoPopup popup = new InfoPopup(); popup.Headline.Content = "An Error occured."; popup.Message.Content = "Could not contact Zombies.nu.\nPlease try again."; popup.Owner = popup.Owner = MainWindow.GetWindow(this.Parent); popup.Title = "Error"; popup.Show(); return; } else { TorrentState state = TorrentUpdater.CurrentState(); if (state == TorrentState.Stopped) { TorrentUpdater verifier = new TorrentUpdater(torrentUrl); // Sets up launcher to start checking files. verifier.StartTorrents(1); } FileVerifierPopup popup = new FileVerifierPopup(); popup.Owner = MainWindow.GetWindow(this.Parent); popup.Headline.Content = "Please Wait"; popup.Title = "Please Wait"; popup.Show(); } }
public DayZUpdater() { Installer = new DayZInstaller(); Installer.PropertyChanged += (sender, args) => { if (args.PropertyName == "IsRunning") { PropertyHasChanged("InstallButtonVisible"); } else if (args.PropertyName == "Status") { if (Installer.Status == "Install complete") { CheckForUpdates(); } } }; string responseBody; if (!GameUpdater.HttpGet(dayZeroVersionUrl, out responseBody)) { Status = "Zombies.nu not responding"; return; } Version version; if (Version.TryParse(responseBody, out version)) { if (version.Equals(CalculatedGameSettings.Current.DayZVersion)) // If version is up to date. Seed. { string torrentUrl; if (!GameUpdater.HttpGet(dayZeroTorrentFileUrl, out torrentUrl)) { Status = "Zombies.nu not responding"; return; } TorrentUpdater seeder = new TorrentUpdater(torrentUrl); // Sets up launcher to start seeding current build. seeder.StartTorrents(1); } } }
public DayZUpdater() { Installer = new DayZInstaller(); Installer.PropertyChanged += (sender, args) => { if(args.PropertyName == "IsRunning") { PropertyHasChanged("InstallButtonVisible"); } else if(args.PropertyName == "Status") { if(Installer.Status == "Install complete") { CheckForUpdates(); } } }; string responseBody; if (!GameUpdater.HttpGet(dayZeroVersionUrl, out responseBody)) { Status = "Zombies.nu not responding"; return; } Version version; if (Version.TryParse(responseBody, out version)) { if (version.Equals(CalculatedGameSettings.Current.DayZVersion)) // If version is up to date. Seed. { string torrentUrl; if (!GameUpdater.HttpGet(dayZeroTorrentFileUrl, out torrentUrl)) { Status = "Zombies.nu not responding"; return; } TorrentUpdater seeder = new TorrentUpdater(torrentUrl); // Sets up launcher to start seeding current build. seeder.StartTorrents(1); } } }
private void GetDayZFiles(DayZUpdater updater) { TorrentUpdater tu = new TorrentUpdater(_latestDownloadUrl, this, updater); tu.StartTorrents(1000); }
private void GetDayZFiles(DayZUpdater updater) { TorrentUpdater tu = new TorrentUpdater(_latestDownloadUrl, this, updater); tu.StartTorrents(1000); }