mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-23 08:24:18 +00:00
Adding some missing safety checks to the voice library functions.
Former-commit-id: 8cd15bd34f83bd2827c6672a24b5203bd2c2557b
This commit is contained in:
@@ -57,7 +57,7 @@ void UAdvancedIdentityLibrary::GetPlayerNickname(const FBPUniqueNetId & UniqueNe
|
|||||||
|
|
||||||
void UAdvancedIdentityLibrary::GetLoginStatus(const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result)
|
void UAdvancedIdentityLibrary::GetLoginStatus(const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
if(!UniqueNetID.IsValid())
|
if (!UniqueNetID.IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedIdentityLog, Warning, TEXT("GetLoginStatus was passed a bad player uniquenetid!"));
|
UE_LOG(AdvancedIdentityLog, Warning, TEXT("GetLoginStatus was passed a bad player uniquenetid!"));
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
Result = EBlueprintResultSwitch::OnFailure;
|
||||||
@@ -103,6 +103,13 @@ void UAdvancedIdentityLibrary::GetUserAccount(const FBPUniqueNetId & UniqueNetId
|
|||||||
{
|
{
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||||
|
|
||||||
|
if(!UniqueNetId.IsValid())
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedIdentityLog, Warning, TEXT("GetUserAccount was passed a bad unique net id!"));
|
||||||
|
Result = EBlueprintResultSwitch::OnFailure;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!IdentityInterface.IsValid())
|
if (!IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedIdentityLog, Warning, TEXT("GetUserAccount Failed to get identity interface!"));
|
UE_LOG(AdvancedIdentityLog, Warning, TEXT("GetUserAccount Failed to get identity interface!"));
|
||||||
|
@@ -100,6 +100,12 @@ void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers()
|
|||||||
|
|
||||||
bool UAdvancedVoiceLibrary::RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId)
|
bool UAdvancedVoiceLibrary::RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId)
|
||||||
{
|
{
|
||||||
|
if (!UniqueNetId.IsValid())
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Remote Talker was passed an invalid unique net id!"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
@@ -113,6 +119,12 @@ bool UAdvancedVoiceLibrary::RegisterRemoteTalker(const FBPUniqueNetId& UniqueNet
|
|||||||
|
|
||||||
bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId)
|
bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId)
|
||||||
{
|
{
|
||||||
|
if (!UniqueNetId.IsValid())
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedVoiceLog, Warning, TEXT("UnRegister Remote Talker was passed an invalid unique net id!"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
@@ -152,6 +164,12 @@ bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(uint8 LocalPlayerNum)
|
|||||||
|
|
||||||
bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId)
|
bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId)
|
||||||
{
|
{
|
||||||
|
if (!UniqueNetId.IsValid())
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Remote Player Talking was passed an invalid unique net id!"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
@@ -165,6 +183,12 @@ bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNe
|
|||||||
|
|
||||||
bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId)
|
bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId)
|
||||||
{
|
{
|
||||||
|
if (!UniqueNetId.IsValid())
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Player Muted was passed an invalid unique net id!"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
@@ -178,6 +202,12 @@ bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPU
|
|||||||
|
|
||||||
bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
|
bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
|
||||||
{
|
{
|
||||||
|
if (!UniqueNetId.IsValid())
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedVoiceLog, Warning, TEXT("Mute Remote Talker was passed an invalid unique net id!"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
@@ -191,6 +221,12 @@ bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUnique
|
|||||||
|
|
||||||
bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
|
bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
|
||||||
{
|
{
|
||||||
|
if (!UniqueNetId.IsValid())
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unmute Remote Talker was passed an invalid unique net id!"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
|
Reference in New Issue
Block a user