Networked Event Component
The plNetworkedEventComponent is a lightweight component for broadcasting named events to all clients via reliable RPCs. It is useful for game events that need to reach all machines -- kill feeds, objective updates, sound triggers, or any fire-and-forget notification.
Overview
Rather than writing custom RPC functions for every game event, you can use this component as a generic event bus:
On the authoritative machine (typically the server), call
FireEvent()with an event name and up to two parameters.The event is broadcast to all clients and the server via a reliable ordered RPC.
On each machine, the registered callback is invoked with the event name and parameters.
Usage
Firing Events (Server Side)
Receiving Events (All Machines)
Supported Parameter Types
The following plVariant types can be used as event parameters:
BoolInt32UInt32FloatDoubleStringVec3
Parameters are encoded as type tag + string representation for transport, then decoded on the receiving end.
Properties
This component has no replicated properties. It uses RPCs exclusively for event delivery. The NetworkSerialize() and NetworkDeserialize() methods are no-ops.
Implementation Details
Internally, the component uses a reflected function AllClients_OnEvent registered as an RPC with target AllClientsAndServer and ReliableOrdered reliability. The RPC is registered manually in OnSimulationStarted() rather than via reflection attributes to avoid issues with the editor's phantom type system.