Skip to main content

Retrieve List of Blocking Players

Last updated on

Use the following function to retrieve a list of players that have blocked the current player. This method has a callback that returns an array of data that contains the blocking player's User ID.

FRegistry::Lobby.Connect();
FRegistry::Lobby.GetListOfBlockers(THandler<FAccelByteModelsListBlockerResponse>::CreateLambda([](const FAccelByteModelsListBlockerResponse& Result)
{
// Do something if GetListOfBlockers has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetListOfBlockers has an error
UE_LOG(LogTemp, Log, TEXT("Error GetListOfBlockers, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve List of Blocking Players by User ID

Use the following function to retrieve a list of players that have been blocked by a specific player, using that player's User ID.

FString UserId = FString("SomeUserId");

FRegistry::Lobby.Connect();
FRegistry::Lobby.GetListOfBlockers(UserId, THandler<FAccelByteModelsListBlockerResponse>::CreateLambda([](const FAccelByteModelsListBlockerResponse& Result)
{
// Do something if GetListOfBlockers has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetListOfBlockers has an error
UE_LOG(LogTemp, Log, TEXT("Error GetListOfBlockers, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));