mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
desktop app disabling: revamp w/ activity tracking
This commit is contained in:
parent
68f2a457c1
commit
374feedb11
@ -274,13 +274,6 @@ namespace Bloxstrap
|
||||
|
||||
SetStatus(Resources.Strings.Bootstrapper_Status_Starting);
|
||||
|
||||
if (_launchCommandLine == "--app" && App.Settings.Prop.UseDisableAppPatch)
|
||||
{
|
||||
Utilities.ShellExecute("https://www.roblox.com/games");
|
||||
Dialog?.CloseBootstrapper();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!File.Exists(Path.Combine(Paths.System, "mfplat.dll")))
|
||||
{
|
||||
Frontend.ShowMessageBox(
|
||||
@ -357,7 +350,7 @@ namespace Bloxstrap
|
||||
|
||||
if (App.Settings.Prop.EnableActivityTracking)
|
||||
{
|
||||
activityWatcher = new();
|
||||
activityWatcher = new(gameClientPid);
|
||||
shouldWait = true;
|
||||
|
||||
App.NotifyIcon?.SetActivityWatcher(activityWatcher);
|
||||
@ -1122,8 +1115,6 @@ namespace Bloxstrap
|
||||
if (!Directory.Exists(Paths.Modifications))
|
||||
Directory.CreateDirectory(Paths.Modifications);
|
||||
|
||||
bool appDisabled = App.Settings.Prop.UseDisableAppPatch && !_launchCommandLine.Contains("--deeplink");
|
||||
|
||||
// cursors
|
||||
await CheckModPreset(App.Settings.Prop.CursorType == CursorType.From2006, new Dictionary<string, string>
|
||||
{
|
||||
@ -1152,8 +1143,7 @@ namespace Bloxstrap
|
||||
});
|
||||
|
||||
// Mobile.rbxl
|
||||
await CheckModPreset(appDisabled, @"ExtraContent\places\Mobile.rbxl", "");
|
||||
await CheckModPreset(App.Settings.Prop.UseOldAvatarBackground && !appDisabled, @"ExtraContent\places\Mobile.rbxl", "OldAvatarBackground.rbxl");
|
||||
await CheckModPreset(App.Settings.Prop.UseOldAvatarBackground, @"ExtraContent\places\Mobile.rbxl", "OldAvatarBackground.rbxl");
|
||||
|
||||
// emoji presets are downloaded remotely from github due to how large they are
|
||||
string contentFonts = Path.Combine(Paths.Modifications, "content\\fonts");
|
||||
|
@ -12,11 +12,13 @@
|
||||
private const string GameDisconnectedEntry = "[FLog::Network] Time to disconnect replication data:";
|
||||
private const string GameTeleportingEntry = "[FLog::SingleSurfaceApp] initiateTeleport";
|
||||
private const string GameMessageEntry = "[FLog::Output] [BloxstrapRPC]";
|
||||
private const string GameLeavingEntry = "[FLog::SingleSurfaceApp] leaveUGCGameInternal";
|
||||
|
||||
private const string GameJoiningEntryPattern = @"! Joining game '([0-9a-f\-]{36})' place ([0-9]+) at ([0-9\.]+)";
|
||||
private const string GameJoiningUDMUXPattern = @"UDMUX Address = ([0-9\.]+), Port = [0-9]+ \| RCC Server Address = ([0-9\.]+), Port = [0-9]+";
|
||||
private const string GameJoinedEntryPattern = @"serverId: ([0-9\.]+)\|[0-9]+";
|
||||
|
||||
private int _gameClientPid;
|
||||
private int _logEntriesRead = 0;
|
||||
private bool _teleportMarker = false;
|
||||
private bool _reservedTeleportMarker = false;
|
||||
@ -43,6 +45,11 @@
|
||||
|
||||
public bool IsDisposed = false;
|
||||
|
||||
public ActivityWatcher(int gameClientPid)
|
||||
{
|
||||
_gameClientPid = gameClientPid;
|
||||
}
|
||||
|
||||
public async void StartWatcher()
|
||||
{
|
||||
const string LOG_IDENT = "ActivityWatcher::StartWatcher";
|
||||
@ -207,7 +214,13 @@
|
||||
}
|
||||
else if (ActivityInGame && ActivityPlaceId != 0)
|
||||
{
|
||||
if (entry.Contains(GameDisconnectedEntry))
|
||||
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))
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Disconnected from Game ({ActivityPlaceId}/{ActivityJobId}/{ActivityMachineAddress})");
|
||||
|
||||
|
@ -86,11 +86,6 @@ namespace Bloxstrap
|
||||
}
|
||||
else if (arg.StartsWith("roblox:"))
|
||||
{
|
||||
if (App.Settings.Prop.UseDisableAppPatch)
|
||||
Frontend.ShowMessageBox(
|
||||
Resources.Strings.Bootstrapper_DeeplinkTempEnabled,
|
||||
MessageBoxImage.Information
|
||||
);
|
||||
|
||||
RobloxLaunchArgs = $"--app --deeplink {arg}";
|
||||
|
||||
|
36
Bloxstrap/Resources/Strings.Designer.cs
generated
36
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -2448,6 +2448,24 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Roblox will fully close when you leave a game instead of dropping you back into the app..
|
||||
/// </summary>
|
||||
public static string Menu_Integrations_DesktopApp_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Integrations.DesktopApp.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Don't exit to desktop app.
|
||||
/// </summary>
|
||||
public static string Menu_Integrations_DesktopApp_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Integrations.DesktopApp.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Allows for Bloxstrap to detect what Roblox game you're playing. Certain features may require this..
|
||||
/// </summary>
|
||||
@ -2637,24 +2655,6 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Stops the desktop app from showing, especially when you leave a game..
|
||||
/// </summary>
|
||||
public static string Menu_Mods_Presets_DisableDesktopApp_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Mods.Presets.DisableDesktopApp.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Disable desktop app.
|
||||
/// </summary>
|
||||
public static string Menu_Mods_Presets_DisableDesktopApp_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Mods.Presets.DisableDesktopApp.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Choose which type of emoji should Roblox use..
|
||||
/// </summary>
|
||||
|
@ -927,6 +927,12 @@ Selecting 'No' will ignore this warning and continue installation.</value>
|
||||
<data name="Menu.Integrations.Description" xml:space="preserve">
|
||||
<value>Configure quick and easy ways to improve the Roblox gameplay experience.</value>
|
||||
</data>
|
||||
<data name="Menu.Integrations.DesktopApp.Description" xml:space="preserve">
|
||||
<value>Roblox will fully close when you leave a game instead of dropping you back into the app.</value>
|
||||
</data>
|
||||
<data name="Menu.Integrations.DesktopApp.Title" xml:space="preserve">
|
||||
<value>Don't exit to desktop app</value>
|
||||
</data>
|
||||
<data name="Menu.Integrations.EnableActivityTracking.Description" xml:space="preserve">
|
||||
<value>Allows for Bloxstrap to detect what Roblox game you're playing. Certain features may require this.</value>
|
||||
</data>
|
||||
@ -991,12 +997,6 @@ Selecting 'No' will ignore this warning and continue installation.</value>
|
||||
<data name="Menu.Mods.OpenModsFolder.Title" xml:space="preserve">
|
||||
<value>Open Mods Folder</value>
|
||||
</data>
|
||||
<data name="Menu.Mods.Presets.DisableDesktopApp.Description" xml:space="preserve">
|
||||
<value>Stops the desktop app from showing, especially when you leave a game.</value>
|
||||
</data>
|
||||
<data name="Menu.Mods.Presets.DisableDesktopApp.Title" xml:space="preserve">
|
||||
<value>Disable desktop app</value>
|
||||
</data>
|
||||
<data name="Menu.Mods.Presets.EmojiType.Description" xml:space="preserve">
|
||||
<value>Choose which type of emoji should Roblox use.</value>
|
||||
</data>
|
||||
|
@ -32,6 +32,13 @@
|
||||
<ui:ToggleSwitch IsChecked="{Binding ShowServerDetailsEnabled, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Integrations_DesktopApp_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Integrations_DesktopApp_Description}"
|
||||
IsEnabled="{Binding InnerContent.IsChecked, ElementName=ActivityTrackingOption, Mode=OneWay}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding DisableAppPatchEnabled, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
|
||||
<TextBlock Text="{x:Static resources:Strings.Common_DiscordRichPresence}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_RequiresActivityTracking}" TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
|
@ -93,12 +93,6 @@
|
||||
<ui:ToggleSwitch IsChecked="{Binding OldCharacterSoundsEnabled, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Mods_Presets_DisableDesktopApp_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Mods_Presets_DisableDesktopApp_Description}">
|
||||
<ui:ToggleSwitch IsChecked="{Binding DisableAppPatchEnabled, Mode=TwoWay}" />
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Mods_Presets_EmojiType_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Mods_Presets_EmojiType_Description}">
|
||||
|
@ -49,10 +49,12 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
if (!value)
|
||||
{
|
||||
ShowServerDetailsEnabled = value;
|
||||
DisableAppPatchEnabled = value;
|
||||
DiscordActivityEnabled = value;
|
||||
DiscordActivityJoinEnabled = value;
|
||||
|
||||
OnPropertyChanged(nameof(ShowServerDetailsEnabled));
|
||||
OnPropertyChanged(nameof(DisableAppPatchEnabled));
|
||||
OnPropertyChanged(nameof(DiscordActivityEnabled));
|
||||
OnPropertyChanged(nameof(DiscordActivityJoinEnabled));
|
||||
}
|
||||
@ -92,6 +94,12 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
set => App.Settings.Prop.MultiInstanceLaunching = value;
|
||||
}
|
||||
|
||||
public bool DisableAppPatchEnabled
|
||||
{
|
||||
get => App.Settings.Prop.UseDisableAppPatch;
|
||||
set => App.Settings.Prop.UseDisableAppPatch = value;
|
||||
}
|
||||
|
||||
public ObservableCollection<CustomIntegration> CustomIntegrations
|
||||
{
|
||||
get => App.Settings.Prop.CustomIntegrations;
|
||||
|
@ -96,12 +96,6 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
set => App.Settings.Prop.UseOldAvatarBackground = value;
|
||||
}
|
||||
|
||||
public bool DisableAppPatchEnabled
|
||||
{
|
||||
get => App.Settings.Prop.UseDisableAppPatch;
|
||||
set => App.Settings.Prop.UseDisableAppPatch = value;
|
||||
}
|
||||
|
||||
public IReadOnlyCollection<EmojiType> EmojiTypes => EmojiTypeEx.Selections;
|
||||
|
||||
public EmojiType SelectedEmojiType
|
||||
|
Loading…
Reference in New Issue
Block a user