RevFramework — Status Effects • Authority¶
⚠️ Not a multiplayer framework.
This folder provides the authority hooks used by the Status system
(IStatusAuthority, resolver, binders).
It does not implement replication, prediction, rollback, or reconciliation.
These components determine who is allowed to mutate a StatusEffectController
(Apply, Refresh, Remove, Dispel, Tick).
They are runtime, netcode‑agnostic, and safe to use with any networking stack.
✅ Works in single‑player and multiplayer
✅ No dependency on any netcode package
✅ Your netcode decides who has authority — RevFramework only exposes a hook
Table of Contents¶
Overview¶
To enable authority gating:
- Add StatusEffectController to your actor
- Enable Require Authority
- Provide an IStatusAuthority binder — this decides whether the controller may tick or mutate
Authority is OPT‑IN per StatusEffectController.
If Require Authority is OFF, all authority binders are ignored by design
and status ticks and mutations proceed normally.
If requireAuthority = true and no valid binder is resolved,
all mutations become no‑ops, including:
- ApplyStatus
- Refresh
- RemoveStatus
- ClearAll
- Dispel / Cleanse
- Tick (time progression)
Only one IStatusAuthority is cached per scene — your binder must encode all authority rules.
Quick Start¶
Single‑player¶
- Add
StatusEffectController - Leave
requireAuthority = false(default permissive mode) - Or add the built‑in local binder for explicit allow:
[AddComponentMenu("RevFramework/Status/Authority/Status Authority Binder (Local)")]
public sealed class StatusAuthorityBinder : MonoBehaviour, IStatusAuthority
{
public bool alwaysTrue = true;
public bool HasAuthority(StatusEffectController c) => alwaysTrue;
}
Multiplayer¶
- Implement your own
IStatusAuthoritybinder for your netcode stack - Attach it to the same GameObject as the controller (fastest resolution path)
- Return
trueonly when the local peer may mutate state - Replicate status state yourself
RevFramework never replicates statuses for you.
Components & API¶
IStatusAuthority — minimal authority interface¶
public interface IStatusAuthority
{
bool HasAuthority(StatusEffectController controller);
}
Binders may live on:
- The controller GameObject
- A parent transform
- A scene‑level authority singleton
StatusAuthority — resolver & scene cache¶
Per‑scene resolver used by StatusEffectController when authority is required.
Resolution order:
- Scene cache (fast path)
- Local component on controller GameObject
- Parent transforms
- Scene roots
- Global scan (includes inactive — editor warning only)
API:
public static IStatusAuthority Resolve(MonoBehaviour ctx);
public static IStatusAuthority Resolve(Component c);
public static IStatusAuthority Resolve(GameObject go);
public static void Invalidate(); // all scenes
public static void Invalidate(Scene scene); // specific scene
Call Invalidate() when spawning binders dynamically at runtime.
How Status uses authority¶
- Controlled by the
requireAuthorityflag onStatusEffectController - When enabled, the controller resolves a binder using the cached resolver
- If the binder returns false, or no binder resolves:
All status mutations become no‑ops
This gates:
- Apply / Refresh
- Remove / ClearAll
- Dispel / Cleanse
- Effect ticking and expiry
Single‑player¶
- Leave
requireAuthority = false, or - Use a local binder that always returns true
Multiplayer¶
You decide:
- Server‑only ticking
- Owner‑only mutation
- Hybrid or predicted models
RevFramework does not impose rules.
Gotchas¶
requireAuthority = falseis fully permissive- Turning it on without a binder freezes all effects (by design)
- Only one binder is cached per scene
- Dynamically spawned binders require
Invalidate() - Your binder must encode all authority rules — only one is used
Extending¶
Implement IStatusAuthority for your netcode:
Unity NGO¶
public bool HasAuthority(StatusEffectController c)
=> c.TryGetComponent(out NetworkObject n)
&& (n.IsServer || n.IsOwner);
Mirror¶
public bool HasAuthority(StatusEffectController c)
=> c.TryGetComponent(out NetworkIdentity n)
&& (n.isServer || n.hasAuthority);
Fusion¶
public bool HasAuthority(StatusEffectController c)
=> c.TryGetComponent(out NetworkObject n)
&& (n.HasStateAuthority || n.HasInputAuthority);
Custom netcode¶
Return true only for the peer that owns simulation authority.
Support Stance¶
This folder provides hooks only.
RevFramework does not implement:
- Status replication
- State synchronization
- Prediction / rollback
- Reconciliation
- Ownership transfer logic
Summary¶
- Single‑player: permissive mode or local binder
- Multiplayer: you integrate replication + authority
- Multiplayer support is explicitly out of scope