파티 매치메이킹
Matchmaker는 여러 플레이어로 구성된 그룹이 함께 게임에 매칭되도록 요청할 수 있는 파티 매치메이킹을 지원합니다.
매치메이킹 티켓에는 여러 플레이어가 포함될 수 있습니다. 게임 개발자는 매치메이킹 설정에서 한 티켓에 지원하는 수만큼 플레이어를 추가할 수 있습니다.
다음 코드 샘플은 파티 매치메이킹을 생성하는 방법을 보여 줍니다.
{
"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
var 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 matchmaking
var options = new CreateTicketOptions(
"Default" // The name of the queue defined in the previous step,
new Dictionary<string, object>());
// Create ticket
var ticketResponse = await MatchmakerService.Instance.CreateTicketAsync(players, options);
// Print the created ticket id
Debug.Log(ticketResponse.Id);
Unity SDK를 사용한 파티 티켓 생성
매치메이킹 구성에 두 개 이상의 팀이 정의되어 있는 경우, 동일한 티켓에 속한 플레이어들은 다른 팀으로 나뉘지 않습니다.
Unity Lobby 사용
QoS 결과 같은 플레이어 데이터를 파티 리더와 공유하기 어려울 수 있습니다. Unity Lobby 서비스를 사용하면 간단하게 데이터를 공유할 수 있습니다.
플레이어가 데이터를 저장하면 파티 리더가 티켓에 데이터를 추가합니다. 파티 리더는 전체 파티의 매치메이킹 티켓을 생성합니다.
티켓이 매칭되면 파티 리더가 서버 할당에 대한 정보를 Lobby 데이터에 저장하며 플레이어들은 이 정보를 사용하여 매치를 연결할 수 있습니다.