diff --git a/Resources/downloadList.json b/Resources/downloadList.json new file mode 100644 index 000000000..00c6c5963 --- /dev/null +++ b/Resources/downloadList.json @@ -0,0 +1,3 @@ +[ + "Some url" +] \ No newline at end of file diff --git a/RotationSolver.Basic/Actions/BaseAction_Target.cs b/RotationSolver.Basic/Actions/BaseAction_Target.cs index aa005268b..203a36de4 100644 --- a/RotationSolver.Basic/Actions/BaseAction_Target.cs +++ b/RotationSolver.Basic/Actions/BaseAction_Target.cs @@ -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; } diff --git a/RotationSolver.sln b/RotationSolver.sln index a8c50dc7e..580eacced 100644 --- a/RotationSolver.sln +++ b/RotationSolver.sln @@ -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 diff --git a/RotationSolver/Updaters/RotationUpdater.cs b/RotationSolver/Updaters/RotationUpdater.cs index e744bd82a..054442e01 100644 --- a/RotationSolver/Updaters/RotationUpdater.cs +++ b/RotationSolver/Updaters/RotationUpdater.cs @@ -23,7 +23,18 @@ public static async void GetAllCustomRotations() using (var client = new HttpClient()) { - foreach (var url in Service.Config.OtherLibs) + IEnumerable 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(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);