Skip to content

Commit

Permalink
DT updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Jun 29, 2024
1 parent 39cd28b commit f4362a1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 27 deletions.
20 changes: 10 additions & 10 deletions BossMod.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions BossMod/Autorotation/Legacy/CommonState.cs
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 1 addition & 3 deletions BossMod/Debug/DebugParty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");

Expand Down
2 changes: 1 addition & 1 deletion BossMod/Debug/DebugTiming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 0 additions & 3 deletions BossMod/Framework/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
12 changes: 6 additions & 6 deletions BossMod/Framework/WorldStateGameSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion FFXIVClientStructs

0 comments on commit f4362a1

Please sign in to comment.