Fix start event handler + launch menu title bar

turns out you need to call Reset() on the event even when you set its initial state to false
This commit is contained in:
pizzaboxer 2024-08-30 18:51:00 +01:00
parent 2791cb0b2e
commit 4d9a0ee410
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 16 additions and 9 deletions

View File

@ -328,18 +328,25 @@ namespace Bloxstrap
return;
}
using var startEvent = new EventWaitHandle(false, EventResetMode.ManualReset, AppData.StartEvent);
// v2.2.0 - byfron will trip if we keep a process handle open for over a minute, so we're doing this now
int gameClientPid;
using (var gameClient = Process.Start(startInfo)!)
bool startEventSignalled;
using (var startEvent = new EventWaitHandle(false, EventResetMode.ManualReset, AppData.StartEvent))
{
gameClientPid = gameClient.Id;
startEvent.Reset();
// v2.2.0 - byfron will trip if we keep a process handle open for over a minute, so we're doing this now
using (var process = Process.Start(startInfo)!)
{
gameClientPid = process.Id;
}
App.Logger.WriteLine(LOG_IDENT, $"Started Roblox (PID {gameClientPid}), waiting for start event");
startEventSignalled = startEvent.WaitOne(TimeSpan.FromSeconds(10));
}
App.Logger.WriteLine(LOG_IDENT, $"Started Roblox (PID {gameClientPid}), waiting for start event");
if (!startEvent.WaitOne(TimeSpan.FromSeconds(10)))
if (!startEventSignalled)
{
Frontend.ShowPlayerErrorDialog();
return;

View File

@ -24,7 +24,7 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:TitleBar Grid.Row="0" Grid.ColumnSpan="2" Padding="8" ShowMinimize="False" ShowMaximize="False" CanMaximize="False" KeyboardNavigation.TabNavigation="None" />
<ui:TitleBar Grid.Row="0" Grid.ColumnSpan="2" Padding="8" ShowMinimize="False" ShowMaximize="False" Title="Bloxstrap" Icon="pack://application:,,,/Bloxstrap.ico" CanMaximize="False" KeyboardNavigation.TabNavigation="None" />
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>