Fixed an issue with launcher freezing on day of scheduled session

This commit is contained in:
Ace73 2025-02-21 15:04:17 -08:00
parent a63030c348
commit 6305f3fc32
32 changed files with 2 additions and 5 deletions

View file

@ -160,17 +160,14 @@ namespace GameLauncher
var timeLeft = NextRC2SessionDateTime - DateTime.Now;
if (timeLeft.TotalSeconds <= 0)
{
PullSessionTimeFromLink();
timeLeft = NextRC2SessionDateTime - DateTime.Now;
CountdownLabel.Content = "ROBOCRAFT SESSION TODAY!";
}
CountdownLabel.Content = $"{timeLeft.Days} days {timeLeft.Hours} hours {timeLeft.Minutes} minutes {timeLeft.Seconds} seconds";
else { CountdownLabel.Content = $"{timeLeft.Days} days {timeLeft.Hours} hours {timeLeft.Minutes} minutes {timeLeft.Seconds} seconds"; }
});
}
private void PullSessionTimeFromLink()
{
var currentUTCtime = DateTime.UtcNow;
var Localtimezone = TimeZoneInfo.Local;
var UTCtimezone = TimeZoneInfo.Utc;
WebClient webClient = new WebClient();
NextSessionString = webClient.DownloadString(NextSessionFileLink);
string format = "M/d/yyyy h:mm:ss tt";