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

revert add skip ping config #8

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
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/ActionCooldownInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ internal bool CooldownCheck(bool isEmpty, bool onLastAbility, bool ignoreClippin
}
else
{
if (!HasOneCharge && RecastTimeRemainOneChargeRaw > DataCenter.AnimationLocktime) return false;
if (!HasOneCharge && RecastTimeRemainOneChargeRaw > DataCenter.ActionRemain) return false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public virtual unsafe bool CanUse(out IAction item, bool clippingCheck = true)

var remain = Cooldown.RecastTimeOneChargeRaw - Cooldown.RecastTimeElapsedRaw;

if (remain > DataCenter.AnimationLocktime) return false;
if (remain > DataCenter.ActionRemain) return false;

if (clippingCheck && DataCenter.WeaponRemain > 0)
{
Expand Down
4 changes: 0 additions & 4 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,6 @@ public const string
Filter = TimelineFilter)]
private static readonly bool _enableTimelineMovement = false;

[ConditionBool, UI("Skip the Ping Check. Enable if you use Bossmod Action Tweaks or Noclippy.",
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)]
Expand Down
22 changes: 5 additions & 17 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,36 +204,24 @@ public static float GCDTime(uint gcdCount = 0, float offset = 0)
/// <summary>
/// Time to the next action
/// </summary>
public static unsafe float AnimationLocktime => *(float*)((IntPtr)ActionManager.Instance() + 0x8);
public static unsafe float ActionRemain => *(float*)((IntPtr)ActionManager.Instance() + 0x8);

public static float AbilityRemain
{
get
{
var gcdRemain = WeaponRemain;
// Check if we should account for the animation lock and ping.
if (gcdRemain - MinAnimationLock - Ping <= AnimationLocktime)
if (gcdRemain - MinAnimationLock - Ping <= ActionRemain)
{
return gcdRemain + MinAnimationLock + Ping;
}
return AnimationLocktime;
return ActionRemain;
}
}

// 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 NextAbilityToNextGCD => WeaponRemain - ActionRemain;

public static float CastingTotal { get; internal set; }
#endregion
Expand Down Expand Up @@ -408,7 +396,7 @@ 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(Math.Min(RTT, FetchTime), Service.Config.MaxPing);
public static float Ping => 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;
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/BlackMageRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ static partial void ModifyTriplecastPvE(ref ActionSetting setting)

static partial void ModifyTransposePvE(ref ActionSetting setting)
{
setting.ActionCheck = () => DataCenter.AnimationLocktime <= ElementTimeRaw;
setting.ActionCheck = () => DataCenter.ActionRemain <= ElementTimeRaw;
}

static partial void ModifyUmbralSoulPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => JobGauge.InUmbralIce && DataCenter.AnimationLocktime <= ElementTimeRaw;
setting.ActionCheck = () => JobGauge.InUmbralIce && DataCenter.ActionRemain <= ElementTimeRaw;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/NextActionWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static unsafe void DrawGcdCooldown(float width, bool drawTittle)

ImGui.ProgressBar(group->Elapsed / group->Total, new Vector2(width, height), string.Empty);

var actionRemain = DataCenter.AnimationLocktime;
var actionRemain = DataCenter.ActionRemain;
if (remain > actionRemain + 0.6f + DataCenter.Ping)
{
var value = total - remain + actionRemain;
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,7 @@ private static unsafe void DrawStatus()
ImGui.Text("DPSTaken: " + DataCenter.DPSTaken.ToString());
ImGui.Text("TimeToNext: " + DataCenter.NextAbilityToNextGCD.ToString());
ImGui.Text("WeaponElapsed: " + DataCenter.WeaponElapsed.ToString());
ImGui.Text("AnimationLock: " + DataCenter.AnimationLocktime.ToString());
ImGui.Text("AnimationLock: " + DataCenter.ActionRemain.ToString());

ImGui.Text("Have pet: " + DataCenter.HasPet.ToString());
ImGui.Text("Hostile Near Count: " + DataCenter.NumberOfHostilesInRange.ToString());
Expand Down Expand Up @@ -2520,7 +2520,7 @@ private static void DrawNextAction()

ImGui.Text(ActionUpdater.NextAction?.Name ?? "null");
ImGui.Text("Ability Remain: " + DataCenter.AbilityRemain.ToString());
ImGui.Text("Action Remain: " + DataCenter.AnimationLocktime.ToString());
ImGui.Text("Action Remain: " + DataCenter.ActionRemain.ToString());
ImGui.Text("Weapon Remain: " + DataCenter.WeaponRemain.ToString());
ImGui.Text("Animation Lock Delay: " + ActionManagerHelper.GetCurrentAnimationLock().ToString());
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ internal unsafe static bool CanDoAction()
var nextAction = NextAction;
if (nextAction == null) return false;

var timeToNext = DataCenter.AnimationLocktime;
var timeToNext = DataCenter.ActionRemain;

////No time to use 0gcd
//if (timeToNext + nextAction.AnimationLockTime
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private static void ActionFromSelf(ActionEffectSet set)
OtherConfiguration.AnimationLockTime[id] = set.Header.AnimationLockTime;
}

if (set.TargetEffects.Length == 0) return;
if (!set.TargetEffects.Any()) return;

var action = set.Action;
var tar = set.Target;
Expand Down