Client presentation is intentionally downstream of authoritative state. UI sends requests through sanctioned owner seams and refreshes from events/replication; it should not directly edit network variables or server-owned models.
Local player binding
LocalPlayerPresentationBinder waits for the NGO-owned local player, wires camera and UI systems to its runtime components, then publishes LocalPlayerContext. This prevents scene UI from accidentally binding to a remote player or using global searches.
LocalPlayerContext
Use LocalPlayerContext.Current when a client-side input source needs the locally owned player. Minimap click-to-move uses this path and calls SubmitMoveToWorldPosition; the request still goes through server movement authority.
using GreenCloakGames.TileTickRPGCore.Multiplayer.NGO;
using UnityEngine;
public void RequestMove(Vector3 worldPosition)
{
LocalPlayerContext.Current?.SubmitMoveToWorldPosition(worldPosition);
}
Prefer events over polling
| System | Useful events |
|---|---|
SimpleInventory | OnItemAdded, OnItemRemoved, OnInventoryChanged |
UnitEquipment | OnItemEquipped, OnItemUnequipped, OnEquipmentChanged, quantity/requirement events |
UnitSkills | XP, level and generic skill-change events |
UnitCombat | Attack launched/resolved/blocked, status and projectile events |
PrayerController | Prayer activation/deactivation, overhead change, points depleted |
RunEnergyController | Energy/max/run-enabled/depletion/regeneration events |
BankService | Session open/close, bank changed/restored, message events |
Audio
AudioManager is the central presentation audio service. Request audio through IDs/database entries instead of hardcoding clips in gameplay systems. It exposes global volume/music change events for settings/UI synchronization.
Dedicated server rule
Camera, EventSystem, HUD, minimap, connect UI, chat/context menus, presentation overlays, audio and client input belong in the client-only composition. Do not place authoritative services such as tick/grid/path/network/spawn under DedicatedServerSceneComposition.