Skip to main content

Retrieve List of Blocked Players

Last updated on

Use the following function to retrieve a list of currently blocked players. This method has a callback that returns an array of data containing the blocked players' User IDs.

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

Retrieve List of Blocked Players by User ID

Use the following function to retrieve a list of blocked players specific to a certain user, based on their User ID.

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