Fix inconsistent handling of desktop app closing

This commit is contained in:
pizzaboxer 2024-06-27 18:08:17 +04:00
parent 9e311e69c9
commit ec418261ea
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -134,6 +134,14 @@
else if (_logEntriesRead % 100 == 0)
App.Logger.WriteLine(LOG_IDENT, $"Read {_logEntriesRead} log entries");
if (App.Settings.Prop.UseDisableAppPatch && entry.Contains(GameLeavingEntry))
{
App.Logger.WriteLine(LOG_IDENT, "Received desktop app exit, closing Roblox");
using var process = Process.GetProcessById(_gameClientPid);
process.CloseMainWindow();
}
if (!ActivityInGame && ActivityPlaceId == 0)
{
if (entry.Contains(GameJoiningPrivateServerEntry))
@ -209,13 +217,7 @@
}
else if (ActivityInGame && ActivityPlaceId != 0)
{
if (App.Settings.Prop.UseDisableAppPatch && entry.Contains(GameLeavingEntry))
{
App.Logger.WriteLine(LOG_IDENT, "Received desktop app exit, closing Roblox");
using var process = Process.GetProcessById(_gameClientPid);
process.CloseMainWindow();
}
else if (entry.Contains(GameDisconnectedEntry))
if (entry.Contains(GameDisconnectedEntry))
{
App.Logger.WriteLine(LOG_IDENT, $"Disconnected from Game ({ActivityPlaceId}/{ActivityJobId}/{ActivityMachineAddress})");