diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index b9bc107..8013ab9 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -170,7 +170,7 @@ namespace Bloxstrap CheckInstall(); - await RbxFpsUnlocker.CheckInstall(); + IntegrationMigrator.Execute(); // at this point we've finished updating our configs App.Settings.Save(); @@ -353,25 +353,6 @@ namespace Bloxstrap if (!startEventFired) return; } - - if (App.Settings.Prop.RFUEnabled && Process.GetProcessesByName(RbxFpsUnlocker.ApplicationName).Length == 0) - { - App.Logger.WriteLine("[Bootstrapper::StartRoblox] Using rbxfpsunlocker"); - - ProcessStartInfo startInfo = new() - { - WorkingDirectory = Path.Combine(Directories.Integrations, "rbxfpsunlocker"), - FileName = Path.Combine(Directories.Integrations, @"rbxfpsunlocker\rbxfpsunlocker.exe") - }; - - Process process = Process.Start(startInfo)!; - - if (App.Settings.Prop.RFUAutoclose) - { - shouldWait = true; - autocloseProcesses.Add(process); - } - } if (App.Settings.Prop.UseDiscordRichPresence || App.Settings.Prop.ShowServerDetails) { diff --git a/Bloxstrap/Helpers/FastFlagManager.cs b/Bloxstrap/Helpers/FastFlagManager.cs index 7558aa2..1341731 100644 --- a/Bloxstrap/Helpers/FastFlagManager.cs +++ b/Bloxstrap/Helpers/FastFlagManager.cs @@ -71,7 +71,12 @@ namespace Bloxstrap.Helpers // set to 99999 by default if it doesnt immediately exist if (GetValue("DFIntTaskSchedulerTargetFps") is null) - SetValue("DFIntTaskSchedulerTargetFps", 99999); + { + SetValue("DFIntTaskSchedulerTargetFps", 9999); + + if (!App.IsFirstRun) + Save(); + } } public override void Save() diff --git a/Bloxstrap/Helpers/IntegrationMigrator.cs b/Bloxstrap/Helpers/IntegrationMigrator.cs new file mode 100644 index 0000000..4d3b4f7 --- /dev/null +++ b/Bloxstrap/Helpers/IntegrationMigrator.cs @@ -0,0 +1,18 @@ +using System.IO; + +namespace Bloxstrap.Helpers +{ + static class IntegrationMigrator + { + public static void Execute() + { + App.FastFlags.Load(); + + // v2.2.0 - remove rbxfpsunlocker + string rbxfpsunlocker = Path.Combine(Directories.Integrations, "rbxfpsunlocker"); + + if (Directory.Exists(rbxfpsunlocker)) + Directory.Delete(rbxfpsunlocker, true); + } + } +} diff --git a/Bloxstrap/Integrations/RbxFpsUnlocker.cs b/Bloxstrap/Integrations/RbxFpsUnlocker.cs deleted file mode 100644 index bb56886..0000000 --- a/Bloxstrap/Integrations/RbxFpsUnlocker.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.IO.Compression; -using System.Threading.Tasks; -using Bloxstrap.Helpers; - -using Bloxstrap.Models; - -namespace Bloxstrap.Integrations -{ - internal class RbxFpsUnlocker - { - public const string ApplicationName = "rbxfpsunlocker"; - public const string ProjectRepository = "axstin/rbxfpsunlocker"; - - // default settings but with QuickStart set to true and CheckForUpdates set to false - private static readonly string Settings = - "UnlockClient=true\n" + - "UnlockStudio=false\n" + - "FPSCapValues=[30.000000, 60.000000, 75.000000, 120.000000, 144.000000, 165.000000, 240.000000, 360.000000]\n" + - "FPSCapSelection=0\n" + - "FPSCap=0.000000\n" + - "CheckForUpdates=false\n" + - "NonBlockingErrors=true\n" + - "SilentErrors=false\n" + - "QuickStart=true\n"; - - public static void CheckIfRunning() - { - Process[] processes = Process.GetProcessesByName(ApplicationName); - - if (processes.Length == 0) - return; - - App.Logger.WriteLine("[RbxFpsUnlocker::CheckIfRunning] Closing currently running rbxfpsunlocker processes..."); - - try - { - foreach (Process process in processes) - { - if (process.MainModule?.FileName is null) - continue; - - if (!process.MainModule.FileName.Contains(Directories.Base)) - continue; - - process.Kill(); - process.Close(); - } - } - catch (Exception ex) - { - App.Logger.WriteLine($"[RbxFpsUnlocker::CheckIfRunning] Could not close rbxfpsunlocker process! {ex}"); - } - } - - public static async Task CheckInstall() - { - string folderLocation = Path.Combine(Directories.Base, "Integrations\\rbxfpsunlocker"); - string fileLocation = Path.Combine(folderLocation, "rbxfpsunlocker.exe"); - string settingsLocation = Path.Combine(folderLocation, "settings"); - - if (!App.Settings.Prop.RFUEnabled) - { - // don't delete rbxfpsunlocker if rbxfpsunlocker and roblox is currently running - if (Utilities.CheckIfProcessRunning(ApplicationName) && Utilities.CheckIfRobloxRunning()) - return; - - App.State.Prop.RbxFpsUnlockerVersion = ""; - App.State.Save(); - - if (Directory.Exists(folderLocation)) - { - CheckIfRunning(); - Directory.Delete(folderLocation, true); - } - - return; - } - - var releaseInfo = await Utilities.GetJson($"https://api.github.com/repos/{ProjectRepository}/releases/latest"); - - if (releaseInfo is null || releaseInfo.Assets is null) - return; - - string downloadUrl = releaseInfo.Assets[0].BrowserDownloadUrl; - - DirectoryInfo directory = new(folderLocation); - directory.Create(); - // i have no idea how the read only flag enables itself but apparently it just does - directory.Attributes &= ~FileAttributes.ReadOnly; - - if (File.Exists(fileLocation)) - { - // no new release published, return - if (App.State.Prop.RbxFpsUnlockerVersion == releaseInfo.TagName) - return; - - CheckIfRunning(); - File.Delete(fileLocation); - } - - App.Logger.WriteLine("[RbxFpsUnlocker::CheckInstall] Installing/Updating rbxfpsunlocker..."); - - { - byte[] bytes = await App.HttpClient.GetByteArrayAsync(downloadUrl); - - using MemoryStream zipStream = new(bytes); - using ZipArchive archive = new(zipStream); - - archive.ExtractToDirectory(folderLocation, true); - } - - if (!File.Exists(settingsLocation)) - await File.WriteAllTextAsync(settingsLocation, Settings); - - App.State.Prop.RbxFpsUnlockerVersion = releaseInfo.TagName; - App.State.Save(); - } - } -} diff --git a/Bloxstrap/Models/Settings.cs b/Bloxstrap/Models/Settings.cs index a8e96b6..95b1b8e 100644 --- a/Bloxstrap/Models/Settings.cs +++ b/Bloxstrap/Models/Settings.cs @@ -25,8 +25,6 @@ namespace Bloxstrap.Models // integration configuration public bool UseDiscordRichPresence { get; set; } = true; public bool HideRPCButtons { get; set; } = true; - public bool RFUEnabled { get; set; } = false; - public bool RFUAutoclose { get; set; } = false; public bool UseReShade { get; set; } = true; public bool UseReShadeExtraviPresets { get; set; } = true; public bool ShowServerDetails { get; set; } = false; diff --git a/Bloxstrap/Models/State.cs b/Bloxstrap/Models/State.cs index fcc2d7c..be8c221 100644 --- a/Bloxstrap/Models/State.cs +++ b/Bloxstrap/Models/State.cs @@ -9,7 +9,6 @@ namespace Bloxstrap.Models public class State { public string VersionGuid { get; set; } = ""; - public string RbxFpsUnlockerVersion { get; set; } = ""; public string ReShadeConfigVersion { get; set; } = ""; public string ExtraviReShadePresetsVersion { get; set; } = ""; public List ModManifest { get; set; } = new(); diff --git a/Bloxstrap/ViewModels/IntegrationsViewModel.cs b/Bloxstrap/ViewModels/IntegrationsViewModel.cs index e242d81..ca876b2 100644 --- a/Bloxstrap/ViewModels/IntegrationsViewModel.cs +++ b/Bloxstrap/ViewModels/IntegrationsViewModel.cs @@ -97,23 +97,6 @@ namespace Bloxstrap.ViewModels set => App.Settings.Prop.UseReShadeExtraviPresets = value; } - public bool RbxFpsUnlockerEnabled - { - get => App.Settings.Prop.RFUEnabled; - set - { - App.Settings.Prop.RFUEnabled = value; - RbxFpsUnlockerAutocloseEnabled = value; - OnPropertyChanged(nameof(RbxFpsUnlockerAutocloseEnabled)); - } - } - - public bool RbxFpsUnlockerAutocloseEnabled - { - get => App.Settings.Prop.RFUAutoclose; - set => App.Settings.Prop.RFUAutoclose = value; - } - public bool ShowServerDetailsEnabled { get => App.Settings.Prop.ShowServerDetails; diff --git a/Bloxstrap/Views/Pages/AboutPage.xaml b/Bloxstrap/Views/Pages/AboutPage.xaml index 2a31eee..8130c33 100644 --- a/Bloxstrap/Views/Pages/AboutPage.xaml +++ b/Bloxstrap/Views/Pages/AboutPage.xaml @@ -137,12 +137,6 @@ - - - - - - diff --git a/Bloxstrap/Views/Pages/IntegrationsPage.xaml b/Bloxstrap/Views/Pages/IntegrationsPage.xaml index 8aebf4f..a204986 100644 --- a/Bloxstrap/Views/Pages/IntegrationsPage.xaml +++ b/Bloxstrap/Views/Pages/IntegrationsPage.xaml @@ -93,28 +93,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -127,7 +105,7 @@ - + diff --git a/Bloxstrap/Views/Pages/IntegrationsPage.xaml.cs b/Bloxstrap/Views/Pages/IntegrationsPage.xaml.cs index c4066ab..5809833 100644 --- a/Bloxstrap/Views/Pages/IntegrationsPage.xaml.cs +++ b/Bloxstrap/Views/Pages/IntegrationsPage.xaml.cs @@ -15,10 +15,6 @@ namespace Bloxstrap.Views.Pages { DataContext = new IntegrationsViewModel(); InitializeComponent(); - - // rbxfpsunlocker does not have 64 bit support - if (!Environment.Is64BitOperatingSystem) - this.RbxFpsUnlockerOptions.Visibility = Visibility.Collapsed; } public void CustomIntegrationSelection(object sender, SelectionChangedEventArgs e) diff --git a/Bloxstrap/Views/Pages/ModsPage.xaml b/Bloxstrap/Views/Pages/ModsPage.xaml index 29e0a25..1c19abc 100644 --- a/Bloxstrap/Views/Pages/ModsPage.xaml +++ b/Bloxstrap/Views/Pages/ModsPage.xaml @@ -106,7 +106,7 @@ - +