Skip to main content

Get Player Online Status

Get the online status of specific players.

Method Information

ItemContent
MethodAChatManager::GetInstance()->GetPlayersOnline(const TArray<FString>& UserIds)
CallbackOnPlayerOnline(const TArray<FChatPlayerInfo>& Players)

Parameters

ParameterTypeDescription
UserIdsTArray<FString>Array of player IDs to query

FChatPlayerInfo

FieldTypeDescription
userUniqueIdFStringUser unique ID
onlineFStringOnline status (Y/N)

Code Example

void UMyGame::CheckPlayerOnline(const TArray<FString>& FriendIds)
{
AChatManager::GetInstance()->GetPlayersOnline(FriendIds);
}

void UMyGame::OnPlayerOnline(const TArray<FChatPlayerInfo>& Players)
{
for (const auto& Player : Players)
{
UE_LOG(LogTemp, Log, TEXT("Player: %s, Online: %s"), *Player.userUniqueId, *Player.online);
}
}