Skip to main content

Sub-Game Modes

Last updated on

Matchmake into a Sub-Game Mode

You can use sub-game modes to allow players to choose from multiple game modes within your game. The following function is used to matchmake a player into a sub-game mode.

FRegistry::Lobby.SetStartMatchmakingResponseDelegate(Api::Lobby::FMatchmakingResponse::CreateLambda(
[](const FAccelByteModelsMatchmakingResponse& result )
{
if(result.Code == "0")
{
UE_LOG(LogTemp, Display, TEXT("Matchmaking started successfully"));
}
else
{
UE_LOG(LogTemp, Display, TEXT("Matchmaking start error with code %s"), *result.Code);
}
})
);

Api::FMatchmakingOptionalParams OptionalParams;
OptionalParams.SubGameModes = {"1v1", "ffa"};
FRegistry::Lobby.SendStartMatchmaking("deathmatch", OptionalParams);