question

amazdeh avatar image
amazdeh asked

PlayFabServerAPI.RedeemMatchMakerTicket returns game notfound

We have one unity server running to run our metagame logic and it can accept 1000 players so when we disconnect a player and rectry to matchMake , most of the times (almost always when testing) the same server is returned back and sometimes when we want to validate the MatchMaker ticket using the RedeemMatchMakerTicket API in the server we receive game not found. What are the reasons for this response? Is it possible that removal of the player from PlayFab wasn't successful at disconnect time from unity and that caused this ? Is there any correlation between them?

10 |1200

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

brendan avatar image
brendan answered

Reviewing the code, the only case in which a call to RedeemMatchmakerTicket would return the GameNotFound error would be if the ticket submitted to the call was for a game instance that's not running. Can you double-check that the ticket being passed to your server is always the one that was just received from the call to Matchmake on the client?

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

amazdeh avatar image amazdeh commented ·

As far as I checked We're using correct ticket and IP information , I will dig deeper however. From what I see it is impossible to send incorrect data.

0 Likes 0 ·
brendan avatar image brendan amazdeh commented ·

Since it occurs on a disconnect and re-enter via Matchmake, my suspicion is that the previous matchmaker ticket is still being used - could you check that?

0 Likes 0 ·
amazdeh avatar image
amazdeh answered

I stop the editor to disconnect and reconnect and as said even if not, I use functional style programming to eliminate the possibility of things like this happening and since sending the ticket happens after receiving MM result with the received ticket that can not be.

There is only one possibility. We do retries when removing or adding players to playfab 5 times using exponential back-off to guard against failures. I think something like this happens.


1- Player disconnects from our metagame server

2- In MetaGameServer we start the process of removing the player and it fails first-second time

3- Client connects again and match makes and sends the ticket for validation to MetaGameServer

4- Before the metagame server tries to validate the ticket or maybe after that the old RemovePlayer code succeeds in removing the player.


Classic race condition :) Two questions for you, If the player gets removed after a match make while it was added before for the same gameID/LobbyID on Playfab, what will happen? Does the ticket gets invalidated? I suppose yes but still game not found should not be returned right? Game not found should be for the case that a LobbyID is invalid, right?


I'll go and try to fix my race condition but it is good to know that if the ticket will invalidate in the case. that player is already added to a game, then disconnects and then match-makes to the same game and after receiving the ticket we remove the player.

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.

brendan avatar image brendan commented ·

Aha! Good catch - yes, when you call NotifyMatchmakerPlayerLeft, that removes the player from that specific server in the matchmaker's tracking data. So if a client is no longer connected to a server, then calls Matchmake and gets the same LobbyId back, and then after that the server calls NotifyMatchmakerPlayerLeft, the matchmaker ticket the client just received will be invalidated. So if your logic on the server for determining when the client is no longer connected differs from the way the client determines when it is no longer connected to the server, to the extent where the client could come to that conclusion and then make a Web API call before the server has decided the player has left, you could certainly have that issue.

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.