mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
multi instance launching: removal
This commit is contained in:
parent
374feedb11
commit
ef9b1f9aa7
@ -223,28 +223,6 @@ namespace Bloxstrap
|
|||||||
dialog.Bootstrapper = bootstrapper;
|
dialog.Bootstrapper = bootstrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle roblox singleton mutex for multi-instance launching
|
|
||||||
// note we're handling it here in the main thread and NOT in the
|
|
||||||
// bootstrapper as handling mutexes in async contexts suuuuuucks
|
|
||||||
|
|
||||||
Mutex? singletonMutex = null;
|
|
||||||
|
|
||||||
if (Settings.Prop.MultiInstanceLaunching && LaunchSettings.RobloxLaunchMode == LaunchMode.Player)
|
|
||||||
{
|
|
||||||
Logger.WriteLine(LOG_IDENT, "Creating singleton mutex");
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Mutex.OpenExisting("ROBLOX_singletonMutex");
|
|
||||||
Logger.WriteLine(LOG_IDENT, "Warning - singleton mutex already exists!");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
// create the singleton mutex before the game client does
|
|
||||||
singletonMutex = new Mutex(true, "ROBLOX_singletonMutex");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Task bootstrapperTask = Task.Run(async () => await bootstrapper.Run()).ContinueWith(t =>
|
Task bootstrapperTask = Task.Run(async () => await bootstrapper.Run()).ContinueWith(t =>
|
||||||
{
|
{
|
||||||
Logger.WriteLine(LOG_IDENT, "Bootstrapper task has finished");
|
Logger.WriteLine(LOG_IDENT, "Bootstrapper task has finished");
|
||||||
@ -280,16 +258,6 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
bootstrapperTask.Wait();
|
bootstrapperTask.Wait();
|
||||||
|
|
||||||
if (singletonMutex is not null)
|
|
||||||
{
|
|
||||||
Logger.WriteLine(LOG_IDENT, "We have singleton mutex ownership! Running in background until all Roblox processes are closed");
|
|
||||||
|
|
||||||
// we've got ownership of the roblox singleton mutex!
|
|
||||||
// if we stop running, everything will screw up once any more roblox instances launched
|
|
||||||
while (Process.GetProcessesByName("RobloxPlayerBeta").Any())
|
|
||||||
Thread.Sleep(5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
StartupFinished();
|
StartupFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ namespace Bloxstrap.Models
|
|||||||
public Theme Theme { get; set; } = Theme.Default;
|
public Theme Theme { get; set; } = Theme.Default;
|
||||||
public bool CheckForUpdates { get; set; } = true;
|
public bool CheckForUpdates { get; set; } = true;
|
||||||
public bool CreateDesktopIcon { get; set; } = true;
|
public bool CreateDesktopIcon { get; set; } = true;
|
||||||
public bool MultiInstanceLaunching { get; set; } = false;
|
|
||||||
|
|
||||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||||
[JsonPropertyName("OhHeyYouFoundMeAgain")]
|
[JsonPropertyName("OhHeyYouFoundMeAgain")]
|
||||||
|
@ -59,12 +59,6 @@
|
|||||||
|
|
||||||
<TextBlock Text="{x:Static resources:Strings.Common_Miscellaneous}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
<TextBlock Text="{x:Static resources:Strings.Common_Miscellaneous}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
||||||
|
|
||||||
<controls:OptionControl
|
|
||||||
Header="{x:Static resources:Strings.Menu_Integrations_AllowMultipleInstances_Title}"
|
|
||||||
Description="{x:Static resources:Strings.Menu_Integrations_AllowMultipleInstances_Description}">
|
|
||||||
<ui:ToggleSwitch IsChecked="{Binding MultiInstanceLaunchingEnabled, Mode=TwoWay}" />
|
|
||||||
</controls:OptionControl>
|
|
||||||
|
|
||||||
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_Custom_Title}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_Custom_Title}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
||||||
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_Custom_Description}" TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_Custom_Description}" TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||||
<Grid Margin="0,8,0,0">
|
<Grid Margin="0,8,0,0">
|
||||||
|
@ -88,12 +88,6 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
set => App.Settings.Prop.HideRPCButtons = !value;
|
set => App.Settings.Prop.HideRPCButtons = !value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool MultiInstanceLaunchingEnabled
|
|
||||||
{
|
|
||||||
get => App.Settings.Prop.MultiInstanceLaunching;
|
|
||||||
set => App.Settings.Prop.MultiInstanceLaunching = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool DisableAppPatchEnabled
|
public bool DisableAppPatchEnabled
|
||||||
{
|
{
|
||||||
get => App.Settings.Prop.UseDisableAppPatch;
|
get => App.Settings.Prop.UseDisableAppPatch;
|
||||||
|
Loading…
Reference in New Issue
Block a user