Skip to main content

Unblock a Player

Last updated on

Use the following function to unblock a player

FString UserId = FString("SomeUserId");

FRegistry::Lobby.Connect();
FRegistry::Lobby.SetUnblockPlayerResponseDelegate(AccelByte::Api::Lobby::FUnblockPlayerResponse::CreateLambda([](const FAccelByteModelsUnblockPlayerResponse& Result)
{
if (Result.Code == "0")
{
// Do something if UnblockPlayerResponseDelegate has been successful
}
else
{
// Do something if UnblockPlayerResponseDelegate has an error
}
}));

FRegistry::Lobby.UnblockPlayer(UserId);

Listen to Player Unblocked Events

Just like the Player Blocked Event, this event will be raised on the unblock player's side and will pass data that contains both the unblocking player and unblocked player's User IDs.

FRegistry::Lobby.Connect();
FRegistry::Lobby.SetUnblockPlayerNotifDelegate(AccelByte::Api::Lobby::FUnblockPlayerNotif::CreateLambda([](const FAccelByteModelsUnblockPlayerNotif& Result)
{
// Do something if UnblockPlayerNotifDelegate has been successful
}));