Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: moved the allowd and default list to the github.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 8, 2023
1 parent 822c3cf commit e0e5931
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions RotationSolver/RotationHelper.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
using Dalamud.Interface.Colors;
using Dalamud.Logging;
using System.Diagnostics;
using System.Net;
using System.Text;

namespace RotationSolver;

internal static class RotationHelper
{
public static string[] AllowedAssembly { get; set; } = new string[0];
public static string[] DefaultAssembly { get; set; } = new string[0];
public static string[] AllowedAssembly { get; private set; } = new string[0];
public static string[] DefaultAssembly { get; private set; } = new string[]
{
"RotationSolver.Default",
};

public static async void LoadList()
{
using (var client = new HttpClient())
{
try
{
var bts = await client.GetByteArrayAsync("https://raw.githubusercontent.com/ArchiDog1998/RotationSolver/main/Resources/whitelist.json");
AllowedAssembly = JsonConvert.DeserializeObject<string[]>(Encoding.Default.GetString(bts));
}
catch (Exception ex)
{
PluginLog.Log(ex, "Failed to load white List.");
}

try
{
var bts = await client.GetByteArrayAsync("https://raw.githubusercontent.com/ArchiDog1998/RotationSolver/main/Resources/defaultList.json");
DefaultAssembly = JsonConvert.DeserializeObject<string[]>(Encoding.Default.GetString(bts));
}
catch (Exception ex)
{
PluginLog.Log(ex, "Failed to load default List.");
}
}
}

public static bool IsDefault(this ICustomRotation rotation)
{
Expand Down

0 comments on commit e0e5931

Please sign in to comment.