From f4362a1ba1a28780e13944dd31424c73ae8170c0 Mon Sep 17 00:00:00 2001 From: Andrew Gilewsky Date: Sat, 29 Jun 2024 23:31:48 +0100 Subject: [PATCH] DT updates. --- BossMod.sln | 20 ++++++++++---------- BossMod/Autorotation/Legacy/CommonState.cs | 4 +--- BossMod/Debug/DebugParty.cs | 4 +--- BossMod/Debug/DebugTiming.cs | 2 +- BossMod/Framework/Plugin.cs | 3 --- BossMod/Framework/WorldStateGameSync.cs | 12 ++++++------ FFXIVClientStructs | 2 +- 7 files changed, 20 insertions(+), 27 deletions(-) diff --git a/BossMod.sln b/BossMod.sln index 668192feec..b93e427d9c 100644 --- a/BossMod.sln +++ b/BossMod.sln @@ -11,12 +11,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeAnalysis", "CodeAnalysi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFXIVClientStructs", "FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj", "{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFXIVClientStructs.InteropSourceGenerators", "FFXIVClientStructs\FFXIVClientStructs.InteropSourceGenerators\FFXIVClientStructs.InteropSourceGenerators.csproj", "{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropGenerator", "FFXIVClientStructs\InteropGenerator\InteropGenerator.csproj", "{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropGenerator.Runtime", "FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj", "{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFXIVClientStructs.Generators", "FFXIVClientStructs\FFXIVClientStructs.Generators\FFXIVClientStructs.Generators.csproj", "{D3161934-48A0-43BA-8A34-2D772495BC24}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -57,14 +57,6 @@ Global {A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Release|Any CPU.Build.0 = Release|Any CPU {A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Release|x64.ActiveCfg = Release|Any CPU {A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Release|x64.Build.0 = Release|Any CPU - {0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Debug|x64.ActiveCfg = Debug|Any CPU - {0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Debug|x64.Build.0 = Debug|Any CPU - {0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Release|Any CPU.Build.0 = Release|Any CPU - {0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Release|x64.ActiveCfg = Release|Any CPU - {0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Release|x64.Build.0 = Release|Any CPU {95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Debug|Any CPU.Build.0 = Debug|Any CPU {95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -81,6 +73,14 @@ Global {6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Release|Any CPU.Build.0 = Release|Any CPU {6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Release|x64.ActiveCfg = Release|Any CPU {6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Release|x64.Build.0 = Release|Any CPU + {D3161934-48A0-43BA-8A34-2D772495BC24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3161934-48A0-43BA-8A34-2D772495BC24}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3161934-48A0-43BA-8A34-2D772495BC24}.Debug|x64.ActiveCfg = Debug|Any CPU + {D3161934-48A0-43BA-8A34-2D772495BC24}.Debug|x64.Build.0 = Debug|Any CPU + {D3161934-48A0-43BA-8A34-2D772495BC24}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3161934-48A0-43BA-8A34-2D772495BC24}.Release|Any CPU.Build.0 = Release|Any CPU + {D3161934-48A0-43BA-8A34-2D772495BC24}.Release|x64.ActiveCfg = Release|Any CPU + {D3161934-48A0-43BA-8A34-2D772495BC24}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BossMod/Autorotation/Legacy/CommonState.cs b/BossMod/Autorotation/Legacy/CommonState.cs index 81006ff478..6d309054df 100644 --- a/BossMod/Autorotation/Legacy/CommonState.cs +++ b/BossMod/Autorotation/Legacy/CommonState.cs @@ -1,6 +1,4 @@ -using FFXIVClientStructs.FFXIV.Client.Graphics.Render; - -namespace BossMod.Autorotation.Legacy; +namespace BossMod.Autorotation.Legacy; // TODO: a _lot_ of this stuff should be reworked... public abstract class CommonState(RotationModule module) diff --git a/BossMod/Debug/DebugParty.cs b/BossMod/Debug/DebugParty.cs index 54481de9e0..1cbf7bf3de 100644 --- a/BossMod/Debug/DebugParty.cs +++ b/BossMod/Debug/DebugParty.cs @@ -38,9 +38,7 @@ public unsafe void DrawPartyCustom(bool secondary) { // note: alliance slots, unlike normal slots, are more permanent - if a player leaves, other players retain their indices (leaving gaps) // also content ID for all alliance members always seems to be 0; this isn't a huge deal, since alliance members are always in the same zone and thus have valid object IDs - var gm = GroupManager.Instance(); - if (secondary) - gm += 1; + var gm = GroupManager.Instance()->GetGroup(secondary); var ui = UIState.Instance(); ImGui.TextUnformatted($"Num members: {gm->MemberCount}, alliance={(!gm->IsAlliance ? "no" : gm->IsSmallGroupAlliance ? "small-group" : "yes")}, has-helpers={ui->Buddy.DutyHelperInfo.HasHelpers}"); diff --git a/BossMod/Debug/DebugTiming.cs b/BossMod/Debug/DebugTiming.cs index cdb51bf7e9..0a75887872 100644 --- a/BossMod/Debug/DebugTiming.cs +++ b/BossMod/Debug/DebugTiming.cs @@ -24,7 +24,7 @@ public unsafe void Draw() ImGui.TextUnformatted($"dt real: {dtReal} = raw + {dtReal - fwk->RealFrameDeltaTime}"); ImGui.TextUnformatted($"dt ms granularity: {fwk->FrameDeltaTimeMSInt} + {fwk->FrameDeltaTimeMSRem}"); ImGui.TextUnformatted($"dt us granularity: {fwk->FrameDeltaTimeUSInt} + {fwk->FrameDeltaTimeUSRem}"); - ImGui.TextUnformatted($"dt timer: {DateTime.UnixEpoch.AddSeconds(fwk->UtcTime.TimeStamp)}"); + ImGui.TextUnformatted($"dt timer: {DateTime.UnixEpoch.AddSeconds(fwk->UtcTime.Timestamp)}"); _prevFrameCounter = fwk->FrameCounter; _prevQPC = fwk->PerformanceCounterValue; } diff --git a/BossMod/Framework/Plugin.cs b/BossMod/Framework/Plugin.cs index 79919a6646..e6cacc4b8c 100644 --- a/BossMod/Framework/Plugin.cs +++ b/BossMod/Framework/Plugin.cs @@ -59,9 +59,6 @@ public unsafe Plugin(DalamudPluginInterface dalamud, ICommandManager commandMana Network.IDScramble.Initialize(); Camera.Instance = new(); - var manager = Service.SigScanner.GetStaticAddressFromSig("48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 0F 28 F0 45 0F 57 C0"); - Service.Log($"foo: {manager:X}"); - Service.Config.Initialize(); Service.Config.LoadFromFile(dalamud.ConfigFile); Service.Config.Modified.Subscribe(() => Service.Config.SaveToFile(dalamud.ConfigFile)); diff --git a/BossMod/Framework/WorldStateGameSync.cs b/BossMod/Framework/WorldStateGameSync.cs index f6c375010f..2b9cd09ab3 100644 --- a/BossMod/Framework/WorldStateGameSync.cs +++ b/BossMod/Framework/WorldStateGameSync.cs @@ -16,7 +16,7 @@ namespace BossMod; // utility that updates a world state to correspond to game state sealed class WorldStateGameSync : IDisposable { - private const int ObjectTableSize = 599; // should match CS; note that different ranges are used for different purposes - consider splitting?.. + private const int ObjectTableSize = 629; // should match CS; note that different ranges are used for different purposes - consider splitting?.. private const uint InvalidEntityId = 0xE0000000; private readonly WorldState _ws; @@ -287,7 +287,7 @@ private unsafe void UpdateActor(GameObject* obj, int index, Actor? act) TargetID = SanitizedObjectID(castInfo->TargetId), Rotation = chr->CastRotation.Radians(), Location = castInfo->TargetLocation, - TotalTime = castInfo->TotalCastTime, // TODO: should it use adjusted here?.. + TotalTime = castInfo->BaseCastTime, // TODO: should it use total (adjusted) here?.. FinishAt = _ws.CurrentTime.AddSeconds(Math.Clamp(castInfo->TotalCastTime - castInfo->CurrentCastTime, 0, 100000)), Interruptible = castInfo->Interruptible != 0, } : null; @@ -351,17 +351,17 @@ private void UpdateActorStatus(Actor act, int index, ActorStatus value) private unsafe void UpdateParty() { - var gm = GroupManager.Instance(); + var replay = Service.Condition[Dalamud.Game.ClientState.Conditions.ConditionFlag.DutyRecorderPlayback]; + var gm = GroupManager.Instance()->GetGroup(replay); var ui = UIState.Instance(); var pc = GameObjectManager.Instance()->Objects.IndexSorted[0].Value; var pcContentId = UIState.Instance()->PlayerState.ContentId; var pcEntityId = UIState.Instance()->PlayerState.EntityId; - if (Service.Condition[Dalamud.Game.ClientState.Conditions.ConditionFlag.DutyRecorderPlayback]) + if (replay) { // when doing replay playback, game uses independent group manager - gm += 1; pcEntityId = pc != null ? pc->EntityId : 0; - var member = pc != null ? gm->GetPartyMemberByObjectId(pcEntityId) : null; + var member = pc != null ? gm->GetPartyMemberByEntityId(pcEntityId) : null; pcContentId = member != null ? member->ContentId : 0; } else if (pc != null && pc->EntityId != pcEntityId) diff --git a/FFXIVClientStructs b/FFXIVClientStructs index ee209b7e04..bf40da1d66 160000 --- a/FFXIVClientStructs +++ b/FFXIVClientStructs @@ -1 +1 @@ -Subproject commit ee209b7e042dc63e831cb8f5ae5b79542d747b5d +Subproject commit bf40da1d66c10042136177ea180b0c5f25c5b74a