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

Commit

Permalink
fix: removed ping caculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 26, 2023
1 parent 815ace2 commit fc545bd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
1 change: 1 addition & 0 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"7527": 0.6,
"7528": 0.6,
"7529": 0.6,
"7541": 0.6,
"7546": 0.6,
"7548": 0.6,
"7557": 0.6,
Expand Down
15 changes: 2 additions & 13 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,8 @@ public static float DPSTaken
public static ActionID LastGCD { get; private set; } = 0;

public static ActionID LastAbility { get; private set; } = 0;
public static float Ping => Math.Min(Math.Min(ActionFetchTime /2, Service.Config.MaxPing),
LastRTT == 0 ? float.MaxValue : LastRTT);
public static float ActionFetchTime { get; private set; } = 0.07f;
public static float LastRTT { get; set; } = 0;
public static float Ping => Math.Min(Service.Config.MaxPing, LastRTT);
public static float LastRTT { get; set; } = 0.1f;

public const float MinAnimationLock = 0.6f;
public static unsafe void AddActionRec(Action act)
Expand All @@ -328,18 +326,9 @@ public static unsafe void AddActionRec(Action act)
case ActionCate.Spell:
case ActionCate.WeaponSkill:
LastAction = LastGCD = id;
if (ActionManager.GetAdjustedCastTime(ActionType.Spell, (uint)id) == 0)
{
ActionFetchTime = WeaponElapsed;
}
break;
case ActionCate.Ability:
LastAction = LastAbility = id;

if (!act.IsRealGCD() && ActionManager.GetMaxCharges((uint)id, Service.Player.Level) < 2)
{
ActionFetchTime = ActionManager.Instance()->GetRecastGroupDetail(act.CooldownGroup - 1)->Elapsed;
}
break;
default:
return;
Expand Down
1 change: 0 additions & 1 deletion RotationSolver/UI/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ private unsafe void DrawStatus()
ImGui.Text("TimeToNext: " + DataCenter.NextAbilityToNextGCD.ToString());
ImGui.Text("WeaponElapsed: " + DataCenter.WeaponElapsed.ToString());
ImGui.Text("AnimationLock: " + DataCenter.ActionRemain.ToString());
ImGui.Text("Fetch Time: " + DataCenter.ActionFetchTime.ToString());

ImGui.Text("Have pet: " + DataCenter.HasPet.ToString());
ImGui.Text("Hostile Near Count: " + DataCenter.NumberOfHostilesInRange.ToString());
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private void DrawParamBasic()
ref Service.Config.MaxPing, Service.Default.MaxPing, min: 100, max: 500);

ImGui.SameLine();
ImGui.Text($" Ping:{DataCenter.LastRTT:F3} Fetch: {DataCenter.ActionFetchTime:F3}");
ImGui.Text($" Ping:{DataCenter.LastRTT:F3}");

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_ActionAhead,
ref Service.Config.ActionAhead, Service.Default.ActionAhead, max: 0.5f);
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ internal unsafe static void DoAction()
&& ActionManager.Instance()->QueuedActionId != NextAction.AdjustedID
|| Service.Player.CurrentHp == 0) return;

var maxAhead = Math.Max(DataCenter.MinAnimationLock - DataCenter.ActionFetchTime - 0.03f, 0.08f);
var maxAhead = Math.Max(DataCenter.MinAnimationLock - DataCenter.Ping, 0.08f);
var ahead = Math.Min(maxAhead, Service.Config.ActionAhead);

//GCD
Expand Down

0 comments on commit fc545bd

Please sign in to comment.