Party matchmaking
Enable multiple players to request matching together as a group.
Read time 1 minuteLast updated 2 days ago
Matchmaker supports party matchmaking where a group of players can request to be matched together in a game.
A matchmaking ticket can contain multiple players. The Matchmaker places all players from one ticket onto the same team. The maximum party size is 20 players per ticket.
The following code sample shows how to create party matchmaking:
Ticket containing two players with each their custom data{ "queueName": "4vs4", "attributes": {}, "players": [ { "id": "6cc5ac8d-dfab-4b50-9ede-c1d026d8dc81", "customData": { "Hero": "tank" }, "qosResults": [ { "regionId": "75721794-e9fd-4d8a-9879-aa853ed18885", "packetLoss": 0.8, "latency": 50 }, { "regionId": "1e29bd54-8acc-433a-ae7d-28ae5fc192a1", "packetLoss": 0.5, "latency": 20 } ] }, { "id": "ac35c771-291c-4e7e-9a0e-6351faf261c6", "customData": { "Hero": "support" }, "qosResults": [ { "regionId": "75721794-e9fd-4d8a-9879-aa853ed18885", "packetLoss": 0.2 "latency": 75 }, { "regionId": "1e29bd54-8acc-433a-ae7d-28ae5fc192a1", "packetLoss": 0.5, "latency": 10 } ] }, ]}
Unity SDK
Party ticket creation with Unity SDKvar player1 = new Player( "6cc5ac8d-dfab-4b50-9ede-c1d026d8dc81", new Dictionary<string, object> { {"hero", "tank"} }, new List<QoSResult> { new QoSResult("75721794-e9fd-4d8a-9879-aa853ed18885",0.8, 50), new QoSResult("1e29bd54-8acc-433a-ae7d-28ae5fc192a1",0.5, 20) });var player2 = new Player( "ac35c771-291c-4e7e-9a0e-6351faf261c6", new Dictionary<string, object> { {"hero", "support"} }, new List<QoSResult> { new QoSResult("75721794-e9fd-4d8a-9879-aa853ed18885",0.2, 75), new QoSResult("1e29bd54-8acc-433a-ae7d-28ae5fc192a1",0.5, 10) });var players = new List<Player>{ player1, player2};// Set options for matchmakingvar options = new CreateTicketOptions( "Default" // The name of the queue defined in the previous step, new Dictionary<string, object>());// Create ticketvar ticketResponse = await MatchmakerService.Instance.CreateTicketAsync(players, options);// Print the created ticket idDebug.Log(ticketResponse.Id);