question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

How do you get a QueueName on a game server?

I'm currently trying to call GetMatch() on my game server, to get match information for the server.

GetMatch() requires passing in a QueueName.

How do I get this QueueName? I can't hardcode it because I want to support multiple queues (like most games).

Custom Game ServersMatchmaking
10 |1200

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

Dimitris Gkanatsios avatar image
Dimitris Gkanatsios answered

Hey there, can you try this preview feature and let us know if it works for you? https://github.com/PlayFab/MpsSamples/blob/main/MatchmakeSample/matchMakingAndMps.md

1 comment
10 |1200

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

dev-9-1 avatar image dev-9-1 commented ·

This worked for me in Unity (2021.3.19f) Big Thanks to Dimitris for providing this finally!

1 Like 1 ·
mattdavidson2017 avatar image
mattdavidson2017 answered

Hello Brent,

I ran into a similar issue with the development of my game and I determined that currently there is no way to get the QueueName on the server. However, since you need to upload a server build for each queue, hard coding it isn't the worst option. It's not ideal, but it works.

5 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.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

Thanks for the reply. That sucks to hear! Wouldn't that mean I have to make a separate build per queue, then? That seems annoying to maintain and easy to mess up. I have multiple queues that will use the same build.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Brent Batas (Lisk) commented ·

It doesn't mean you have to make a separate build per queue, you still can use one build for multiple queues. You just should record the Queue name manually. Or put them in your custom database.

0 Likes 0 ·
Brent Batas (Lisk) avatar image Brent Batas (Lisk) Sarah Zhang commented ·

How would a build know which Queue it is in, if they are both the same build?

0 Likes 0 ·
Show more comments
tobias-mueller avatar image tobias-mueller commented ·

I'm facing the exact same issue as you. We do have 2 queues, both using the same build. I need to know which queue my server is started from in order to call GetMatch on it.

I actually already tried to simply call GetMatch on both queues which resulted in my second call getting a "Request timeout or null response" response.

@Brent Batas (Lisk): Were you actually able to solve your problem in some way?

0 Likes 0 ·
Brent Batas (Lisk) avatar image
Brent Batas (Lisk) answered

Just to summarize Sarah's answer, the way to get a QueueName on a game server is to
1) get the BuildId from GameserverSDK config settings

2) lookup all matchmaking queues via ListMatchmakingQueues

3) compare each queue to see which one has a BuildId that matches the BuildId from step 1

4) check the queue name of that queue (it's included in the result)

Glad to know it's possible!

Edit: actually it's not possible, since this solution still depends on having a unique build per queue...

5 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.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

Note that ListMatchmakingQueues is a flagged API which means it isn't in the C# SDK, which means you have to POST request manually. Any chance we can get it added to the SDK? @Sarah Zhang

0 Likes 0 ·
Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

Actually upon further investigation, this solution doesn't work for us because it assumes a new Build (BuildId) for each queue, which will run into issues because it means we will have to have a lot of extraneous builds running at the same time which will incur way higher server costs as well as make our deploy process much more complex.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Brent Batas (Lisk) commented ·

Currently, hard code is a possible workaround. Even if you want to support multiple queues. For example, you can manually store multiple queue names in Title data, and use GetTitleData API when you need to get them.

0 Likes 0 ·
Brent Batas (Lisk) avatar image Brent Batas (Lisk) Sarah Zhang commented ·

Hi Sarah, can you describe how even with hardcoding, how would we support multiple queues with a single build?

0 Likes 0 ·
Show more comments
ashkan-saeedi-mazdeh avatar image
ashkan-saeedi-mazdeh answered

Actually there is a way to do this. either send the queue name as an object to the mm service as parameters or just put it in a object for the player which server can read. This can be done both securely and authoritatively and the server has access to the value. the only drawback is that the client has to do two operations for mm (request a server to set one of its objects or set its object itself) and then if successful put himself/herself on a queue for MM.

The players list is available t your server even before players connect through config.

10 |1200

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

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.