Skip to content

Commit 8d918fb

Browse files
committed
(Chore) Update 3.2.0 v1
1 parent ce7dec9 commit 8d918fb

11 files changed

Lines changed: 197 additions & 16 deletions

File tree

Bloxstrap/Bloxstrap.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<UseWPF>true</UseWPF>
88
<UseWindowsForms>True</UseWindowsForms>
99
<ApplicationIcon>BoneFish.ico</ApplicationIcon>
10-
<Version>3.1.0</Version>
11-
<FileVersion>3.1.0</FileVersion>
10+
<Version>3.2.0</Version>
11+
<FileVersion>3.2.0</FileVersion>
1212
<ApplicationManifest>app.manifest</ApplicationManifest>
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1414
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

Bloxstrap/Bootstrapper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,9 @@ private async Task<string> GetBetterMatchmakingServerID()
663663
if (datacenters == null || !datacenters.Any())
664664
throw new HttpRequestException("No datacenters in response.");
665665

666+
if (string.IsNullOrEmpty(ipinfo.Loc) || !ipinfo.Loc.Contains(','))
667+
throw new HttpRequestException("Location coordinate is blank or invalid.");
668+
666669
string[] location = ipinfo.Loc.Split(",");
667670
double lat1 = double.Parse(location[0], CultureInfo.InvariantCulture);
668671
double lon1 = double.Parse(location[1], CultureInfo.InvariantCulture);

Bloxstrap/Installer.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.IO;
1+
using System.IO;
22
using System.Windows;
33
using System.Xml.Linq;
44
using Bloxstrap.AppData;
@@ -450,8 +450,18 @@ public static void HandleUpgrade()
450450
{
451451
if (!ipl.IsAcquired)
452452
{
453-
App.Logger.WriteLine(LOG_IDENT, "Failed to update! (Could not obtain singleton mutex)");
454-
return;
453+
App.Logger.WriteLine(LOG_IDENT, "Failed to obtain AutoUpdater mutex, trying to kill locking processes...");
454+
Utilities.KillProcessesRunningFrom(Paths.Application);
455+
456+
if (!ipl.RetryAcquire(TimeSpan.FromSeconds(3)))
457+
{
458+
App.Logger.WriteLine(LOG_IDENT, "Failed to update! (Could not obtain singleton mutex)");
459+
Frontend.ShowMessageBox(
460+
"BoneFish failed to update because another instance of the application is running and could not be closed. Please close any background BoneFish processes and try again.",
461+
MessageBoxImage.Error
462+
);
463+
return;
464+
}
455465
}
456466
}
457467

@@ -469,11 +479,17 @@ public static void HandleUpgrade()
469479
if (i == 1)
470480
{
471481
App.Logger.WriteLine(LOG_IDENT, "Waiting for write permissions to update version");
482+
Utilities.KillProcessesRunningFrom(Paths.Application);
472483
}
473484
else if (i == 10)
474485
{
475486
App.Logger.WriteLine(LOG_IDENT, "Failed to update! (Could not get write permissions after 10 tries/5 seconds)");
476487
App.Logger.WriteException(LOG_IDENT, ex);
488+
489+
Frontend.ShowMessageBox(
490+
"BoneFish failed to apply the update because the application file is locked or in use. Please close any background BoneFish processes and try again.",
491+
MessageBoxImage.Error
492+
);
477493
return;
478494
}
479495

Bloxstrap/UI/Elements/About/MainWindow.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<base:WpfUiWindow x:Class="Bloxstrap.UI.Elements.About.MainWindow"
1+
<base:WpfUiWindow x:Class="Bloxstrap.UI.Elements.About.MainWindow"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -7,6 +7,7 @@
77
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
88
xmlns:base="clr-namespace:Bloxstrap.UI.Elements.Base"
99
xmlns:resources="clr-namespace:Bloxstrap.Resources"
10+
xmlns:models="clr-namespace:Bloxstrap.UI.ViewModels"
1011
mc:Ignorable="d"
1112
Title="{x:Static resources:Strings.About_Title}"
1213
Background="{ui:ThemeResource ApplicationBackgroundBrush}"
@@ -42,6 +43,9 @@
4243
<TextBlock x:Name="TranslatorsText" Text="{x:Static resources:Strings.About_Translators_Title}" FontSize="10" />
4344
</ui:NavigationItem>
4445
<ui:NavigationItem Content="{x:Static resources:Strings.About_Licenses_Title}" PageType="{x:Type pages:LicensesPage}" Icon="Code24" Tag="licenses" Margin="0,0,0,12" />
46+
<ui:NavigationItem Content="Donasi (Saweria)" Icon="Heart24" Command="{x:Static models:GlobalViewModel.OpenWebpageCommand}" CommandParameter="https://saweria.co/MahiroDev" Margin="0,0,0,12" />
47+
<ui:NavigationItem Content="Donasi (SociaBuzz)" Icon="Heart24" Command="{x:Static models:GlobalViewModel.OpenWebpageCommand}" CommandParameter="https://sociabuzz.com/zuax" Margin="0,0,0,12" />
48+
<ui:NavigationItem Content="Original Repo" Icon="Code24" Command="{x:Static models:GlobalViewModel.OpenWebpageCommand}" CommandParameter="https://github.com/fishstrap/fishstrap" Margin="0,0,0,12" />
4549
</ui:NavigationStore.Items>
4650
</ui:NavigationStore>
4751

Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ui:UiPage x:Class="Bloxstrap.UI.Elements.About.Pages.AboutPage"
1+
<ui:UiPage x:Class="Bloxstrap.UI.Elements.About.Pages.AboutPage"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -39,17 +39,18 @@
3939
<ColumnDefinition Width="Auto" />
4040
<ColumnDefinition Width="Auto" />
4141
</Grid.ColumnDefinitions>
42-
<TextBlock Grid.Column="0" Text="Fishstrap" Margin="0,0,4,0" FontSize="24" FontWeight="Medium" />
42+
<TextBlock Grid.Column="0" Text="BoneFish" Margin="0,0,4,0" FontSize="24" FontWeight="Medium" />
4343
<TextBlock Grid.Column="1" Text="{Binding Version, Mode=OneTime}" Margin="4,0,0,2" VerticalAlignment="Bottom" FontSize="16" FontWeight="Medium" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
4444
</Grid>
45-
<TextBlock Text="{x:Static resources:Strings.Menu_About_Description}" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
45+
<TextBlock Text="A fork of Fishstrap (Original Bloxstrap continuation)" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
4646
</StackPanel>
4747
</Grid>
4848

4949
<WrapPanel HorizontalAlignment="Center" Orientation="Horizontal">
50-
<ui:Anchor Margin="0,0,8,8" Content="{x:Static resources:Strings.Menu_About_GithubRepository}" Icon="Code24" NavigateUri="https://github.com/fishstrap/fishstrap" />
50+
<ui:Anchor Margin="0,0,8,8" Content="GitHub Repository" Icon="Code24" NavigateUri="https://github.com/faizinuha/BoneFish" />
51+
<ui:Anchor Margin="0,0,8,8" Content="Original Project (Fishstrap)" Icon="Branch24" NavigateUri="https://github.com/fishstrap/fishstrap" />
5152
<ui:Anchor Margin="0,0,8,8" Content="{x:Static resources:Strings.Menu_About_HelpInformation}" Icon="BookQuestionMark24" NavigateUri="https://github.com/bloxstraplabs/bloxstrap/wiki" />
52-
<ui:Anchor Margin="0,0,8,8" Content="{x:Static resources:Strings.Menu_About_ReportIssue}" Icon="BookExclamationMark24" NavigateUri="https://github.com/fishstrap/fishstrap/issues" />
53+
<ui:Anchor Margin="0,0,8,8" Content="{x:Static resources:Strings.Menu_About_ReportIssue}" Icon="BookExclamationMark24" NavigateUri="https://github.com/faizinuha/BoneFish/issues" />
5354
<ui:Anchor Margin="0,0,0,8" Content="{x:Static resources:Strings.Menu_About_DiscordServer}" Icon="Chat48" NavigateUri="https://discord.gg/xSsamjAU84" />
5455
</WrapPanel>
5556

Bloxstrap/UI/Elements/Settings/Pages/FastFlagsPage.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@
7676
<ui:ToggleSwitch IsChecked="{Binding ResetConfiguration, Mode=TwoWay}" />
7777
</controls:OptionControl>
7878

79+
<controls:OptionControl
80+
Header="Nonaktifkan Animasi UI Roblox"
81+
Description="Menonaktifkan animasi menu ESC dan transisi UI lainnya untuk memperingan game.">
82+
<ui:ToggleSwitch IsChecked="{Binding DisableRobloxAnimations, Mode=TwoWay}" />
83+
</controls:OptionControl>
84+
85+
<controls:OptionControl
86+
Header="Mode Memori Rendah Roblox"
87+
Description="Mengoptimalkan penggunaan RAM Roblox agar lebih ringan pada PC spek rendah.">
88+
<ui:ToggleSwitch IsChecked="{Binding EnableLowMemoryMode, Mode=TwoWay}" />
89+
</controls:OptionControl>
90+
7991
<TextBlock Text="{x:Static resources:Strings.Common_Presets}" FontSize="20" FontWeight="Medium" Margin="0,16,0,0" />
8092

8193
<TextBlock Text="{x:Static resources:Strings.Common_Geometry}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />

Bloxstrap/UI/Elements/Settings/Pages/ModsPage.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
</StackPanel>
9898
</controls:OptionControl>
9999

100+
<TextBlock Text="Kustomisasi Gambar" FontSize="20" FontWeight="Medium" Margin="0,16,0,0" />
101+
100102
<controls:OptionControl
101103
Header="{x:Static resources:Strings.Menu_Mods_Misc_CustomBackground_Title}"
102104
Description="{x:Static resources:Strings.Menu_Mods_Misc_CustomBackground_Description}">

Bloxstrap/UI/ViewModels/Settings/FastFlagsViewModel.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,44 @@ public bool ResetConfiguration
184184
}
185185
}
186186

187+
public bool DisableRobloxAnimations
188+
{
189+
get => App.FastFlags.GetValue("FFlagRenderUIAnimations") == "False";
190+
set
191+
{
192+
if (value)
193+
{
194+
App.FastFlags.SetValue("FFlagRenderUIAnimations", "False");
195+
App.FastFlags.SetValue("FFlagRenderMenuTransitions", "False");
196+
App.FastFlags.SetValue("FFlagRenderInventoryEffects", "False");
197+
}
198+
else
199+
{
200+
App.FastFlags.SetValue("FFlagRenderUIAnimations", null);
201+
App.FastFlags.SetValue("FFlagRenderMenuTransitions", null);
202+
App.FastFlags.SetValue("FFlagRenderInventoryEffects", null);
203+
}
204+
OnPropertyChanged(nameof(DisableRobloxAnimations));
205+
}
206+
}
207+
208+
public bool EnableLowMemoryMode
209+
{
210+
get => App.FastFlags.GetValue("FFlagLuaAppEnableLowMemoryMode") == "True";
211+
set
212+
{
213+
if (value)
214+
{
215+
App.FastFlags.SetValue("FFlagLuaAppEnableLowMemoryMode", "True");
216+
}
217+
else
218+
{
219+
App.FastFlags.SetValue("FFlagLuaAppEnableLowMemoryMode", null);
220+
}
221+
OnPropertyChanged(nameof(EnableLowMemoryMode));
222+
}
223+
}
224+
187225
public string SelectedPreset
188226
{
189227
get => App.Settings.Prop.SelectedPerformancePreset;
@@ -214,6 +252,8 @@ private void ApplyRecommendedFastFlags()
214252
MeshQuality = 0;
215253
FRMQualityOverrideEnabled = true;
216254
FRMQualityOverride = 21;
255+
DisableRobloxAnimations = true;
256+
EnableLowMemoryMode = true;
217257

218258
SelectedPreset = "AutoOptimize";
219259
RequestPageReloadEvent?.Invoke(this, EventArgs.Empty);
@@ -273,6 +313,9 @@ private void ApplyUltraLowSpecPreset()
273313
App.FastFlags.SetValue("FIntRenderLocalLightUpdatesMin", "1");
274314
App.FastFlags.SetValue("DFIntTextureCompositorActiveJobs", "1");
275315

316+
DisableRobloxAnimations = true;
317+
EnableLowMemoryMode = true;
318+
276319
ApplyRecommendedNetworkSettings();
277320
App.Settings.Prop.BackgroundUpdatesEnabled = false;
278321
App.Settings.Prop.FakeBorderlessFullscreen = false;

Bloxstrap/Utilities.cs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Bloxstrap.AppData;
1+
using Bloxstrap.AppData;
22
using System.ComponentModel;
33

44
namespace Bloxstrap
@@ -161,5 +161,40 @@ public static void KillBackgroundUpdater()
161161
using EventWaitHandle handle = new EventWaitHandle(false, EventResetMode.AutoReset, "Bloxstrap-BackgroundUpdaterKillEvent");
162162
handle.Set();
163163
}
164+
165+
public static void KillProcessesRunningFrom(string filePath)
166+
{
167+
const string LOG_IDENT = "Utilities::KillProcessesRunningFrom";
168+
int currentPid = Environment.ProcessId;
169+
string targetPath = Path.GetFullPath(filePath);
170+
string processName = Path.GetFileNameWithoutExtension(filePath);
171+
172+
foreach (var process in GetProcessesSafe())
173+
{
174+
try
175+
{
176+
if (process.Id == currentPid)
177+
continue;
178+
179+
if (!string.Equals(process.ProcessName, processName, StringComparison.OrdinalIgnoreCase))
180+
continue;
181+
182+
string? processPath = process.MainModule?.FileName;
183+
if (string.IsNullOrEmpty(processPath))
184+
continue;
185+
186+
if (string.Equals(Path.GetFullPath(processPath), targetPath, StringComparison.OrdinalIgnoreCase))
187+
{
188+
App.Logger.WriteLine(LOG_IDENT, $"Killing locking process '{process.ProcessName}' (pid={process.Id}) running from {processPath}");
189+
process.Kill();
190+
process.WaitForExit(2000);
191+
}
192+
}
193+
catch (Exception)
194+
{
195+
// Access denied or process exited, ignore
196+
}
197+
}
198+
}
164199
}
165200
}

Bloxstrap/Utility/InterProcessLock.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text;
@@ -28,6 +28,23 @@ public InterProcessLock(string name, TimeSpan timeout)
2828
}
2929
}
3030

31+
public bool RetryAcquire(TimeSpan timeout)
32+
{
33+
if (IsAcquired)
34+
return true;
35+
36+
try
37+
{
38+
IsAcquired = Mutex.WaitOne(timeout);
39+
}
40+
catch (AbandonedMutexException)
41+
{
42+
IsAcquired = true;
43+
}
44+
45+
return IsAcquired;
46+
}
47+
3148
public void Dispose()
3249
{
3350
if (IsAcquired)

0 commit comments

Comments
 (0)