Matchmaking Notifications
Last updated on
Once the matchmaking is finished, the matchmaking service will send a notification to the players to inform them that they've been matched. To implement this feature, use the function below.
- Unreal Engine
- Unity
FRegistry::Lobby.Connect();
FRegistry::Lobby.SetMatchmakingNotifDelegate(AccelByte::Api::Lobby::MatchmakingNotif.CreateLambda([](const FAccelByteModelsMatchmakingNotice& Result)
{
// Result.Status can be Unknown, Start, Timeout, Cancel, Done, Unavailable
if (Result.Status == EAccelByteMatchmakingStatus::Unavailable)
{
// The Matchmaking is Unavailable
}
}));
AccelBytePlugin.GetLobby().Connect();
AccelBytePlugin.GetLobby().MatchmakingCompleted += result =>
{
if (result.IsError)
{
// Do something if MatchmakingCompleted has an error
Debug.Log($"Error MatchmakingCompleted, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if MatchmakingCompleted has been successful
}
};