From a63030c348c376e1727b1abb1ccbd3f539f9d8a3 Mon Sep 17 00:00:00 2001 From: Ace73 <Ace73Streaming@gmail.com> Date: Wed, 19 Feb 2025 18:51:21 -0800 Subject: [PATCH] Fixed countdown timer thanks to oxxzydoom --- .../.gitignore | 0 .../Bobocraft 2 Launcher Update Assistant/App.xaml | 0 .../App.xaml.cs | 0 .../AssemblyInfo.cs | 0 .../Bobocraft 2 Launcher Update Assistant.csproj | 0 .../LauncherBackground.png | Bin .../MainWindow.xaml | 0 .../MainWindow.xaml.cs | 0 .../bobocraft 2 logo vector.png | Bin .../discord-mark-blue.png | Bin .../vector_dizzy.png | Bin .../GameLauncher.sln | 0 .../GameLauncher/App.config | 0 .../GameLauncher/App.xaml | 0 .../GameLauncher/App.xaml.cs | 0 .../GameLauncher/AssemblyInfo.cs | 0 .../GameLauncher/Bobocraft 2 Launcher.csproj | 0 .../GameLauncher/LauncherBackground.png | Bin .../GameLauncher/MainWindow.xaml | 0 .../GameLauncher/MainWindow.xaml.cs | 13 ++++++++----- .../GameLauncher/Properties/Settings.Designer.cs | 0 .../GameLauncher/Properties/Settings.settings | 0 .../GameLauncher/avatar.png | Bin .../GameLauncher/bobocraft 2 logo vector.png | Bin .../GameLauncher/discord-mark-blue.png | Bin .../GameLauncher/images/Icon.ico | Bin .../GameLauncher/images/LauncherBackground.png | Bin .../GameLauncher/shape_square.png | Bin .../GameLauncher/vector_dizzy.png | Bin .../Licence.txt | 0 .../README.md | 0 .../VisualStudio.gitignore | 0 32 files changed, 8 insertions(+), 5 deletions(-) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/.gitignore (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/App.xaml (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/App.xaml.cs (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/AssemblyInfo.cs (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/Bobocraft 2 Launcher Update Assistant.csproj (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/LauncherBackground.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml.cs (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/bobocraft 2 logo vector.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/discord-mark-blue.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Bobocraft 2 Launcher Update Assistant/vector_dizzy.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher.sln (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/App.config (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/App.xaml (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/App.xaml.cs (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/AssemblyInfo.cs (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/Bobocraft 2 Launcher.csproj (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/LauncherBackground.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/MainWindow.xaml (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/MainWindow.xaml.cs (97%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/Properties/Settings.Designer.cs (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/Properties/Settings.settings (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/avatar.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/bobocraft 2 logo vector.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/discord-mark-blue.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/images/Icon.ico (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/images/LauncherBackground.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/shape_square.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/GameLauncher/vector_dizzy.png (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/Licence.txt (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/README.md (100%) rename {Bobocraft 2 Launcher v9 CSC => Bobocraft 2 Launcher v10 fixed countdown}/VisualStudio.gitignore (100%) diff --git a/Bobocraft 2 Launcher v9 CSC/.gitignore b/Bobocraft 2 Launcher v10 fixed countdown/.gitignore similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/.gitignore rename to Bobocraft 2 Launcher v10 fixed countdown/.gitignore diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/App.xaml b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/App.xaml similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/App.xaml rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/App.xaml diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/App.xaml.cs b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/App.xaml.cs similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/App.xaml.cs rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/App.xaml.cs diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/AssemblyInfo.cs b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/AssemblyInfo.cs similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/AssemblyInfo.cs rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/AssemblyInfo.cs diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/Bobocraft 2 Launcher Update Assistant.csproj b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/Bobocraft 2 Launcher Update Assistant.csproj similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/Bobocraft 2 Launcher Update Assistant.csproj rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/Bobocraft 2 Launcher Update Assistant.csproj diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/LauncherBackground.png b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/LauncherBackground.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/LauncherBackground.png rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/LauncherBackground.png diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml.cs b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml.cs similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml.cs rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/MainWindow.xaml.cs diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/bobocraft 2 logo vector.png b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/bobocraft 2 logo vector.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/bobocraft 2 logo vector.png rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/bobocraft 2 logo vector.png diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/discord-mark-blue.png b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/discord-mark-blue.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/discord-mark-blue.png rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/discord-mark-blue.png diff --git a/Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/vector_dizzy.png b/Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/vector_dizzy.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Bobocraft 2 Launcher Update Assistant/vector_dizzy.png rename to Bobocraft 2 Launcher v10 fixed countdown/Bobocraft 2 Launcher Update Assistant/vector_dizzy.png diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher.sln b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher.sln similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher.sln rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher.sln diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/App.config b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/App.config similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/App.config rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/App.config diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/App.xaml b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/App.xaml similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/App.xaml rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/App.xaml diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/App.xaml.cs b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/App.xaml.cs similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/App.xaml.cs rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/App.xaml.cs diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/AssemblyInfo.cs b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/AssemblyInfo.cs similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/AssemblyInfo.cs rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/AssemblyInfo.cs diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/Bobocraft 2 Launcher.csproj b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/Bobocraft 2 Launcher.csproj similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/Bobocraft 2 Launcher.csproj rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/Bobocraft 2 Launcher.csproj diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/LauncherBackground.png b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/LauncherBackground.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/LauncherBackground.png rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/LauncherBackground.png diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/MainWindow.xaml b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/MainWindow.xaml similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/MainWindow.xaml rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/MainWindow.xaml diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/MainWindow.xaml.cs b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/MainWindow.xaml.cs similarity index 97% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/MainWindow.xaml.cs rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/MainWindow.xaml.cs index 3afa756..38eaa3b 100644 --- a/Bobocraft 2 Launcher v9 CSC/GameLauncher/MainWindow.xaml.cs +++ b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/MainWindow.xaml.cs @@ -11,6 +11,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Timers; +using System.Globalization; namespace GameLauncher { @@ -172,7 +173,10 @@ namespace GameLauncher var UTCtimezone = TimeZoneInfo.Utc; WebClient webClient = new WebClient(); NextSessionString = webClient.DownloadString(NextSessionFileLink); - NextRC2SessionDateTime = DateTime.Parse(NextSessionString); + string format = "M/d/yyyy h:mm:ss tt"; + CultureInfo culture = CultureInfo.InvariantCulture; + DateTime.TryParseExact(NextSessionString, format, culture, DateTimeStyles.None, out DateTime parsedDate); + NextRC2SessionDateTime = parsedDate; if (NextRC2SessionDateTime > DateTime.UtcNow) { NextRC2SessionDateTime = TimeZoneInfo.ConvertTime(NextRC2SessionDateTime, Localtimezone); @@ -190,10 +194,9 @@ namespace GameLauncher var daysUntilFriday = ((int)DayOfWeek.Friday - (int)currentUTCtime.DayOfWeek + 7) % 7; var nextFriday = currentUTCtime.AddDays(daysUntilFriday); var PSTtimezone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); - var Localtimezone = TimeZoneInfo.Local; - NextRC2SessionDateTime = new DateTime(nextFriday.Year, nextFriday.Month, nextFriday.Day, 9, 0, 0, DateTimeKind.Unspecified); - NextRC2SessionDateTime = TimeZoneInfo.ConvertTime(NextRC2SessionDateTime, PSTtimezone); - NextRC2SessionDateTime = TimeZoneInfo.ConvertTime(NextRC2SessionDateTime, Localtimezone); + var nextFridayPST = new DateTime(nextFriday.Year, nextFriday.Month, nextFriday.Day, 9, 0, 0, DateTimeKind.Unspecified); + var nextFridayUTC = TimeZoneInfo.ConvertTimeToUtc(nextFridayPST, PSTtimezone); + NextRC2SessionDateTime = TimeZoneInfo.ConvertTimeFromUtc(nextFridayUTC, TimeZoneInfo.Local); } diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/Properties/Settings.Designer.cs b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/Properties/Settings.Designer.cs similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/Properties/Settings.Designer.cs rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/Properties/Settings.Designer.cs diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/Properties/Settings.settings b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/Properties/Settings.settings similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/Properties/Settings.settings rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/Properties/Settings.settings diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/avatar.png b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/avatar.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/avatar.png rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/avatar.png diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/bobocraft 2 logo vector.png b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/bobocraft 2 logo vector.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/bobocraft 2 logo vector.png rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/bobocraft 2 logo vector.png diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/discord-mark-blue.png b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/discord-mark-blue.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/discord-mark-blue.png rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/discord-mark-blue.png diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/images/Icon.ico b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/images/Icon.ico similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/images/Icon.ico rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/images/Icon.ico diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/images/LauncherBackground.png b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/images/LauncherBackground.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/images/LauncherBackground.png rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/images/LauncherBackground.png diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/shape_square.png b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/shape_square.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/shape_square.png rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/shape_square.png diff --git a/Bobocraft 2 Launcher v9 CSC/GameLauncher/vector_dizzy.png b/Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/vector_dizzy.png similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/GameLauncher/vector_dizzy.png rename to Bobocraft 2 Launcher v10 fixed countdown/GameLauncher/vector_dizzy.png diff --git a/Bobocraft 2 Launcher v9 CSC/Licence.txt b/Bobocraft 2 Launcher v10 fixed countdown/Licence.txt similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/Licence.txt rename to Bobocraft 2 Launcher v10 fixed countdown/Licence.txt diff --git a/Bobocraft 2 Launcher v9 CSC/README.md b/Bobocraft 2 Launcher v10 fixed countdown/README.md similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/README.md rename to Bobocraft 2 Launcher v10 fixed countdown/README.md diff --git a/Bobocraft 2 Launcher v9 CSC/VisualStudio.gitignore b/Bobocraft 2 Launcher v10 fixed countdown/VisualStudio.gitignore similarity index 100% rename from Bobocraft 2 Launcher v9 CSC/VisualStudio.gitignore rename to Bobocraft 2 Launcher v10 fixed countdown/VisualStudio.gitignore