Are all Player Controllers on the server supposed to be owned by the server? I was under the impression from what I read that Player Controllers are owned by the connecting client.
I’m seeing them all all owned by the server on the server.
I cycle through the Player Controllers on the server and get debug logs by
if (realObjectToSync->GetWorld()->IsServer())
{
if (UGameplayStatics::GetPlayerController(GetWorld(), i)->Role == ROLE_Authority)
{
UE_LOG(LogTemp, Warning, TEXT("SERVER: Role authority"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("SERVER: Role not authority"));
}
if (UGameplayStatics::GetPlayerController(GetWorld(), i)->HasAuthority())
{
UE_LOG(LogTemp, Warning, TEXT("SERVER: Has authority"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("SERVER: Not has authority"));
}
}
And with two total connected players(one listen-server, one client) all Player Controllers are HasAuthority() and ROLE_Authority on the server.