Skip to content

RevFramework --- Status Effects • Netcode Samples (Example Only)

⚠️ Important Disclaimer\ These files are illustrative only. They show the minimum authority-gating pattern for popular netcode stacks.\ They are not a drop-in multiplayer solution. You are responsible for replication, prediction, reconciliation, and game-specific rules.

StatusEffectController is netcode-agnostic. It does not depend on NGO, Mirror, or Fusion.


What these samples cover

  • Authority gating via IStatusAuthority binders (per stack).\
  • Server/state-authoritative apply/remove flow using a minimal *StatusServerProxy per stack.\
  • Recommended placement: same GameObject as StatusEffectController.

They do not cover:\ Replication of status lists/timers, prediction/rollback, reconciliation, or game-specific rules.\ Those are up to your chosen stack and architecture.


Folder Layout

Samples/
  NetcodeSamples/
    NGO/
      StatusAuthorityBinder_NGO.cs
      NgoStatusServerProxy.cs
    Mirror/
      StatusAuthorityBinder_Mirror.cs
      MirrorStatusServerProxy.cs
    Fusion/
      StatusAuthorityBinder_Fusion.cs
      FusionStatusServerProxy.cs

Each folder is self-contained and can be copied into a project that already uses that netcode.


Enabling the Samples (Scripting Define Symbols)

To compile a stack's sample code, add the corresponding define:

Stack Define Symbol


NGO REV_USE_NGO Mirror REV_USE_MIRROR Fusion REV_USE_FUSION

Unity:\ Project Settings → Player → Other Settings → Scripting Define Symbols (per platform).

If a define is missing, the sample scripts for that stack won't compile --- by design.


Authority Quick Start

Single-player / local testing\ - Leave StatusEffectController.requireAuthority = OFF. Done.

Authoritative multiplayer

  1. Turn ON requireAuthority on each StatusEffectController you intend to mutate via netcode.\
  2. Add exactly one binder that implements IStatusAuthority to the same GameObject:
    • NGO: StatusAuthorityBinder_NGO\
    • Mirror: StatusAuthorityBinder_Mirror\
    • Fusion: StatusAuthorityBinder_Fusion\
  3. Use your stack's RPCs/messages to request Apply/Remove on the server/state authority only.
controller.ApplyStatus(effect, ctx); // or controller.RemoveStatus(id);

If requireAuthority is ON and no binder is found, ticks/mutations will be denied and a warning logged once.


Typical Flow (All Stacks)

  1. Client requests an effect change via RPC to Server/StateAuthority (e.g., apply poison 5s @ 10 DPS).\
  2. Server validates authority via your IStatusAuthority binder.\
  3. Server applies via StatusEffectController.ApplyStatus(...).\
  4. (Optional) Server sends a lightweight RPC to clients for UI/VFX feedback.\
  5. Replication of status state (IDs/timers) is handled by your chosen netcode (NetworkVariables, SyncLists, Networked).

Per-Stack Notes

NGO (Netcode for GameObjects)

  • Use NetworkVariable/FastBufferWriter patterns to replicate current status list or snapshots.\
  • Server RPC for apply/remove; optional Client RPC for feedback.\
  • Binder: StatusAuthorityBinder_NGO (Owner=ON, Server=ON is a sensible default).

Mirror

  • Use [SyncVar], SyncList, or custom messages for replication.\
  • [Command] from client to server for apply/remove; optional [ClientRpc] for feedback.\
  • Binder: StatusAuthorityBinder_Mirror (hasAuthority or server).

Fusion

  • Use [Networked] properties or broadcast RPCs for status replication.\
  • RpcSources.InputAuthority → RpcTargets.StateAuthority for apply/remove.\
  • Binder: StatusAuthorityBinder_Fusion (InputAuthority or StateAuthority).

Troubleshooting


Symptom Likely Cause


"No authority" warnings requireAuthority is ON but no binder is present.

No replication on clients You must replicate manually (NetworkVariable/SyncVar/Networked property).

Prediction/lag issues Out of scope; follow your stack's documentation.

Compilation errors Missing REV_USE_* define for your stack.



Support Stance

These files are provided as keys and illustrative examples only.\ RevFramework does not provide replication, prediction, rollback, or reconciliation.

  • Single-player: use the local binder or disable authority checks.\
  • Multiplayer: you are responsible for replication, prediction, and gameplay rules in your chosen stack.

Multiplayer support is explicitly out of scope for RevFramework.


See also:\ - Authority for full authority architecture.\ - Core for the main controller implementation.\ - Samples for overall demo scene context.