How do I get a remote player's XUID/PSN Account ID/Steam ID?

I’m trying to figure out how I’d get the PUID/XUID equivalent for a player. I see that you have the FUniqueNetId, which seems to be an Epic account number, but then there’s a ‘typedef int32 FPlatformUserId’. But 32 bits isn’t enough to store the actual platform user id for many platforms, so that can’t be it either.

If we wanted to do per-platform system calls for a remote player, how would we do this? I really just want to know ‘what platform at they on’ and “what is their userId on that platform?”

Hi vtslothy,

You are indeed looking for the FUniqueNetId. The FUniqueNetId is an abstract interface for whatever ID the Online Subsystem you have loaded needs. On Steam, the actual type would be FUniqueNetIdSteam, which would hold an uint64 steam id. If you’re not seeing a value you expect on a FUniqueNetId, check that you’re using the correct Online Subsystem.

For portability, you call FUniqueNetId::ToString() and IOnlineIdentity::CreateUniquePlayerId(FString) to convert between types. It’s important that the string you are using be for the correct Online Subsystem, if you support cross-play. You can call FUniqueNetId::GetType() to determine what OSS an instance of a FUniqueNetId belongs to.