Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return of max ping setting #7

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ public const string
Filter = BasicTimer, Section = 2)]
private static readonly bool _noPingCheck = false;

[UI("The max ping that RS can get to before skipping to the next action.",
Filter = BasicTimer)]
[Range(0.01f, 0.5f, ConfigUnitType.Seconds, 0.002f)]
public float MaxPing { get; set; } = 0.06f;

[UI("Use additional conditions", Filter = BasicParams)]
public bool UseAdditionalConditions { get; set; } = false;

Expand Down
23 changes: 19 additions & 4 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ public static float AbilityRemain
get
{
var gcdRemain = WeaponRemain;
// Check if we should account for the animation lock and ping.
if (gcdRemain - MinAnimationLock - Ping <= AnimationLocktime)
{
return gcdRemain + MinAnimationLock + Ping;
Expand All @@ -219,7 +220,20 @@ public static float AbilityRemain
}
}

public static float NextAbilityToNextGCD => WeaponRemain - AnimationLocktime;
// Update the property to conditionally use AbilityRemain based on the NoPingCheck setting.
public static float NextAbilityToNextGCD
{
get
{
// Check if NoPingCheck is false; if so, use AbilityRemain.
if (!Service.Config.NoPingCheck)
{
return AbilityRemain - WeaponRemain;
}
// Otherwise, use the existing logic.
return WeaponRemain - AnimationLocktime;
}
}

public static float CastingTotal { get; internal set; }
#endregion
Expand Down Expand Up @@ -394,9 +408,10 @@ public static float DPSTaken
public static ActionID LastGCD { get; private set; } = 0;

public static ActionID LastAbility { get; private set; } = 0;
public static float Ping => Service.Config.NoPingCheck ? 0 : Math.Min(RTT, FetchTime);
public static float RTT { get; internal set; } = 0.1f;
public static float FetchTime { get; private set; } = 0.1f;
public static float Ping => Service.Config.NoPingCheck ? 0 : Math.Min(Math.Min(RTT, FetchTime), Service.Config.MaxPing);

public static float RTT { get; internal set; } = 0.05f;
public static float FetchTime { get; private set; } = 0.05f;


public const float MinAnimationLock = 0.6f;
Expand Down