question

Andy Metcalfe avatar image
Andy Metcalfe asked

Get region from matchmaking_match_found event

Hi,

We are using the Matchmaking preview.

We have a rule which triggers on matchmaking_match_found, and fires an Azure cloud function. This cloud function starts up an external server and everything works fine. Currently when we create a matchmaking ticket we have a hard coded latency for a single region just to get it working.

I am now adding in QoS to the matchmaking process, and our tickets are now submitted with valid latencies to a bunch of different regions.

My question is: when the matchmaking_match_found event is fired, how do I get the region from the match? I assume if I was using Playfab Servers then the server would get started in the correct region, but that information doesn't appear to be available to me via the event.

Or, do I misunderstand how it all works?

Cheers,

Andy

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Rick Chen avatar image
Rick Chen answered

The matchmaking_match_found event doesn’t provide the server detail. If you were using PlayFab servers and enabling server allocation in your matchmaking queue, when a match is found, it will allocate a server in a region, you could then use the GetMatch API to get the server detail, which includes the server region.

7 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy Metcalfe avatar image Andy Metcalfe commented ·

@Rick Chen Thanks for your reply. I understand that if we were using PlayFab servers then we would get this. However, using external servers like we are, is there a way to do this? Playfab's matchmaking system is still matching people based on region is it not, so this information needs to be exposed so we know the region that you have matched players in.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Andy Metcalfe commented ·

Sorry for the late reply. If you have added the region selection rule, once the match is formed, you could use the Get Match API to get the match detail. You could use the RegionPreferences in the result to determine which region is better. The RegionPreferences is a list of regions that the match could be played in sorted by preference from the most preferred to the least preferred. This value is only set if the queue has a region selection rule.

0 Likes 0 ·
Andy Metcalfe avatar image Andy Metcalfe Rick Chen ♦ commented ·

@Rick Chen Perfect, thanks, that is exactly what I'm looking for! Cheers!

0 Likes 0 ·
Show more comments
Rick Chen avatar image Rick Chen ♦ Andy Metcalfe commented ·

Sorry for the late reply. According to my test, the following config works:

  • The Attribute path in the region selection rule could be set to $.playerRegion

{
                    
"Creator": {
"Attributes": {
"DataObject":
{
"playerRegion": [
{
"region": "EastUs",
"latency": 150
}
,
{
"region": "WestUs",
"latency": 90
}
]
}
},
"Entity": {
"Id": "{ {EntityId}}",
"Type": "title_player_account"
}
},
"GiveUpAfterSeconds": 300,
"QueueName": "rickTestMatchmaking"
}
0 Likes 0 ·
rules.png (22.6 KiB)
Andy Metcalfe avatar image Andy Metcalfe Rick Chen ♦ commented ·

Thanks for the reply. I had my path set to "Latencies" instead of "$.Latencies". However changing this did not fix my problem. After some more investigation, I discovered that one ticket was submitting a region of EastUs and the other ticket was submitting EastUS. I'm guessing that this mismatch of region was causing it to be empty. Sorry about that but thanks for your help!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.