This commit is contained in:
Boki 2026-03-03 12:54:30 -05:00
parent a8341e8232
commit a8c43ba7e2
43 changed files with 2618 additions and 48 deletions

View file

@ -142,6 +142,7 @@ public sealed class MemoryPoller : IDisposable
_cache.Terrain = state.Terrain;
_cache.AreaHash = state.AreaHash;
_cache.AreaLevel = state.AreaLevel;
_cache.CharacterName = state.Player.CharacterName;
_cache.LatestState = state;
_cache.ColdTickTimestamp = Environment.TickCount64;
@ -258,12 +259,14 @@ public sealed class MemoryPoller : IDisposable
state.AreaHash = snap.AreaHash;
state.AreaLevel = snap.AreaLevel;
state.CurrentAreaName = _cache.CurrentAreaName;
state.IsLoading = snap.IsLoading;
state.IsEscapeOpen = snap.IsEscapeOpen;
state.CameraMatrix = snap.CameraMatrix;
state.Player = new PlayerState
{
CharacterName = snap.CharacterName,
HasPosition = snap.HasPosition,
Position = snap.HasPosition ? new Vector2(snap.PlayerX, snap.PlayerY) : Vector2.Zero,
Z = snap.PlayerZ,
@ -273,10 +276,24 @@ public sealed class MemoryPoller : IDisposable
ManaTotal = snap.ManaTotal,
EsCurrent = snap.EsCurrent,
EsTotal = snap.EsTotal,
Skills = snap.PlayerSkills?.Select((s, i) => new SkillState
{
SlotIndex = i,
Name = s.Name,
CanBeUsed = s.CanBeUsed,
CooldownRemaining = s.ActiveCooldowns > 0 ? s.CooldownTimeMs : 0,
}).ToList() ?? [],
};
if (snap.Entities is { Count: > 0 })
{
// Extract player action state before filtering
var playerEntity = snap.Entities.FirstOrDefault(e => e.Address == snap.LocalPlayerPtr);
if (playerEntity is not null)
{
state.Player = state.Player with { ActionId = playerEntity.ActionId };
}
var playerPos = state.Player.Position;
var allEntities = new List<EntitySnapshot>(snap.Entities.Count);
var hostiles = new List<EntitySnapshot>();
@ -300,6 +317,17 @@ public sealed class MemoryPoller : IDisposable
state.NearbyLoot = loot;
}
if (snap.QuestFlags is { Count: > 0 })
{
state.ActiveQuests = snap.QuestFlags.Select(q => new QuestProgress
{
QuestName = q.QuestName,
StateId = q.StateId,
StateText = q.StateText,
ProgressText = q.ProgressText,
}).ToList();
}
if (snap.Terrain is not null)
{
state.Terrain = new WalkabilitySnapshot