๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Local Player Registry

Short Description

Game Instance subsystem that maps stable string IDs to PlayerControllers.

Long Description

The local player registry assigns stable IDs such as LocalPlayer_0 to controllers and keeps the mapping updated across logins and logouts. It powers the QoL stable ID helpers and player connection queries.

๐Ÿš€ Features

  • Stable ID registration and lookup.
  • Auto-assigns default IDs on login.
  • Handles logout cleanup automatically.

๐Ÿ“š Usage Examples

UGorgeousLocalPlayerRegistry_GIS* Registry = UGorgeousLocalPlayerRegistry_GIS::Get(WorldContextObject);
FString StableId = Registry->GetStableId(PlayerController);

Stable IDs are used via the QoL statics or connection info interface.

RegisterPC

Registers a PlayerController under a stable string ID.

Parameter Name Type Description
PC APlayerController* Controller to register.
StableId FString Stable ID to assign.
Registry->RegisterPC(PC, TEXT("LocalPlayer_0"));

Best Practices

  • Use stable IDs for saves or analytics rather than PlayerController pointers.

Troubleshooting

  • If stable IDs are empty, confirm the registry subsystem is initialized.