mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-18 16:41:36 -07:00
Improve Roblox launch detection
This commit is contained in:
parent
d9a84f4cf9
commit
6dc8e286ce
@ -10,8 +10,6 @@
|
||||
|
||||
string ExecutableName { get; }
|
||||
|
||||
string StartEvent { get; }
|
||||
|
||||
string Directory { get; }
|
||||
|
||||
string LockFilePath { get; }
|
||||
|
@ -16,8 +16,6 @@ namespace Bloxstrap.AppData
|
||||
|
||||
public override string ExecutableName => "RobloxPlayerBeta.exe";
|
||||
|
||||
public string StartEvent => "www.roblox.com/robloxStartedEvent";
|
||||
|
||||
public override string Directory => Path.Combine(Paths.Roblox, "Player");
|
||||
|
||||
public AppState State => App.State.Prop.Player;
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
public override string ExecutableName => "RobloxStudioBeta.exe";
|
||||
|
||||
public string StartEvent => "www.roblox.com/robloxStudioStartedEvent";
|
||||
|
||||
public override string Directory => Path.Combine(Paths.Roblox, "Studio");
|
||||
|
||||
public AppState State => App.State.Prop.Studio;
|
||||
|
@ -319,20 +319,15 @@ namespace Bloxstrap
|
||||
|
||||
SetStatus(Strings.Bootstrapper_Status_Starting);
|
||||
|
||||
if (_launchMode == LaunchMode.Player)
|
||||
{
|
||||
if (App.Settings.Prop.ForceRobloxLanguage)
|
||||
if (_launchMode == LaunchMode.Player && App.Settings.Prop.ForceRobloxLanguage)
|
||||
{
|
||||
var match = Regex.Match(_launchCommandLine, "gameLocale:([a-z_]+)", RegexOptions.CultureInvariant);
|
||||
|
||||
if (match.Groups.Count == 2)
|
||||
_launchCommandLine = _launchCommandLine.Replace("robloxLocale:en_us", $"robloxLocale:{match.Groups[1].Value}", StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(_launchCommandLine))
|
||||
_launchCommandLine += " ";
|
||||
|
||||
_launchCommandLine += "-isInstallerLaunch";
|
||||
_launchCommandLine = _launchCommandLine.Replace(
|
||||
"robloxLocale:en_us",
|
||||
$"robloxLocale:{match.Groups[1].Value}",
|
||||
StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
var startInfo = new ProcessStartInfo()
|
||||
@ -350,10 +345,6 @@ namespace Bloxstrap
|
||||
|
||||
string? logFileName = null;
|
||||
|
||||
using (var startEvent = new EventWaitHandle(false, EventResetMode.ManualReset, AppData.StartEvent))
|
||||
{
|
||||
startEvent.Reset();
|
||||
|
||||
string rbxLogDir = Path.Combine(Paths.LocalAppData, "Roblox\\logs");
|
||||
|
||||
if (!Directory.Exists(rbxLogDir))
|
||||
@ -388,14 +379,9 @@ namespace Bloxstrap
|
||||
throw;
|
||||
}
|
||||
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Started Roblox (PID {_appPid}), waiting for start event");
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Started Roblox (PID {_appPid}), waiting for log file");
|
||||
|
||||
if (startEvent.WaitOne(TimeSpan.FromSeconds(5)))
|
||||
App.Logger.WriteLine(LOG_IDENT, "Start event signalled");
|
||||
else
|
||||
App.Logger.WriteLine(LOG_IDENT, "Start event not signalled, implying successful launch");
|
||||
|
||||
logCreatedEvent.WaitOne(TimeSpan.FromSeconds(5));
|
||||
logCreatedEvent.WaitOne(TimeSpan.FromSeconds(15));
|
||||
|
||||
if (String.IsNullOrEmpty(logFileName))
|
||||
{
|
||||
@ -409,7 +395,6 @@ namespace Bloxstrap
|
||||
}
|
||||
|
||||
_mutex?.ReleaseAsync();
|
||||
}
|
||||
|
||||
if (IsStudioLaunch)
|
||||
return;
|
||||
@ -466,6 +451,9 @@ namespace Bloxstrap
|
||||
if (ipl.IsAcquired)
|
||||
Process.Start(Paths.Process, args);
|
||||
}
|
||||
|
||||
// average grace time between log being created and the window being shown
|
||||
Thread.Sleep(2000);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
|
Loading…
Reference in New Issue
Block a user