mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fetch selectable channel list from RDHT (#142)
This commit is contained in:
parent
0fc7b56458
commit
0dbacc81ea
@ -109,7 +109,7 @@ namespace Bloxstrap
|
|||||||
Terminate(Bootstrapper.ERROR_INSTALL_FAILURE);
|
Terminate(Bootstrapper.ERROR_INSTALL_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
protected override async void OnStartup(StartupEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
|
|
||||||
@ -157,6 +157,9 @@ namespace Bloxstrap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this looks like the most fitting place for it
|
||||||
|
await Deployment.Initialize();
|
||||||
|
|
||||||
// so this needs to be here because winforms moment
|
// so this needs to be here because winforms moment
|
||||||
// onclick events will not fire unless this is defined here in the main thread so uhhhhh
|
// onclick events will not fire unless this is defined here in the main thread so uhhhhh
|
||||||
// we'll show the icon if we're launching roblox since we're likely gonna be showing a
|
// we'll show the icon if we're launching roblox since we're likely gonna be showing a
|
||||||
|
28
Bloxstrap/DeployHelper.cs
Normal file
28
Bloxstrap/DeployHelper.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
|
namespace Bloxstrap
|
||||||
|
{
|
||||||
|
internal class DeployHelper
|
||||||
|
{
|
||||||
|
public static readonly string ChannelURL = "https://raw.githubusercontent.com/bluepilledgreat/Roblox-DeployHistory-Tracker/main/ChannelsActive.json";
|
||||||
|
private static HttpClient HttpClient = new HttpClient();
|
||||||
|
|
||||||
|
public static async Task<List<string>> GetChannels()
|
||||||
|
{
|
||||||
|
App.Logger.WriteLine($"[DeployHelper::GetChannels] Trying to get currently active channels from {ChannelURL}");
|
||||||
|
|
||||||
|
var Response = await HttpClient.GetAsync(ChannelURL);
|
||||||
|
var JSON = await Response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
var Channels = JsonConvert.DeserializeObject<List<string>>(JSON);
|
||||||
|
|
||||||
|
return Channels;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -59,19 +59,14 @@ namespace Bloxstrap
|
|||||||
}
|
}
|
||||||
|
|
||||||
// most commonly used/interesting channels
|
// most commonly used/interesting channels
|
||||||
public static readonly List<string> SelectableChannels = new()
|
public static List<string> SelectableChannels = null;
|
||||||
{
|
|
||||||
"LIVE",
|
|
||||||
"ZWinPlayer64",
|
|
||||||
"ZFlag",
|
|
||||||
"ZNext",
|
|
||||||
"ZCanary",
|
|
||||||
"ZIntegration",
|
|
||||||
"ZAvatarTeam",
|
|
||||||
"ZSocialTeam"
|
|
||||||
};
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public static async Task Initialize()
|
||||||
|
{
|
||||||
|
SelectableChannels = await DeployHelper.GetChannels();
|
||||||
|
}
|
||||||
|
|
||||||
public static string GetLocation(string resource, string? channel = null)
|
public static string GetLocation(string resource, string? channel = null)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(channel))
|
if (string.IsNullOrEmpty(channel))
|
||||||
|
Loading…
Reference in New Issue
Block a user