We recently came across an issue where if both network replays and Voice chat are enabled whenever a client joins a server the server crashes. This is happening during a game, not when viewing a replay.
We found that the crash was happening when a player joined the server and it tries to (un)mute players for the system mute list. The issue is the DemoSpectator Controller has a Player State but not UniqueId (presumably because it’s not a real player).
Rough call stack:
FOnlineVoiceImpl::UpdateMuteListForLocalTalker (VoiceInterfaceImpl.cpp:546)
APlayerController::Server(Un)mutePlayer (PlayerController.cpp:3028)
FPlayerMuteList::Server(Un)MutePlayer (PlayerMuteList.cpp:27/54)
GetPlayerControllerFromNetId (GameSession.cpp:24)
APlayerController* GetPlayerControllerFromNetId(UWorld* World, const FUniqueNetId& PlayerNetId)
{
// Iterate through the controller list looking for the net id
for(FConstPlayerControllerIterator Iterator = World->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
APlayerController* PlayerController = *Iterator;
// Determine if this is a player with replication
if (PlayerController->PlayerState != NULL)
{
// If the ids match, then this is the right player.
if (*PlayerController->PlayerState->UniqueId == PlayerNetId) //Crash is here
{
return PlayerController;
}
}
}
return NULL;
}
Crash occurs when trying to dereference the UniqueId in the snippet above when the PlayerController is the Demo Spectator controller because it is NULL.