Canceling Matchmaking
You can cancel matchmaking at any time by using the CancelKronosMatchmaking node. All cleanup processes are handled automatically, such as canceling pending reservations and destroying pending sessions.
There is no hard requirement on where you need to call this from. Most games will probably have this hooked to the OnClicked event of a widget button.

#include "KronosMatchmakingManager.h"
#include "KronosMatchmakingPolicy.h"// Get the matchmaking manager.
UKronosMatchmakingManager* MatchmakingManager = UKronosMatchmakingManager::Get(this);
// Check if we are matchmaking.
if (MatchmakingManager->IsMatchmaking())
{
// Get the current matchmaking policy.
// This is accessible even after matchmaking is canceled.
UKronosMatchmakingPolicy* MatchmakingPolicy = MatchmakingManager->GetMatchmakingPolicy();
// Begin canceling matchmaking.
MatchmakingPolicy->CancelMatchmaking();
}Last updated