Can't set player name in InitNewPlayer

So I’m trying to make it so that the client will pass a parameter when joining the server containing their display name. I’ve tried for 3 hours found nothing. Google was useless.
Also I would like to know if there is a unique ID so that I could initialize some stuff on InitNewPlayer and than continue it in PostLogin.
heres my code:
FString ATestFPSGameMode::InitNewPlayer(APlayerController * NewPlayerController, const FUniqueNetIdRepl & UniqueId, const FString & Options, const FString & Portal)
{
FString PlayerName = UGameplayStatics::ParseOption(Options, L"DisplayName");
if (!PlayerName.IsEmpty()) {
UE_LOG(LogTemp, Log, L"Login - Changing name to %s", *PlayerName);
ChangeName(NewPlayerController, “Test”,false);
}
return Super::InitNewPlayer(NewPlayerController, UniqueId, Options, Portal);
}

The problem is that the player name is not changed. Any way around this? My idea in the long run is that the player would specify a session ID but I don’t know how to get a unique ID from InitNewPlayer that I can also use in PostLogin.

Sadly there are no other replies.

It seems that InitNewPlayer happens earlier than expected, so trying to call SetPlayerName or ChangeName will cause it to be overridden.

You’d want to update the server once the controller has been replicated to the connecting client. When the controller is initialized you can get save game and pass the name back to the server (controller to controller). On the server, have it update the player state with a replicated PlayerName var. This will then be available to all players via GameState → PlayerArray.