Class TickEventData
Lightweight EventData subtype carrying a network tick for tick-aware triggers.
public class TickEventData : EventData
- Inheritance
-
TickEventData
- Inherited Members
Constructors
TickEventData(ICharacter, PredictionTick, ReplicateState)
Creates tick event data from a replicate input tick, taking its replay answer from the FishNet.Object.Prediction.ReplicateState the dispatch is running under.
public TickEventData(ICharacter character, PredictionTick tick, ReplicateState state)
Parameters
characterICharacterThe event initiator.
tickPredictionTickThe replicate-domain tick.
stateReplicateStateThe replicate state this dispatch is executing under.
Remarks
The preferred form for any dispatch reached from a replicate. IsReplay is then a fact about the execution rather than a claim the caller had to remember to make, which is the whole difference between a guard that protects something and one that reads as though it does. See IsReplay.
TickEventData(ICharacter, PredictionTick, bool)
Creates tick event data from a replicate input tick.
public TickEventData(ICharacter character, PredictionTick tick, bool isReplay = false)
Parameters
characterICharacterThe event initiator.
tickPredictionTickThe replicate-domain tick.
isReplayboolTrue when this execution is a reconcile replay of the tick.
Properties
IsReplay
True when this execution is a reconcile REPLAY of a tick that already ran once.
public bool IsReplay { get; }
Property Value
Remarks
Deliberately separate from IsReplicateTick, which says which CLOCK the
tick is counted on and nothing about how many times it has been executed. Conflating
the two was a real defect: every ability spawn and every self-target dispatch carries a
replicate-domain tick, on the server as much as on the owner, and each of them is
skipped outright on a replayed tick — so a guard that read the domain flag as "this is a
replay" answered true for exactly the dispatches that are never replays. The visible
cost was that PlayFXAction refused every self-buff and self-heal impact effect on
every peer, permanently; the quieter one was that the owner drew no predicted number for
a self-heal.
Set it only where a dispatch genuinely re-runs during a reconcile. Every current dispatch
site gates replays before it builds this payload — ResolveTargetAndSpawn returns
before it spawns, BuffController tests its own isReplayingTick, the
activation triggers test state.ContainsReplayed(), and the hit, tick and destroy
dispatches run off TimeManager.OnTick, which is not replayed — so nothing sets it
today. That is the right place for the gate, not a gap to be plugged here: skipping the
whole dispatch also skips the RNG draws and the selector fan-out inside it, which a flag
read by four actions cannot.
How a site that CANNOT gate says so. By handing over the FishNet.Object.Prediction.ReplicateState
it is running under, not a hand-written bool. The bool overload exists for the sites that
have no replicate state to offer and can therefore prove they are not replays; a
prediction dispatch that has one has no excuse to answer the question from memory, and
the state overload is what makes the answer follow the dispatch instead of being
remembered. BaseAction.IsReplayTick is the consumer.
IsReplicateTick
True when Tick was sourced from a replicate input tick and may be used directly with prediction-domain state such as buff expiry or cooldown start ticks. False when the tick is a raw authoritative wall-clock tick such as TimeManager.LocalTick.
public bool IsReplicateTick { get; }
Property Value
Tick
The tick carried by this event.
public PredictionTick Tick { get; }
Property Value
Methods
IsForCharacter(ICharacter)
Returns true when this tick was sourced from the same character whose prediction-domain state is about to consume it.
public bool IsForCharacter(ICharacter character)
Parameters
characterICharacterThe character whose prediction-domain state will consume the tick.
Returns
- bool
True when the tick belongs to
character.