Skip to content

Commit e8f9a01

Browse files
committed
[Analytics] Added MapChangeEvent
1 parent 3480c21 commit e8f9a01

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

EVTCAnalytics/Events/LogEvents.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,19 @@ public class LogNPCUpdateEvent(long time, ulong specieId, Agent agent, int times
6161
/// </summary>
6262
public int Timestamp { get; } = timestamp;
6363
}
64+
65+
/// <summary>
66+
/// Player changed map event.
67+
/// </summary>
68+
public class MapChangeEvent(long time, ulong newMapID, ulong oldMapID) : Event(time)
69+
{
70+
/// <summary>
71+
/// New Map ID
72+
/// </summary>
73+
public ulong NewMapID { get; } = newMapID;
74+
/// <summary>
75+
/// Old Map ID
76+
/// </summary>
77+
public ulong OldMapID { get; } = oldMapID;
78+
}
6479
}

EVTCAnalytics/Parsed/Enums/StateChange.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ public enum StateChange : byte
6161
SquadMarker = 53, // Added 20240328
6262
ArcBuild = 54, // Added 20240614
6363
Glider = 55, // Added 20240627
64+
MapChange = 65,
6465
};
6566
}

EVTCAnalytics/Parsing/CombatItemFilters.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ private static IEnumerable<StateChange> GetDirectStateChangesForEventType(Type e
266266
if (eventType == typeof(RateHealthEvent)) return [StateChange.TickRate];
267267
if (eventType == typeof(StatResetEvent)) return [StateChange.StatReset];
268268
if (eventType == typeof(LogNPCUpdateEvent)) return [StateChange.LogNPCUpdate];
269+
if (eventType == typeof(MapChangeEvent)) return [StateChange.MapChange];
269270

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

@@ -347,6 +348,7 @@ private static bool IsDirectBuffDamage(Type eventType)
347348
if (eventType == typeof(RateHealthEvent)) return false;
348349
if (eventType == typeof(StatResetEvent)) return false;
349350
if (eventType == typeof(LogNPCUpdateEvent)) return false;
351+
if (eventType == typeof(MapChangeEvent)) return false;
350352

351353
if (eventType == typeof(SkillCastEvent)) return false;
352354
if (eventType == typeof(EndSkillCastEvent)) return false;
@@ -424,6 +426,7 @@ private static bool IsDirectSkillCast(Type eventType)
424426
if (eventType == typeof(RateHealthEvent)) return false;
425427
if (eventType == typeof(StatResetEvent)) return false;
426428
if (eventType == typeof(LogNPCUpdateEvent)) return false;
429+
if (eventType == typeof(MapChangeEvent)) return false;
427430

428431
if (eventType == typeof(SkillCastEvent)) return false;
429432
if (eventType == typeof(EndSkillCastEvent)) return true;
@@ -501,6 +504,7 @@ private static IEnumerable<Result> GetDirectPhysicalResultsForEventType(Type eve
501504
if (eventType == typeof(RateHealthEvent)) return [];
502505
if (eventType == typeof(StatResetEvent)) return [];
503506
if (eventType == typeof(LogNPCUpdateEvent)) return [];
507+
if (eventType == typeof(MapChangeEvent)) return [];
504508

505509
if (eventType == typeof(SkillCastEvent)) return [];
506510
if (eventType == typeof(EndSkillCastEvent)) return [];
@@ -590,6 +594,7 @@ public static bool IsAlwaysKept(StateChange stateChange)
590594
StateChange.SquadMarker => false,
591595
StateChange.ArcBuild => true,
592596
StateChange.Glider => false,
597+
StateChange.MapChange => false,
593598
_ => throw new ArgumentOutOfRangeException(nameof(stateChange), stateChange, null)
594599
};
595600
}

EVTCAnalytics/Processing/LogProcessor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,10 @@ static WeaponSet WeaponSetFromId(long id)
13281328
_ => new UnknownEvent(item.Time, item)
13291329
};
13301330
}
1331+
case StateChange.MapChange:
1332+
{
1333+
return new MapChangeEvent(item.Time, item.SrcAgent, item.DstAgent);
1334+
}
13311335
default:
13321336
return new UnknownEvent(item.Time, item);
13331337
}

0 commit comments

Comments
 (0)