AbilityReconcileData - jimdroberts/FishMMO GitHub Wiki
Reconcile data for ability state, used for network prediction reconciliation. Encapsulates ability ID, remaining time, resource state, and network tick for synchronizing ability state corrections across the network in FishMMO.
-
public long AbilityID
The ID of the ability.
-
public float RemainingTime
The remaining cooldown or active time for the ability.
-
public CharacterAttributeResourceState ResourceState
The resource state associated with the ability.
-
private uint _tick
Internal network tick value for prediction reconciliation.
-
public AbilityReconcileData(long abilityID, float remainingTime, CharacterAttributeResourceState resourceState)
Initializes a new instance of the AbilityReconcileData struct. abilityID: long - Ability ID. remainingTime: float - Remaining time. resourceState: CharacterAttributeResourceState - Resource state.
-
public void Dispose()
Disposes the reconcile data (no-op).
-
public uint GetTick()
Gets the network tick value. Returns: uint - The tick value.
-
public void SetTick(uint value)
Sets the network tick value. value: uint - Tick value.
- Use
AbilityReconcileData
as the data structure for network-predicted ability state reconciliation. - Populate the struct with ability ID, remaining time, and resource state when sending reconciliation data.
- Use
GetTick
andSetTick
to synchronize network prediction ticks as required by FishNet's prediction system.
// Example 1: Creating and using AbilityReconcileData
var reconcileData = new AbilityReconcileData(abilityID, remainingTime, resourceState);
reconcileData.SetTick(currentTick);
// Example 2: Accessing reconcile data fields
long id = reconcileData.AbilityID;
float time = reconcileData.RemainingTime;
CharacterAttributeResourceState state = reconcileData.ResourceState;
- Always set the network tick value when using reconcile data for prediction to ensure synchronization.
- Use clear and consistent values for AbilityID and RemainingTime to avoid ambiguity in state reconciliation.
- Dispose is a no-op but should be called if required by interface contracts.
- Integrate with FishNet's prediction and reconciliation systems for robust networked ability handling.