Skip to main content

Read the blocked players list

EOS Online Framework provides the "blocked players" functionality of the friends interface. It does this by storing the blocked players in Player Data Storage.

Blocking a player currently has no effect at the plugin level; if you want to prevent a blocked player from interacting with a local user, you'll need to enforce this in your game code.

You no longer need to call QueryBlockedPlayers - the plugin automatically caches the blocked players during login and keeps the list of blocked players up-to-date.

info

In future, we intend to automatically handle the following scenarios for you:

  • Preventing a game client from seeing session results where a blocked player is the host of the listen server.
  • Preventing a game client from connecting to P2P addresses where the address is that of a blocked player.
  • Preventing a game client from seeing parties or lobbies where a blocked player is the leader or member of the lobby or party.
  • Automatically rejecting friend invitations from blocked players.

Getting the blocked players list

To get a list of blocked players, call GetBlockedPlayers:

TArray<TSharedRef<FOnlineBlockedPlayer>> BlockedPlayers;
if (!Friends->GetBlockedPlayers(*Identity->GetUniquePlayerId(0), BlockedPlayers))
{
return Results;
}
for (const auto &BlockedPlayer : BlockedPlayers)
{
// Access the blocked player in BlockedPlayer.
}

Modifying the blocked players list

Refer to Block and unblock other players on how to modify the blocked players list.