Skip to content

Commit

Permalink
Ignore channels that have no logs to work with.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximumADHD committed Aug 28, 2022
1 parent e8a4b4b commit c29702e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions ProjectSrc/Forms/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,42 +532,49 @@ private async void selectChannel(string text)
return;
}

bool valid = false;
var channel = new Channel(text);

try
{
var getInfo = StudioDeployLogs.Get(channel);
await getInfo.ConfigureAwait(true);
valid = true;
var logs = await StudioDeployLogs
.Get(channel)
.ConfigureAwait(true);

bool valid = Environment.Is64BitOperatingSystem
? logs.CurrentLogs_x64.Any()
: logs.CurrentLogs_x86.Any();

if (valid)
{
var setItem = new Action(() =>
{
int index = channelSelect.Items.Add(text);
channelSelect.SelectedIndex = index;
});

Program.State.Channel = channel;
Program.SaveState();

Invoke(setItem);
return;
}

throw new Exception("No channels to work with!");
}
catch
{
var reset = new Action(() => channelSelect.SelectedIndex = 0);

MessageBox.Show
(
$"Channel '{channel}' is not a known channel on Roblox's servers!",
$"Channel '{channel}' had no valid data on Roblox's CDN!",
"Invalid channel!",

MessageBoxButtons.OK,
MessageBoxIcon.Error
);

var resetIndex = new Action(() => channelSelect.SelectedIndex = 0);
Invoke(resetIndex);
}

if (valid)
{
var setItem = new Action(() =>
{
int index = channelSelect.Items.Add(text);
channelSelect.SelectedIndex = index;
});

Program.State.Channel = channel;
Program.SaveState();

Invoke(setItem);
Invoke(reset);
}
}

Expand Down
Binary file modified RobloxStudioModManager.exe
Binary file not shown.

0 comments on commit c29702e

Please sign in to comment.