๐ŸŽฏ Gorgeous Player Controller

Short Description

PlayerController subclass that stores per-player Object Variables and handles AutoReplication RPCs.

Long Description

AGorgeousPlayerController provides an AutoReplication mixin, a relay component for async RPC results, and a per-player AdditionalGorgeousData map. It also implements the player connection info interface for stable IDs and net metadata.

๐Ÿš€ Features

  • AutoReplication mixin with relay component integration.
  • Per-player Object Variable storage and default trunk.
  • Connection metadata via IGorgeousPlayerConnectionInfo_I.

๐Ÿ“š Usage Examples

AGorgeousPlayerController* PC = Cast<AGorgeousPlayerController>(GetController());
PC->RegisterAutoReplicationEntry(TEXT("Inventory"), UString_SOV::StaticClass(), true, false, {});

Use On AutoReplication RPC Received to process RPC payloads on the owning player.

RegisterAutoReplicationEntry

Registers or updates an AutoReplication entry at runtime for this player.

Parameter Name Type Description
Key FName Entry key used for lookup.
DefaultClass TSubclassOf<UGorgeousObjectVariable> Class for the default variable.
bReplicate bool Whether to replicate the entry.
bOverrideStreamConfig bool Whether to override stream config.
StreamConfigOverride FGorgeousAutoReplicationStreamConfig Optional stream config override.
PC->RegisterAutoReplicationEntry(TEXT("Inventory"), UString_SOV::StaticClass(), true, false, {});

Best Practices

  • Keep per-player entries small to reduce replication overhead.
  • Use the relay component for async RPCs that need aggregation.

Troubleshooting

  • If RPCs do not route, ensure the relay component is present and initialized.