question

Juris Zebnickis avatar image
Juris Zebnickis asked

GetMatch fails on Multiplayer Server (Backfill Ticket)

Hi! I am trying to use GetMatch on a dedicated Unreal server in order to get the member and server details that I can pass to the Backfill Ticket Request.

The GetMatch fails even though I provide it the MatchId that according to the docs is supposed to be the same as the SessionId, that I acquire from GetServerDetails. (see screenshot)

I allocate the server by a RequestMultiplayerServer, create a backfill ticket so that players can join it after. This is supposed to work according to some other posts I found.

I also found posts about GetMatch errors being reported as a PlayFab bug, so it would be helpful if someone could clarify what could be the cause of the following order of calls not working on the server, as seen in the attached server log. Entity token is acquired successfully and the server has certificates attached for the Windows container. GetServerDetails --> GetMatch --> CreateBackFillTicketRequest.

https://prnt.sc/hhqCXG4iyPMw

Much thanks.

Edit: To clarify, the underlying question here is whether GetMatch relates to the 'Match' as in the spun up game session or the 'Match' as in a matchmaking ticket match. If it is the first, the above should work. If it's the latter, then the only use for it would be filling in a match that someone has left. Which makes sense I suppose, but a clarification would still be great.

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.

Xiao Zha avatar image
Xiao Zha answered

It's not that MatchId is the same as SessionId, but if you set the enable server allocation option in the matchmaking queue, the playfab matchmaking service will automatically set SessionId to MatchId. In this case, the MatchId is generated after the player successfully matches, and it can be returned by the Get Matchmaking Ticket API. And if you call RequestMultiplayerServer API to allocate server, the SessionID in Server detail is the SessionID you manually set in RequestMultiplayerServer API request body which may not be the MatchId.

In addition, if you want to use a backfill ticket, the correct process should be that the server creates a backfill ticket and sets the serverdetail parameter, and then the player creates a normal ticket to match with the backfill ticket. After the match is successful, you can use the Get Matchmaking Ticket API to get the MatchID and call GetMatch API to get server detail to allow players to connect to the Server.

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

Juris Zebnickis avatar image Juris Zebnickis commented ·

Thank you @Xiao Zha ! To clarify - do you mean that the server can start a backfill ticket without having any players connected to it?

And then the player can get onto it through matchmaking without doing any manual server requests?

Because the documentation states that the Create Server Backfill Ticket request needs a member list. Can this object be empty?

In case that the member list has to be filled with a player, do you have a suggestion of how to acquire that players' entity key id on the server?

0 Likes 0 ·
Juris Zebnickis avatar image Juris Zebnickis commented ·

I'm getting this error when I try to get server details on a server when it starts without any players. [2023.05.10-16.41.13:093][ 20]LogPlayFabGSDK: Error: Config value for key sessionCookie not found! [2023.05.10-16.41.13:094][ 20]LogTemp: Error: This field is required: GetMultiplayerServerDetailsRequest::SessionId, PlayFab calls may not work if it remains empty.

The request does not have SessionCookie as a field though, so what does it require to do before I can get server details?

0 Likes 0 ·
Juris Zebnickis avatar image Juris Zebnickis Juris Zebnickis commented ·

So, it seems that the full server config settings object is not exposed in the Unreal PlayfabSDK. I cannot find a way to access the SessionID directly on the server, even though I do give it one when allocating it by the RequestMultiplayerServer from a client. This kind of relates to the posts above, as I asked about whether the client has to do that at all. Seems like they have to, as otherwise the server just wont transition from Standby to Active.

0 Likes 0 ·
Xiao Zha avatar image
Xiao Zha answered

>> do you mean that the server can start a backfill ticket without having any players connected to it? Because the documentation states that the Create Server Backfill Ticket request needs a member list. Can this object be empty? In case that the member list has to be filled with a player, do you have a suggestion of how to acquire that players' entity key id on the server?

This backfill server tickets feature is designed to allow an ongoing game server to search for additional players when, for example, one or more players disconnect while the game is in progress. So, in order to have the server find the most suitable players, it must supply members information for the game it is currently hosting. If you want to get the connected players, you can get them in the connected player list which you should manually maintain when new players connected.

>> And then the player can get onto it through matchmaking without doing any manual server requests? This kind of relates to the posts above, as I asked about whether the client has to do that at all. Seems like they have to, as otherwise the server just wont transition from Standby to Active

There are two ways to make the server transition from StandBy to Active. One is that you set the enable server allocation option in the matchmaking queue, after players match successfully, a server instance with the SessionId( here is the MatchId) will be automatically allocated, so, they don’t need to request server manually. And the players can get ServerDetails in the GetMatch API result. Another is to not enable server allocation option but to let a player call the RequestMultiplayerServer API (with the custom SessionId) to get the server instance. In this case, the player which request the server can connect to the server first, then create backfill ticket to search for additional players.

>> The request does not have SessionCookie as a field though, so what does it require to do before I can get server details?

SessionCookie is not needed to get server details. The GetMultiplayerServerDetails API need a SessionId, which is the SessionId that passed into the sever when request a server instance(When you get server instance with RequestMultiplayerServer API, you need to specify the SessionId. When you get the server instance with matchmaking service, the sessionId is the matchId and will be automatically passed into server ). And you may refer to Integrating game servers with the PlayFab Game Server SDK (GSDK) - PlayFab | Microsoft Learn to know how to get configuration settings(such as SessionCookie or SessionId) in your server.

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

Juris Zebnickis avatar image Juris Zebnickis commented ·

Thank you, but my question was: >> Can a server start a backfill ticket without having any players connected to it?

Another more concrete thing I'm chasing down is this: >> If I do a Request Multiplayer Server, don't put any players on it and run the UGSDKUtils::GetMatchId() without any matchmaking happening, I should get the SessionID that I assigned to it on my Multiplayer Server Request, yes? Because currently it is giving me nothing on the server. Could this be a bug?

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha Juris Zebnickis commented ·

For the first question, the answer is no. And could you provide the version of Unreal Engine so that we can better test the second question.

0 Likes 0 ·
Juris Zebnickis avatar image Juris Zebnickis Xiao Zha commented ·

So, it turns out I was working with an out of date GSDK, but after the update my server is now failing to retrieve even its' entity token, which definitely worked before. https://prnt.sc/rCasXTvemUKC

this just gives me: OnGetEntityTokenFailure! Error: NotAuthenticated

I also found an old post saying that it could be an internal Playfab issue here, but it's quite out of date: https://community.playfab.com/questions/37781/getmatch-server-authentication-error.html

I am using UE 5.1.1-76776

Is my server supposed to just be able to get the entity token? Documentation says: This API requires no authentication headers (usually provides one to other calls).

0 Likes 0 ·
Show more comments

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.