Skip to content

Commit

Permalink
Analytics: Add AgentMarkerRemoveAll event
Browse files Browse the repository at this point in the history
  • Loading branch information
Sejsel committed Jul 8, 2024
1 parent 5bd986a commit ce7d01d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions ArcdpsLogManager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This is the full changelog of the arcdps Log Manager.
- Added CrowdControlEvent (crowd control against non-defiant enemies); requires arcdps 2024-06-27 or newer.
- Added old team ids to TeamChangeEvent; requires arcdps 2024-06-12 or newer.
- Added RateHealthEvent (reports simulation tick rate drops when server cannot keep up/connection lags); requires arcdps 2022-05-20 or newer.
- Added AgentMarkerRemoveAllEvent; common with arcdps 2024-03-28 or newer.

## Log Manager v1.11.1

Expand Down
2 changes: 1 addition & 1 deletion ArcdpsLogManager/Logs/LogData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public void ProcessLog(LogAnalytics logAnalytics)
HealthPercentage = 0;
}

var tagEvents = log.Events.OfType<AgentMarkerEvent>().Where(x => x.Marker.Id != 0 && x.Agent is Player).ToList();
var tagEvents = log.Events.OfType<AgentMarkerEvent>().Where(x => x.Agent is Player).ToList();
Players = analyzer.GetPlayers().Where(x => x.Identified).Select(p =>
new LogPlayer(p.Name, p.AccountName, p.Subgroup, p.Profession, p.EliteSpecialization,
GetGuildGuid(p.GuildGuid))
Expand Down
15 changes: 11 additions & 4 deletions EVTCAnalytics/Events/AgentEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,12 @@ public class AgentMaxHealthUpdateEvent(long time, Agent agent, ulong newMaxHealt
}

/// <summary>
/// An event specifying that an <see cref="Agent"/> has a tag. Typically, a <see cref="Player"/> with a Commander tag.
/// An event specifying that an <see cref="Agent"/> has a tag/marker. Typically, a <see cref="Player"/> with a Commander tag.
/// </summary>
/// <remarks>
/// Introduced in EVTC20200609. 20240328
/// Introduced in EVTC20200609. Prior to EVTC20240328, this only happened at the start of a log, since then it can happen at any time.
/// </remarks>
public class AgentMarkerEvent(long time, Agent agent, Marker marker, bool? isCommander)
: AgentEvent(time, agent)
public class AgentMarkerEvent(long time, Agent agent, Marker marker, bool? isCommander) : AgentEvent(time, agent)
{
public Marker Marker { get; } = marker;

Expand All @@ -127,6 +126,14 @@ public class AgentMarkerEvent(long time, Agent agent, Marker marker, bool? isCom
public bool? IsCommander { get; } = isCommander;
}

/// <summary>
/// An event specifying that all tags/markers of an <see cref="Agent"/> have been removed.
/// </summary>
/// <remarks>
/// Commonyl used since EVTC20240328.
/// </remarks>
public class AgentMarkerRemoveAllEvent(long time, Agent agent) : AgentEvent(time, agent);

/// <summary>
/// An event specifying that an <see cref="Agent"/> has an ongoing buff at the time tracking starts.
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions EVTCAnalytics/Parsing/CombatItemFilters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ private static IEnumerable<StateChange> GetDirectStateChangesForEventType(Type e
if (eventType == typeof(AgentWeaponSwapEvent)) return [StateChange.WeaponSwap];
if (eventType == typeof(AgentMaxHealthUpdateEvent)) return [StateChange.MaxHealthUpdate];
if (eventType == typeof(AgentMarkerEvent)) return [StateChange.Tag];
if (eventType == typeof(AgentMarkerRemoveAllEvent)) return [StateChange.Tag];
if (eventType == typeof(InitialBuffEvent)) return [StateChange.BuffInitial];
if (eventType == typeof(PositionChangeEvent)) return [StateChange.Position];
if (eventType == typeof(VelocityChangeEvent)) return [StateChange.Velocity];
Expand Down Expand Up @@ -261,6 +262,7 @@ private static IEnumerable<StateChange> GetDirectStateChangesForEventType(Type e
if (eventType == typeof(DefianceBarDamageEvent)) return [];

if (eventType == typeof(RewardEvent)) return [StateChange.Reward];
if (eventType == typeof(RateHealthEvent)) return [StateChange.TickRate];

if (eventType == typeof(CrowdControlEvent)) return [];

Expand Down Expand Up @@ -301,6 +303,7 @@ private static bool IsDirectBuffDamage(Type eventType)
if (eventType == typeof(AgentWeaponSwapEvent)) return false;
if (eventType == typeof(AgentMaxHealthUpdateEvent)) return false;
if (eventType == typeof(AgentMarkerEvent)) return false;
if (eventType == typeof(AgentMarkerRemoveAllEvent)) return false;
if (eventType == typeof(InitialBuffEvent)) return false;
if (eventType == typeof(PositionChangeEvent)) return false;
if (eventType == typeof(VelocityChangeEvent)) return false;
Expand Down Expand Up @@ -337,6 +340,7 @@ private static bool IsDirectBuffDamage(Type eventType)
if (eventType == typeof(CrowdControlEvent)) return false;

if (eventType == typeof(RewardEvent)) return false;
if (eventType == typeof(RateHealthEvent)) return false;

if (eventType == typeof(SkillCastEvent)) return false;
if (eventType == typeof(EndSkillCastEvent)) return false;
Expand Down Expand Up @@ -373,6 +377,7 @@ private static bool IsDirectSkillCast(Type eventType)
if (eventType == typeof(AgentWeaponSwapEvent)) return false;
if (eventType == typeof(AgentMaxHealthUpdateEvent)) return false;
if (eventType == typeof(AgentMarkerEvent)) return false;
if (eventType == typeof(AgentMarkerRemoveAllEvent)) return false;
if (eventType == typeof(InitialBuffEvent)) return false;
if (eventType == typeof(PositionChangeEvent)) return false;
if (eventType == typeof(VelocityChangeEvent)) return false;
Expand Down Expand Up @@ -409,6 +414,7 @@ private static bool IsDirectSkillCast(Type eventType)
if (eventType == typeof(CrowdControlEvent)) return false;

if (eventType == typeof(RewardEvent)) return false;
if (eventType == typeof(RateHealthEvent)) return false;

if (eventType == typeof(SkillCastEvent)) return false;
if (eventType == typeof(EndSkillCastEvent)) return true;
Expand Down Expand Up @@ -445,6 +451,7 @@ private static IEnumerable<Result> GetDirectPhysicalResultsForEventType(Type eve
if (eventType == typeof(AgentWeaponSwapEvent)) return [];
if (eventType == typeof(AgentMaxHealthUpdateEvent)) return [];
if (eventType == typeof(AgentMarkerEvent)) return [];
if (eventType == typeof(AgentMarkerEvent)) return [];
if (eventType == typeof(InitialBuffEvent)) return [];
if (eventType == typeof(PositionChangeEvent)) return [];
if (eventType == typeof(VelocityChangeEvent)) return [];
Expand Down Expand Up @@ -481,6 +488,7 @@ private static IEnumerable<Result> GetDirectPhysicalResultsForEventType(Type eve
if (eventType == typeof(CrowdControlEvent)) return [Result.CrowdControl];

if (eventType == typeof(RewardEvent)) return [];
if (eventType == typeof(RateHealthEvent)) return [];

if (eventType == typeof(SkillCastEvent)) return [];
if (eventType == typeof(EndSkillCastEvent)) return [];
Expand Down
5 changes: 5 additions & 0 deletions EVTCAnalytics/Processing/LogProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,11 @@ static WeaponSet WeaponSetFromId(long id)
return new UnknownEvent(item.Time, item);
case StateChange.Tag:
uint markerId = (uint) item.Value;
if (markerId == 0)
{
return new AgentMarkerRemoveAllEvent(item.Time, GetAgentByAddress(item.SrcAgent));
}

if (!state.MarkersById.TryGetValue(markerId, out Marker marker))
{
marker = new Marker(markerId);
Expand Down

0 comments on commit ce7d01d

Please sign in to comment.