Skip to content

RevFramework – Pickup Authority

Folder: Runtime/Systems/Pickups/Authority

⚠️ RevFramework is not a multiplayer framework.
This folder provides the authority hook used by pickups. Replication, ownership, prediction, rollback, and reconciliation are your netcode’s responsibility.

This subsystem is a runtime, netcode-agnostic authority check for determining who is allowed to consume world pickups.

✔ Single-player safe (out of the box)
✔ Multiplayer-ready architecture (bring your own netcode)
✔ Zero hard dependency on NGO / Mirror / Fusion / Photon
✔ One tiny interface: IPickupAuthority


📦 Overview

IPickupAuthority

A minimal contract that defines who is allowed to consume a pickup.

public interface IPickupAuthority
{
    bool HasAuthority(GameObject actor);
}

Implement this interface wherever your authority logic naturally lives:

  • scene root
  • player root
  • server / host authority object
  • netcode controller
  • team, faction, or ownership manager

There is no assumption about networking stack, ownership model, or replication strategy.


PickupAuthority (static resolver + scene cache)

Resolves one usable IPickupAuthority per scene and caches it for fast lookups.

Resolution order (first usable wins):

  1. Scene cache (fast path)
  2. GetComponentInParent<IPickupAuthority>(true)
  3. searches the context object and its parents
  4. includes inactive objects for discovery
  5. Scene roots (GetComponentInChildren<IPickupAuthority>(true))
  6. Global scan of all active & enabled MonoBehaviours
  7. Cache null if none found (prevents repeated scans)

The cache is automatically cleared when:

  • scenes unload
  • the active scene changes
  • a domain reload occurs (RuntimeInitializeOnLoadMethod.SubsystemRegistration)

If you add or remove binders dynamically at runtime, call:

PickupAuthority.Invalidate();

PickupAuthorityBinder (single-player default)

public bool alwaysTrue = true;

public bool HasAuthority(GameObject actor)
{
    return actor != null && alwaysTrue;
}

Attach this component to allow all actors to consume pickups.

Intended use:

  • single-player games
  • early prototyping
  • tooling / QA scenes
  • non-networked projects

⚠️ Important:
This binder is intentionally single-player permissive. For multiplayer, you are expected to replace it with a netcode-backed implementation.


🌐 Multiplayer — bring your netcode

RevFramework is deliberately netcode-agnostic.

You plug in your authority rule using your networking solution’s ownership model.

Example (Netcode for GameObjects)

public sealed class PickupAuthorityBinder_NGO : MonoBehaviour, IPickupAuthority
{
    public bool HasAuthority(GameObject actor)
    {
        var no = actor.GetComponent<NetworkObject>();
        return no != null && no.IsOwner;
    }
}

The same pattern applies to:

  • Mirror (hasAuthority)
  • Fusion (HasInputAuthority)
  • Photon (photonView.IsMine)
  • Dedicated server logic
  • Custom authority systems

A binder is simply your ownership rule, expressed through HasAuthority.


🔁 How Pickups Use Authority

World pickups (EffectPickupCore)

Execution flow:

  1. Resolve binder via PickupAuthority.Resolve(this)
  2. If no binder exists → allow consumption (single-player-friendly default)
  3. If a binder exists → call HasAuthority(actor)
  4. If false → local consumption is blocked
  5. If true → effect applies and pickup may despawn

RevFramework does not forward requests. Samples may demonstrate how to forward a “consume request” to a server.

Authority answers a single question:

“Is this actor allowed to consume this pickup locally?”

Replication, despawn sync, rollback, and reconciliation are handled by your netcode, not RevFramework.


Interactable pickups (PickupInteractableCoreBase)

PickupInteractableCoreBase does not enforce authority by default.

For multiplayer projects, enforce authority inside your DoPickup(actor) implementation:

var auth = PickupAuthority.Resolve(this);
if (auth != null && !auth.HasAuthority(actor))
    return false;

This keeps the base class flexible and avoids forcing a specific multiplayer model.


🚀 Quick Start

Single-player

  1. Add PickupAuthorityBinder
  2. Leave alwaysTrue = ON
  3. Done

Multiplayer (authoritative server / host)

  1. Add exactly one authority binder implementing your ownership rule
  2. Clients without authority are blocked locally
  3. (Optional) Client sends “request consume” to server
  4. Server applies effect + despawns pickup
  5. Netcode replicates the despawn

RevFramework provides the authority seam
you provide the network behaviour.


❓ FAQs

Where should the binder live?
Anywhere stable: - scene root - player root - server authority object

The resolver searches parents → scene roots → global.


Do I need to call Invalidate()?
Only if you add or remove binders at runtime.


Does this sync pickups automatically?
No. Authority only decides whether consumption is allowed. Replication is your responsibility.


What if I forget to add a binder in multiplayer?
Pickups will allow consumption by default. This is intentional for single-player, but multiplayer projects should always provide a binder.


Multiple binders in a scene?
The resolver picks the first usable one. Use one binder per scene to define policy.


🛠 Troubleshooting

  • Pickup won’t consume → authority returned false
  • Binder not detected → add a binder or call Invalidate()
  • Clients see effects but no despawn → netcode is not replicating pickup state

📘 See Also

  • Runtime/Systems/Pickups/Unity/EffectPickupCore.cs
  • Runtime/Systems/Pickups/Unity/PickupInteractableCoreBase.cs
  • Runtime/Systems/Pickups/Core/PickupEffectRunner.cs
  • Samples → Netcode (NGO / Mirror / Fusion)

🧱 Support Stance

This folder provides authority hooks only.

RevFramework does not include:

  • replication
  • prediction
  • rollback
  • reconciliation
  • server transforms
  • ownership systems

Single-player: use the default binder.
Multiplayer: supply your own authority rules.

Multiplayer networking is intentionally out of scope for RevFramework.