๐ก๏ธ Gorgeous Game Mode
Short Description
GameMode subclass that exposes AutoReplication entries and QoL player lifecycle hooks.
Long Description
AGorgeousGameMode manages server-side AutoReplication data and exposes Blueprint events for player login/logout. It provides helpers to register AutoReplication entries dynamically during runtime.
๐ Features
- AutoReplication mixin with runtime entry registration.
- Blueprint events for player login/logout.
- Default Object Variable trunk for authored data.
๐ Usage Examples
AGorgeousGameMode* GM = GetWorld()->GetAuthGameMode<AGorgeousGameMode>();
GM->RegisterAutoReplicationEntry(TEXT("MatchConfig"), UString_SOV::StaticClass(), true, false, {});
Override On Player Logged In to run server-side setup logic after a controller connects.
RegisterAutoReplicationEntry
Registers or updates an AutoReplication entry at runtime.
| 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. |
GM->RegisterAutoReplicationEntry(TEXT("MatchConfig"), UString_SOV::StaticClass(), true, false, {});
Best Practices
- Keep entry keys stable so clients can resolve RPC targets.
- Use
OnAutoReplicationRPCReceivedfor server-side routing logic.
Troubleshooting
- If entries do not replicate, ensure
bActivateNetworkingCapabilitiesis true.