3 Commits

Author SHA1 Message Date
Joshua (MordenTral) Statzer
8315e35a8f Adding function to get the net id of a session owner 2025-09-26 08:36:19 -04:00
Joshua (MordenTral) Statzer
6462cd4c6f added note, trying to get epic to fix 2025-09-24 14:23:51 -04:00
Joshua (MordenTral) Statzer
e576724b63 include is gone 2025-09-23 13:52:32 -04:00
4 changed files with 19 additions and 1 deletions

View File

@@ -160,6 +160,10 @@ public:
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
static void GetUniqueNetID(APlayerController *PlayerController, FBPUniqueNetId &UniqueNetId);
// Get the unique net id of a network player attached to the given controller
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
static void GetUniqueNetIdOfSessionOwner(FBlueprintSessionResult SessionResult, FBPUniqueNetId& UniqueNetId);
// Get the unique net id of a network player who is assigned the the given player state
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
static void GetUniqueNetIDFromPlayerState(APlayerState *PlayerState, FBPUniqueNetId &UniqueNetId);

View File

@@ -151,7 +151,9 @@ void UAdvancedFriendsLibrary::GetFriend(APlayerController *PlayerController, con
Friend.PresenceInfo.bIsPlaying = pres.bIsPlaying;
Friend.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;
Friend.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
// #TODO: Check back in on this in shipping, epic is missing the UTF8_TO_TCHAR call on converting this and its making an invalid string
// OnlineFriendPresenceInterfaceSteam has the issue
//Friend.PresenceInfo.StatusString = pres.Status.StatusStr;
}
}
@@ -266,6 +268,7 @@ void UAdvancedFriendsLibrary::GetStoredFriendsList(APlayerController *PlayerCont
BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying;
BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
// #TODO: Check back in on this in shipping, epic is missing the UTF8_TO_TCHAR call on converting this and its making an invalid string
// OnlineFriendPresenceInterfaceSteam has the issue
//BPF.PresenceInfo.StatusString = pres.Status.StatusStr;
BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable;
BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;

View File

@@ -451,6 +451,17 @@ void UAdvancedSessionsLibrary::GetUniqueNetID(APlayerController *PlayerControlle
}
}
void UAdvancedSessionsLibrary::GetUniqueNetIdOfSessionOwner(FBlueprintSessionResult SessionResult, FBPUniqueNetId& UniqueNetId)
{
FBPUniqueNetId ReturnID;
if (SessionResult.OnlineResult.IsValid())
{
ReturnID.SetUniqueNetId(SessionResult.OnlineResult.Session.OwningUserId);
}
UniqueNetId = ReturnID;
}
void UAdvancedSessionsLibrary::GetUniqueNetIDFromPlayerState(APlayerState *PlayerState, FBPUniqueNetId &UniqueNetId)
{
if (!PlayerState)

View File

@@ -42,7 +42,7 @@ MSVC_PRAGMA(warning(pop))
#endif // USING_CODE_ANALYSIS
#include <steam/isteamapps.h>
#include <steam/isteamapplist.h>
//#include <steam/isteamapplist.h>
//#include <OnlineSubsystemSteamTypes.h>
#pragma pop_macro("ARRAY_COUNT")