Skip to content

Commit

Permalink
Fix inconsistent handling of desktop app closing
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Jun 27, 2024
1 parent 9e311e6 commit ec41826
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Bloxstrap/Integrations/ActivityWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ private void ExamineLogEntry(string entry)
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))
Expand Down Expand Up @@ -209,13 +217,7 @@ private void ExamineLogEntry(string entry)
}
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})");

Expand Down

1 comment on commit ec41826

@M1H4D
Copy link

@M1H4D M1H4D commented on ec41826 Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi mr. pizzaboxer, I'd like to know if I can do something with this code? If yes, please describe it. Thank you :)

Please sign in to comment.