๐ก RPC Relay Component
Short Description
PlayerController component that relays AutoReplication RPC results and property payloads between client and server.
Long Description
The relay component forwards RPC results back to the authority, routes property payloads to the correct side, and optionally relays responder ready-state updates for debugging. It is the bridge that keeps async RPC aggregation working across clients.
๐ Features
- Server relay for client RPC results and ready-state updates.
- Client relay for server-originated property payloads.
- Origin tracking for client-initiated RPCs.
๐ Usage Examples
AutoReplicationRPCRelay->SetTargetMixin(&AutoReplicationMixin);
AutoReplicationMixin.SetRPCRelayComponent(AutoReplicationRPCRelay);
Add the component to your PlayerController class to enable automatic relay behavior.
RelayResultToServer
Sends a responder result back to the server so it can be aggregated and returned to the initiator.
| Parameter Name | Type | Description |
|---|---|---|
Result |
FGorgeousAutoReplicationRPCResult |
RPC result payload to relay. |
ReadyState |
EGorgeousRPCReadyState |
Responder readiness state. |
RelayComponent->RelayResultToServer(Result, EGorgeousRPCReadyState::Ready);
Best Practices
- Always pair the relay with the AutoReplication mixin on the owning class.
- Use responder ready-state updates when handlers run asynchronously.
Troubleshooting
- If client results never reach the server, ensure the component is replicated and owned.
- If property payload relays fail, verify the mixin is set via
SetTargetMixin.