本文整理汇总了C++中FBPUniqueNetId类的典型用法代码示例。如果您正苦于以下问题:C++ FBPUniqueNetId类的具体用法?C++ FBPUniqueNetId怎么用?C++ FBPUniqueNetId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FBPUniqueNetId类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetStoredRecentPlayersList
void UAdvancedFriendsLibrary::GetStoredRecentPlayersList(FBPUniqueNetId UniqueNetId, TArray<FBPOnlineRecentPlayer> &PlayersList)
{
IOnlineFriendsPtr FriendsInterface = Online::GetFriendsInterface();
if (!FriendsInterface.IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("GetRecentPlayersList Failed to get friends interface!"));
return;
}
if (!UniqueNetId.IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("GetRecentPlayersList Failed was given an invalid UniqueNetId!"));
return;
}
TArray< TSharedRef<FOnlineRecentPlayer> > PlayerList;
// For now getting all namespaces
FriendsInterface->GetRecentPlayers(*(UniqueNetId.GetUniqueNetId()),"", PlayerList);
for (int32 i = 0; i < PlayerList.Num(); i++)
{
TSharedRef<FOnlineRecentPlayer> Player = PlayerList[i];
FBPOnlineRecentPlayer BPF;
BPF.DisplayName = Player->GetDisplayName();
BPF.RealName = Player->GetRealName();
BPF.UniqueNetId.SetUniqueNetId(Player->GetUserId());
PlayersList.Add(BPF);
}
}
示例2: IsAFriend
void UAdvancedFriendsLibrary::IsAFriend(APlayerController *PlayerController, const FBPUniqueNetId UniqueNetId, bool &IsFriend)
{
if (!PlayerController)
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("IsAFriend Had a bad Player Controller!"));
return;
}
if (!UniqueNetId.IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
return;
}
IOnlineFriendsPtr FriendsInterface = Online::GetFriendsInterface();
if (!FriendsInterface.IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("IsAFriend Failed to get friends interface!"));
return;
}
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerController->Player);
if (!Player)
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("IsAFriend Failed to get LocalPlayer!"));
return;
}
IsFriend = FriendsInterface->IsFriend(Player->GetControllerId(), *UniqueNetId.GetUniqueNetId(), EFriendsLists::ToString(EFriendsLists::Type::Default));
}
示例3: GetFriendSteamLevel
int32 UAdvancedFriendsLibrary::GetFriendSteamLevel(APlayerController *PlayerController, const FBPUniqueNetId UniqueNetId)
{
if (!PlayerController)
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("IsAFriend Had a bad Player Controller!"));
return 0;
}
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
return 0;
}
if (SteamAPI_Init())
{
uint64 id = *((uint64*)UniqueNetId.UniqueNetId->GetBytes());
return SteamFriends()->GetFriendSteamLevel(id);
}
return 0;
}
示例4: GetUniqueNetID
void UAdvancedSessionsLibrary::GetUniqueNetID(APlayerController *PlayerController, FBPUniqueNetId &UniqueNetId)
{
if (!PlayerController)
{
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromController received a bad PlayerController!"));
return;
}
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
{
UniqueNetId.SetUniqueNetId(PlayerState->UniqueId.GetUniqueNetId());
if (!UniqueNetId.IsValid())
{
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromController couldn't get the player uniquenetid!"));
}
return;
}
}
示例5: UnMuteRemoteTalker
bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
{
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
if (!VoiceInterface.IsValid())
{
UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unmute Remote Talker couldn't get the voice interface!"));
return false;
}
return VoiceInterface->UnmuteRemoteTalker(LocalUserNum, *UniqueNetId.GetUniqueNetId(), bIsSystemWide);
}
示例6: IsPlayerMuted
bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId)
{
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
if (!VoiceInterface.IsValid())
{
UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Player Muted couldn't get the voice interface!"));
return false;
}
return VoiceInterface->IsMuted(LocalUserNumChecking, *UniqueNetId.GetUniqueNetId());
}
示例7: IsRemotePlayerTalking
bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId)
{
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
if (!VoiceInterface.IsValid())
{
UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Remote Player Talking couldn't get the voice interface!"));
return false;
}
return VoiceInterface->IsRemotePlayerTalking(*UniqueNetId.GetUniqueNetId());
}
示例8: UnRegisterRemoteTalker
bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId)
{
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
if (!VoiceInterface.IsValid())
{
UE_LOG(AdvancedVoiceLog, Warning, TEXT("UnRegister Remote Talker couldn't get the voice interface!"));
return false;
}
return VoiceInterface->UnregisterRemoteTalker(*UniqueNetId.GetUniqueNetId());
}
示例9: UniqueNetIdToString
void UAdvancedSessionsLibrary::UniqueNetIdToString(const FBPUniqueNetId& UniqueNetId, FString &String)
{
const FUniqueNetId * ID = UniqueNetId.GetUniqueNetId();
if ( !ID )
{
UE_LOG(AdvancedSessionsLog, Warning, TEXT("UniqueNetIdToString received a bad UniqueNetId!"));
String = "ERROR, BAD UNIQUE NET ID";
}
String = ID->ToString();
}
示例10: IsPlayerInSession
void UAdvancedSessionsLibrary::IsPlayerInSession(const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
{
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
if (!SessionInterface.IsValid())
{
UE_LOG(AdvancedSessionsLog, Warning, TEXT("IsPlayerInSession couldn't get the session interface!"));
bIsInSession = false;
return;
}
bIsInSession = SessionInterface->IsPlayerInSession(GameSessionName, *PlayerToCheck.GetUniqueNetId());
}
示例11: SendSessionInviteToFriend
void UAdvancedFriendsLibrary::SendSessionInviteToFriend(APlayerController *PlayerController, const FBPUniqueNetId &FriendUniqueNetId, TEnumAsByte<EBlueprintResultSwitch::Type> &Result)
{
if (!PlayerController)
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("SendSessionInviteToFriend Had a bad Player Controller!"));
Result = EBlueprintResultSwitch::Type::OnFailure;
return;
}
if (!FriendUniqueNetId.IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("SendSessionInviteToFriend Had a bad UniqueNetId!"));
Result = EBlueprintResultSwitch::Type::OnFailure;
return;
}
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
if (!SessionInterface.IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("SendSessionInviteToFriend Failed to get session interface!"));
Result = EBlueprintResultSwitch::Type::OnFailure;
return;
}
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerController->Player);
if (!Player)
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("SendSessionInviteToFriend failed to get LocalPlayer!"));
Result = EBlueprintResultSwitch::Type::OnFailure;
return;
}
if (SessionInterface->SendSessionInviteToFriend(Player->GetControllerId(), GameSessionName, *FriendUniqueNetId.GetUniqueNetId()))
{
Result = EBlueprintResultSwitch::Type::OnSuccess;
return;
}
Result = EBlueprintResultSwitch::Type::OnFailure;
return;
}
示例12: GetFriend
void UAdvancedFriendsLibrary::GetFriend(APlayerController *PlayerController, const FBPUniqueNetId FriendUniqueNetId, FBPFriendInfo &Friend)
{
if (!PlayerController)
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("GetFriend Had a bad Player Controller!"));
return;
}
if (!FriendUniqueNetId.IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("GetFriend Had a bad UniqueNetId!"));
return;
}
IOnlineFriendsPtr FriendsInterface = Online::GetFriendsInterface();
if (!FriendsInterface.IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("GetFriend Failed to get friends interface!"));
return;
}
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerController->Player);
if (!Player)
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("GetFriend failed to get LocalPlayer!"));
return;
}
TSharedPtr<FOnlineFriend> fr = FriendsInterface->GetFriend(Player->GetControllerId(), *FriendUniqueNetId.GetUniqueNetId(), EFriendsLists::ToString(EFriendsLists::Type::Default));
if (fr.IsValid())
{
Friend.DisplayName = fr->GetDisplayName();
Friend.OnlineState = ((EBPOnlinePresenceState::Type)((int32)fr->GetPresence().Status.State));
Friend.RealName = fr->GetRealName();
Friend.UniqueNetId.SetUniqueNetId(fr->GetUserId());
Friend.bIsPlayingSameGame = fr->GetPresence().bIsPlayingThisGame;
}
}
示例13: RequestSteamFriendInfo
bool UAdvancedFriendsLibrary::RequestSteamFriendInfo(APlayerController *PlayerController, const FBPUniqueNetId UniqueNetId)
{
if (!PlayerController)
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("IsAFriend Had a bad Player Controller!"));
return false;
}
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
{
UE_LOG(AdvancedFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
return false;
}
if (SteamAPI_Init())
{
uint64 id = *((uint64*)UniqueNetId.UniqueNetId->GetBytes());
return !SteamFriends()->RequestUserInformation(id, false);
}
return false;
}