Skip to content

Commit

Permalink
Make rbxfpsunlocker updating more reliable (#46)
Browse files Browse the repository at this point in the history
depending on file timestamps suck
  • Loading branch information
pizzaboxer committed Nov 14, 2022
1 parent 7295a8e commit a39ce6b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
5 changes: 4 additions & 1 deletion Bloxstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ public async Task Run()
//if (Program.IsFirstRun)
// Dialog.ShowSuccess($"{Program.ProjectName} has been installed");
//else
await StartRoblox();

Program.SettingsManager.Save();

await StartRoblox();

Program.Exit();
}
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/Dialogs/Preferences.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<GroupBox Grid.Column="0" Header="Discord Rich Presence" Margin="10,10,5,5">
<StackPanel VerticalAlignment="Center">
<CheckBox x:Name="CheckBoxDRPEnabled" Content=" Show game activity" Margin="5" VerticalAlignment="Top" IsChecked="{Binding DRPEnabled, Mode=TwoWay}" />
<CheckBox x:Name="CheckBoxDRPButtons" Content=" Show activity buttons" Margin="5" VerticalAlignment="Top" IsEnabled="{Binding IsChecked, ElementName=CheckBoxDRPEnabled, Mode=OneWay}" IsChecked="{Binding DRPButtons, Mode=TwoWay}" />
<CheckBox x:Name="CheckBoxDRPButtons" Content=" Allow others to join" Margin="5" VerticalAlignment="Top" IsEnabled="{Binding IsChecked, ElementName=CheckBoxDRPEnabled, Mode=OneWay}" IsChecked="{Binding DRPButtons, Mode=TwoWay}" />
</StackPanel>
</GroupBox>
<GroupBox Grid.Column="1" Header="FPS Unlocking" Margin="5,10,10,5">
Expand Down
1 change: 0 additions & 1 deletion Bloxstrap/Helpers/Integrations/DiscordRichPresence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ private async Task ExamineLogEntry(string entry)
ActivityMachineAddress = "";
await SetPresence();
}

}

public async void MonitorGameActivity()
Expand Down
12 changes: 4 additions & 8 deletions Bloxstrap/Helpers/Integrations/RbxFpsUnlocker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,19 @@ public static async Task CheckInstall()
return;
}

DateTime lastReleasePublish;
string downloadUrl;

var releaseInfo = await Utilities.GetJson<GithubRelease>($"https://api.github.com/repos/{ProjectRepository}/releases/latest");

if (releaseInfo is null || releaseInfo.Assets is null)
return;

lastReleasePublish = DateTime.Parse(releaseInfo.CreatedAt);
downloadUrl = releaseInfo.Assets[0].BrowserDownloadUrl;
string downloadUrl = releaseInfo.Assets[0].BrowserDownloadUrl;

Directory.CreateDirectory(folderLocation);

if (File.Exists(fileLocation))
{
DateTime lastDownload = File.GetCreationTimeUtc(fileLocation);

// no new release published, return
if (lastDownload > lastReleasePublish)
if (Program.Settings.RFUVersion == releaseInfo.TagName)
return;

CheckIfRunning();
Expand All @@ -112,6 +106,8 @@ public static async Task CheckInstall()
{
await File.WriteAllTextAsync(settingsLocation, Settings);
}

Program.Settings.RFUVersion = releaseInfo.TagName;
}
}
}
3 changes: 3 additions & 0 deletions Bloxstrap/Models/GithubRelease.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ namespace Bloxstrap.Models
{
public class GithubRelease
{
[JsonPropertyName("tag_name")]
public string TagName { get; set; } = null!;

[JsonPropertyName("name")]
public string Name { get; set; } = null!;

Expand Down
2 changes: 2 additions & 0 deletions Bloxstrap/Models/SettingsFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class SettingsFormat
public bool RFUEnabled { get; set; } = false;
public bool RFUAutoclose { get; set; } = false;

public string RFUVersion { get; set; } = "";

public bool UseOldDeathSound { get; set; } = true;
public bool UseOldMouseCursor { get; set; } = false;
}
Expand Down
1 change: 0 additions & 1 deletion Bloxstrap/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ static void Main(string[] args)
}
#endif


if (!String.IsNullOrEmpty(commandLine))
{
DeployManager.Channel = Settings.Channel;
Expand Down

0 comments on commit a39ce6b

Please sign in to comment.