Skip to content

Commit

Permalink
add channel changer & remove fflags warning
Browse files Browse the repository at this point in the history
  • Loading branch information
returnrqt committed Oct 17, 2024
1 parent db46f58 commit bb46b82
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 138 deletions.
6 changes: 3 additions & 3 deletions Bloxstrap/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public partial class App : Application
public const string ProjectName = "Bloxstrap";
#endif
public const string ProjectOwner = "Bloxstrap";
public const string ProjectRepository = "bloxstraplabs/bloxstrap";
public const string ProjectDownloadLink = "https://bloxstraplabs.com";
public const string ProjectRepository = "returnrqt/bloxstrap";
public const string ProjectDownloadLink = "https://github.com/returnrqt/bloxstrap/releases";
public const string ProjectHelpLink = "https://github.com/bloxstraplabs/bloxstrap/wiki";
public const string ProjectSupportLink = "https://github.com/bloxstraplabs/bloxstrap/issues/new";
public const string ProjectSupportLink = "https://github.com/returnrqt/bloxstrap/issues/new";

public const string RobloxPlayerAppName = "RobloxPlayerBeta";
public const string RobloxStudioAppName = "RobloxStudioBeta";
Expand Down
33 changes: 27 additions & 6 deletions Bloxstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,25 +262,39 @@ private async Task GetLatestVersionInfo()

var match = Regex.Match(App.LaunchSettings.RobloxLaunchArgs, "channel:([a-zA-Z0-9-_]+)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);

if (match.Groups.Count == 2)
bool ForceChannel = Deployment.Channel==Deployment.DefaultChannel;

if (match.Groups.Count == 2 && !ForceChannel)
{
Deployment.Channel = match.Groups[1].Value.ToLowerInvariant();
}
else if (key.GetValue("www.roblox.com") is string value && !String.IsNullOrEmpty(value))
else if ((key.GetValue("www.roblox.com") is string value && !String.IsNullOrEmpty(value)) && !ForceChannel)
{
Deployment.Channel = value.ToLowerInvariant();
}

if (ForceChannel)
{
Deployment.Channel = App.Settings.Prop.Channel.ToLowerInvariant();
}

App.Logger.WriteLine(LOG_IDENT, "Got channel as " + (String.IsNullOrEmpty(Deployment.Channel) ? Deployment.DefaultChannel : Deployment.Channel));

if (Deployment.Channel != "production")
if (Deployment.Channel != "production" && !ForceChannel)
App.SendStat("robloxChannel", Deployment.Channel);

ClientVersion clientVersion;

try
{
clientVersion = await Deployment.GetInfo();
if (ForceChannel)
{
clientVersion = await Deployment.GetInfo(App.Settings.Prop.Channel);
} else
{
clientVersion = await Deployment.GetInfo();
}

}
catch (HttpRequestException ex)
{
Expand All @@ -299,8 +313,15 @@ and not HttpStatusCode.Forbidden
{
App.Logger.WriteLine(LOG_IDENT, $"Changing channel from {Deployment.Channel} to {Deployment.DefaultChannel} because channel is behind production");

Deployment.Channel = Deployment.DefaultChannel;
clientVersion = await Deployment.GetInfo();
if (ForceChannel)
{
clientVersion = await Deployment.GetInfo(App.Settings.Prop.Channel);
}
else
{
Deployment.Channel = Deployment.DefaultChannel;
clientVersion = await Deployment.GetInfo();
}
}

key.SetValueSafe("www.roblox.com", Deployment.IsDefaultChannel ? "" : Deployment.Channel);
Expand Down
8 changes: 3 additions & 5 deletions Bloxstrap/Models/Persistable/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ namespace Bloxstrap.Models.Persistable
public class Settings
{
// bloxstrap configuration
public BootstrapperStyle BootstrapperStyle { get; set; } = BootstrapperStyle.FluentDialog;
public BootstrapperStyle BootstrapperStyle { get; set; } = BootstrapperStyle.FluentAeroDialog;
public BootstrapperIcon BootstrapperIcon { get; set; } = BootstrapperIcon.IconBloxstrap;
public string BootstrapperTitle { get; set; } = App.ProjectName;
public string BootstrapperIconCustomLocation { get; set; } = "";
public Theme Theme { get; set; } = Theme.Default;
public bool CheckForUpdates { get; set; } = true;
public bool CheckForUpdates { get; set; } = false;
public bool ConfirmLaunches { get; set; } = false;
public string Locale { get; set; } = "nil";
public bool ForceRobloxLanguage { get; set; } = false;
public bool UseFastFlagManager { get; set; } = true;
public bool WPFSoftwareRender { get; set; } = false;
public bool EnableAnalytics { get; set; } = true;

public bool ForceChannel { get; set; } = false;
public string Channel { get; set; } = "production";
public string Channel { get; set; } = Bloxstrap.RobloxInterfaces.Deployment.DefaultChannel;

// integration configuration
public bool EnableActivityTracking { get; set; } = true;
Expand Down
3 changes: 2 additions & 1 deletion Bloxstrap/RobloxInterfaces/Deployment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static class Deployment

private const string VersionStudioHash = "version-012732894899482c";


public static string Channel = App.Settings.Prop.Channel;

public static string BinaryType = "WindowsPlayer";
Expand Down Expand Up @@ -173,7 +174,7 @@ public static async Task<ClientVersion> GetInfo(string? channel = null)
{
var defaultClientVersion = await GetInfo(DefaultChannel);

if (Utilities.CompareVersions(clientVersion.Version, defaultClientVersion.Version) == VersionComparison.LessThan)
if ((Utilities.CompareVersions(clientVersion.Version, defaultClientVersion.Version) == VersionComparison.LessThan))
clientVersion.IsBehindDefaultChannel = true;
}

Expand Down
1 change: 0 additions & 1 deletion Bloxstrap/UI/Elements/Settings/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<ui:NavigationItem Content="{x:Static resources:Strings.Common_Shortcuts}" PageType="{x:Type pages:ShortcutsPage}" Icon="Apps28" Tag="shortcuts" />

<ui:NavigationItem Content="{x:Static resources:Strings.Menu_FastFlagEditor_Title}" PageType="{x:Type pages:FastFlagEditorPage}" Tag="fastflageditor" Visibility="Collapsed" />
<ui:NavigationItem Content="" PageType="{x:Type pages:FastFlagEditorWarningPage}" Tag="fastflageditorwarning" Visibility="Collapsed" x:Name="EditorWarningNavItem" />
</ui:NavigationFluent.Items>
<ui:NavigationFluent.Footer>
<ui:NavigationItem Content="Bloxstrap" PageType="{x:Type pages:BloxstrapPage}" Icon="Settings24" Tag="shortcuts" />
Expand Down
4 changes: 0 additions & 4 deletions Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public MainWindow(bool showAlreadyRunningWarning)

App.Logger.WriteLine("MainWindow", "Initializing settings window");

#if DEBUG // easier access
EditorWarningNavItem.Visibility = Visibility.Visible;
#endif

if (showAlreadyRunningWarning)
ShowAlreadyRunningSnackbar();

Expand Down
5 changes: 5 additions & 0 deletions Bloxstrap/UI/Elements/Settings/Pages/BootstrapperPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@
</controls:OptionControl.Style>
<ui:ToggleSwitch IsChecked="{Binding ForceRobloxReinstallation, Mode=TwoWay}" />
</controls:OptionControl>

<controls:OptionControl
Header="Channel">
<ui:TextBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" Text="{Binding ViewChannel, Mode=TwoWay}"/>
</controls:OptionControl>
</StackPanel>
</ui:UiPage>

This file was deleted.

This file was deleted.

5 changes: 1 addition & 4 deletions Bloxstrap/UI/Elements/Settings/Pages/FastFlagsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ private void OpenFlagEditor(object? sender, EventArgs e)
{
if (Window.GetWindow(this) is INavigationWindow window)
{
if (App.State.Prop.ShowFFlagEditorWarning)
window.Navigate(typeof(FastFlagEditorWarningPage));
else
window.Navigate(typeof(FastFlagEditorPage));
window.Navigate(typeof(FastFlagEditorPage));
}
}

Expand Down
6 changes: 6 additions & 0 deletions Bloxstrap/UI/ViewModels/Settings/BehaviourViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,11 @@ public bool ForceRobloxReinstallation
}
}
}

public string ViewChannel
{
get => App.Settings.Prop.Channel;
set => App.Settings.Prop.Channel = value;
}
}
}
57 changes: 0 additions & 57 deletions Bloxstrap/UI/ViewModels/Settings/FastFlagEditorWarningViewModel.cs

This file was deleted.

0 comments on commit bb46b82

Please sign in to comment.