Skip to content

Commit

Permalink
some guid event cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
EliphasNUIT committed Oct 28, 2024
1 parent 0e635df commit 0300c3d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GW2EIEvtcParser/EIData/Actors/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public IReadOnlyList<GenericSegment<string>> GetCommanderStates(ParsedEvtcLog lo
foreach (MarkerEvent markerEvent in markerEvents)
{
MarkerGUIDEvent marker = markerEvent.GUIDEvent;
if (marker != null)
if (marker.ContentID >= 0)
{
if (MarkerGUIDs.CommanderTagMarkersHexGUIDs.Contains(marker.HexContentGUID))
{
Expand Down
4 changes: 2 additions & 2 deletions GW2EIEvtcParser/ParsedData/CombatData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ internal EffectGUIDEvent GetEffectGUIDEvent(long effectID)
throw new EvtcCombatEventException("Missing GUID event for effect " + effectID);
}
#endif
return null;
return EffectGUIDEvent.DummyEffectGUID;
}

/// <summary>
Expand Down Expand Up @@ -1618,7 +1618,7 @@ internal MarkerGUIDEvent GetMarkerGUIDEvent(long markerID)
{
return evt;
}
return null;
return MarkerGUIDEvent.DummyMarkerGUID;
}

public IReadOnlyList<GliderEvent> GetGliderEvents(AgentItem src)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
{
public class EffectGUIDEvent : IDToGUIDEvent
{
internal static EffectGUIDEvent DummyEffectGUID = new EffectGUIDEvent();
internal EffectGUIDEvent(CombatItem evtcItem) : base(evtcItem)
{
}

internal EffectGUIDEvent() : base()
{
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ internal IDToGUIDEvent(CombatItem evtcItem) : base(evtcItem)
(HexContentGUID, Base64ContentGUID) = UnpackGUID(evtcItem.SrcAgent, evtcItem.DstAgent);
ContentID = evtcItem.SkillID;
}

internal IDToGUIDEvent() : base()
{
(HexContentGUID, Base64ContentGUID) = ("", "");
ContentID = -1;
}
internal static (string hex, string base64) UnpackGUID(ulong first8, ulong last8)
{
byte[] guid = new byte[16];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
{
public class MarkerGUIDEvent : IDToGUIDEvent
{
internal static MarkerGUIDEvent DummyMarkerGUID = new MarkerGUIDEvent();
internal MarkerGUIDEvent(CombatItem evtcItem) : base(evtcItem)
{
}
internal MarkerGUIDEvent() : base()
{
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ public abstract class EffectEvent : AbstractEffectEvent
/// Id of the created visual effect. Match to stable GUID with <see cref="EffectGUIDEvent"/>.
/// </summary>
public long EffectID { get; }

/// <summary>
/// GUID event of the effect, can not be null
/// </summary>
public EffectGUIDEvent GUIDEvent { get; private set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
{
public class MarkerEvent : AbstractStatusEvent
{
/// <summary>
/// ID of the marker. Match to stable GUID with <see cref="MarkerGUIDEvent"/>.
/// </summary>
public int MarkerID { get; }
/// <summary>
/// GUID event of the effect, can not be null
/// </summary>
public MarkerGUIDEvent GUIDEvent { get; private set; }
/// <summary>
/// Time at which marker has been removed.
/// </summary>
public long EndTime { get; protected set; } = int.MaxValue;

internal bool IsEnd => MarkerID == 0;
Expand Down

0 comments on commit 0300c3d

Please sign in to comment.