Skip to main content

Ready Consent

Last updated on

After the matchmaking process is completed, every player in each party needs to confirm their readiness to start the game. To implement this feature, refer to the function below. You'll need a match Id to run the Ready Consent function. The match id will be received by the matchmaking notification after the start of matchmaking.

FString MatchId = FString("SomeMatchId");

FRegistry::Lobby.Connect();
FRegistry::Lobby.SetReadyConsentResponseDelegate(AccelByte::Api::Lobby::ReadyConsentResponse.CreateLambda([](const FAccelByteModelsReadyConsentRequest& Result)
{
if (Result.Code == "0")
{
// Do something if ReadyConsentResponseDelegate has been successful
}
else
{
// Do something if ReadyConsentResponseDelegate has an error
}
}));
FRegistry::Lobby.SendReadyConsentRequest(MatchId);