Epic is improperly forming the status string and its causing memory access issues.

This commit is contained in:
Joshua
2024-04-25 15:49:34 -04:00
parent e982007518
commit f7701e76cf
2 changed files with 10 additions and 6 deletions

View File

@@ -138,7 +138,7 @@ void UAdvancedFriendsLibrary::GetFriend(APlayerController *PlayerController, con
TSharedPtr<FOnlineFriend> fr = FriendsInterface->GetFriend(Player->GetControllerId(), *FriendUniqueNetId.GetUniqueNetId(), EFriendsLists::ToString(EFriendsLists::Default));
if (fr.IsValid())
{
FOnlineUserPresence pres = fr->GetPresence();
const FOnlineUserPresence& pres = fr->GetPresence();
Friend.DisplayName = fr->GetDisplayName();
Friend.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
Friend.RealName = fr->GetRealName();
@@ -151,7 +151,8 @@ void UAdvancedFriendsLibrary::GetFriend(APlayerController *PlayerController, con
Friend.PresenceInfo.bIsPlaying = pres.bIsPlaying;
Friend.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;
Friend.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
Friend.PresenceInfo.StatusString = pres.Status.StatusStr;
// #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
//Friend.PresenceInfo.StatusString = pres.Status.StatusStr;
}
}
@@ -252,7 +253,7 @@ void UAdvancedFriendsLibrary::GetStoredFriendsList(APlayerController *PlayerCont
for (int32 i = 0; i < FriendList.Num(); i++)
{
FBPFriendInfo BPF;
FOnlineUserPresence pres = FriendList[i]->GetPresence();
const FOnlineUserPresence& pres = FriendList[i]->GetPresence();
BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
BPF.DisplayName = FriendList[i]->GetDisplayName();
@@ -264,7 +265,8 @@ void UAdvancedFriendsLibrary::GetStoredFriendsList(APlayerController *PlayerCont
BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport;
BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying;
BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
BPF.PresenceInfo.StatusString = pres.Status.StatusStr;
// #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
//BPF.PresenceInfo.StatusString = pres.Status.StatusStr;
BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable;
BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;

View File

@@ -81,7 +81,7 @@ void UGetFriendsCallbackProxy::OnReadFriendsListCompleted(int32 LocalUserNum, bo
for (int32 i = 0; i < FriendList.Num(); i++)
{
FBPFriendInfo BPF;
FOnlineUserPresence pres = FriendList[i]->GetPresence();
const FOnlineUserPresence& pres = FriendList[i]->GetPresence();
BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
BPF.DisplayName = FriendList[i]->GetDisplayName();
BPF.RealName = FriendList[i]->GetRealName();
@@ -92,7 +92,9 @@ void UGetFriendsCallbackProxy::OnReadFriendsListCompleted(int32 LocalUserNum, bo
BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport;
BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying;
BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
BPF.PresenceInfo.StatusString = pres.Status.StatusStr;
// #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
//BPF.PresenceInfo.StatusString = pres.Status.StatusStr;
BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable;
BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;