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

Commit

Permalink
fix: add an download list to control the extra dll.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 8, 2023
1 parent 0ed53af commit c688990
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Resources/downloadList.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"Some url"
]
3 changes: 1 addition & 2 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player)
var disToTankRound = Vector3.Distance(player.Position, attackT.Position) + attackT.HitboxRadius;

if (disToTankRound < _action.EffectRange
|| disToTankRound > 2 * _action.EffectRange - player.HitboxRadius
|| disToTankRound > range)
|| disToTankRound > 2 * _action.EffectRange - player.HitboxRadius)
{
_position = player.Position;
}
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.gitignore = .gitignore
Resources\defaultList.json = Resources\defaultList.json
Directory.Build.props = Directory.Build.props
Resources\downloadList.json = Resources\downloadList.json
manifest.json = manifest.json
UpdateDownloads.ts = UpdateDownloads.ts
Resources\whiteList.json = Resources\whiteList.json
Expand Down
13 changes: 12 additions & 1 deletion RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@ public static async void GetAllCustomRotations()

using (var client = new HttpClient())
{
foreach (var url in Service.Config.OtherLibs)
IEnumerable<string> libs = Service.Config.OtherLibs;
try
{
var bts = await client.GetByteArrayAsync("https://raw.githubusercontent.com/ArchiDog1998/RotationSolver/main/Resources/downloadList.json");
libs = libs.Union(JsonConvert.DeserializeObject<string[]>(Encoding.Default.GetString(bts)));
}
catch (Exception ex)
{
PluginLog.Log(ex, "Failed to load downloading List.");
}

foreach (var url in libs)
{
var valid = Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out var uriResult)
&& (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
Expand Down

0 comments on commit c688990

Please sign in to comment.