bool FOnlineVoiceSteam::UnmuteRemoteTalker(uint8 LocalUserNum, const FUniqueNetId& PlayerId, bool bIsSystemWide) { uint32 Return = E_FAIL; if (LocalUserNum >= 0 && LocalUserNum < MAX_LOCAL_PLAYERS) { if (bIsSystemWide) { // Remove them from the mute list SystemMuteList.RemoveSingleSwap((const FUniqueNetIdSteam&)PlayerId); ProcessMuteChangeNotification(); } else { // Skip this if the session isn't active if (SessionInt && SessionInt->GetNumSessions() > 0 && // Or if voice is disabled VoiceEngine.IsValid()) { // Find the specified talker FRemoteTalker* Talker = FindRemoteTalker(PlayerId); if (Talker != NULL) { // Make sure there isn't a system mute bool bIsMuted = IsMuted(LocalUserNum, PlayerId); if (!bIsMuted) { // Remove them from the mute list MuteList.RemoveSingleSwap((const FUniqueNetIdSteam&)PlayerId); UE_LOG(LogVoice, Log, TEXT("Unmuting remote talker (%s)"), *PlayerId.ToDebugString()); } } else { UE_LOG(LogVoice, Verbose, TEXT("Unknown remote talker (%s) specified to UnmuteRemoteTalker()"), *PlayerId.ToDebugString()); } } } } else { UE_LOG(LogVoice, Warning, TEXT("Invalid user specified in UnmuteRemoteTalker(%d)"), LocalUserNum); } return Return == S_OK; }
bool FOnlineVoiceSteam::RegisterRemoteTalker(const FUniqueNetId& UniqueId) { uint32 Return = E_FAIL; if (SteamSubsystem) { // Skip this if the session isn't active if (SessionInt && SessionInt->GetNumSessions() > 0 && // Or when voice is disabled VoiceEngine.IsValid()) { // See if this talker has already been registered or not FRemoteTalker* Talker = FindRemoteTalker(UniqueId); if (Talker == NULL) { // Add a new talker to our list int32 AddIndex = RemoteTalkers.AddZeroed(); Talker = &RemoteTalkers[AddIndex]; // Copy the UniqueId const FUniqueNetIdSteam& UniqueIdSteam = (const FUniqueNetIdSteam&)UniqueId; Talker->TalkerId = MakeShareable(new FUniqueNetIdSteam(UniqueIdSteam)); // Register the remote talker locally Return = VoiceEngine->RegisterRemoteTalker(UniqueId); UE_LOG(LogVoice, Log, TEXT("RegisterRemoteTalker(%s) returned 0x%08X"), *UniqueId.ToDebugString(), Return); } else { UE_LOG(LogVoice, Verbose, TEXT("Remote talker %s is being re-registered"), *UniqueId.ToDebugString()); Return = S_OK; } // Update muting all of the local talkers with this remote talker ProcessMuteChangeNotification(); // Now start processing the remote voices Return = VoiceEngine->StartRemoteVoiceProcessing(UniqueId); UE_LOG(LogVoice, Log, TEXT("StartRemoteVoiceProcessing(%s) returned 0x%08X"), *UniqueId.ToDebugString(), Return); } } return Return == S_OK; }
bool FOnlineVoiceImpl::MuteRemoteTalker(uint8 LocalUserNum, const FUniqueNetId& PlayerId, bool bIsSystemWide) { uint32 Return = E_FAIL; if (LocalUserNum >= 0 && LocalUserNum < MaxLocalTalkers ) { if (bIsSystemWide) { SystemMuteList.AddUnique((const FUniqueNetIdString&)PlayerId); ProcessMuteChangeNotification(); } else { // Skip this if the session isn't active if (SessionInt && SessionInt->GetNumSessions() > 0 && // Or if voice is disabled VoiceEngine.IsValid()) { // Find the specified talker FRemoteTalker* Talker = FindRemoteTalker(PlayerId); if (Talker != NULL) { MuteList.AddUnique((const FUniqueNetIdString&)PlayerId); Return = S_OK; UE_LOG(LogVoice, Log, TEXT("Muting remote talker (%s)"), *PlayerId.ToDebugString()); } else { UE_LOG(LogVoice, Warning, TEXT("Unknown remote talker (%s) specified to MuteRemoteTalker()"), *PlayerId.ToDebugString()); } } } } else { UE_LOG(LogVoice, Warning, TEXT("Invalid user specified in MuteRemoteTalker(%d)"), LocalUserNum); } return Return == S_OK; }