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.
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.
APIs for modifying the friends list only impact the cross-platform friends database and will not affect the local platform or Epic Games friends list. This includes actions such as sending and receiving invites, blocking and unblocking players and modifying recent players.
It is not possible to support modifying the local platform's friends list or Epic Games friends list programmatically, as the platform SDKs and EOS SDK do not expose this functionality.
Getting the blocked players list
- C++
- Blueprints
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.