void FPlayerMuteList::ServerUnmutePlayer(APlayerController* OwningPC, const FUniqueNetIdRepl& UnmuteId) { UWorld* World = OwningPC->GetWorld(); const TSharedPtr<const FUniqueNetId>& PlayerIdToUnmute = UnmuteId.GetUniqueNetId(); // If the player was found, remove them from our explicit list RemoveIdFromMuteList(VoiceMuteList, PlayerIdToUnmute); // Find the muted player's player controller so it can be notified APlayerController* OtherPC = GetPlayerControllerFromNetId(World, *PlayerIdToUnmute); if (OtherPC != NULL) { FUniqueNetIdMatcher PlayerIdToUnmuteMatch(*PlayerIdToUnmute); FUniqueNetIdMatcher OwningPlayerIdMatch(*OwningPC->PlayerState->UniqueId); // Make sure this player isn't muted for gameplay reasons if (GameplayVoiceMuteList.IndexOfByPredicate(PlayerIdToUnmuteMatch) == INDEX_NONE && // And make sure they didn't mute us OtherPC->MuteList.VoiceMuteList.IndexOfByPredicate(OwningPlayerIdMatch) == INDEX_NONE) { OwningPC->ClientUnmutePlayer(UnmuteId); } // If the other player doesn't have this player muted if (OtherPC->MuteList.VoiceMuteList.IndexOfByPredicate(OwningPlayerIdMatch) == INDEX_NONE && OtherPC->MuteList.GameplayVoiceMuteList.IndexOfByPredicate(OwningPlayerIdMatch) == INDEX_NONE) { // Remove them from the packet filter list RemoveIdFromMuteList(VoicePacketFilter, PlayerIdToUnmute); // If found, remove so packets flow to that client too RemoveIdFromMuteList(OtherPC->MuteList.VoicePacketFilter, OwningPC->PlayerState->UniqueId.GetUniqueNetId()); // Tell the other PC to unmute this one OtherPC->ClientUnmutePlayer(OwningPC->PlayerState->UniqueId); } } }