Hello,
we are trying to handle when a user closes the game in the middle of a match in Unity, and we were wondering what’s the best way to operate when getting the error 520300 unable to create match ticket: a matching resource already exist.
The thing is that if a user quits a match and tries to search for a new match right away they will get the stated error. My guess is that we should call DeleteMatchmakingTicket whenever we detect that the user has a ticket going on, but… are there any downsides to doing that?
Should we check something first?
Users can only have one active match ticket at a time. Once a user finds a match, the ticket should be marked as found, allowing you to create a new match ticket. If the user intends to cancel the matchmaking process, you need to call DeleteMatchmakingTicket.
If I understand correctly, the user already found a match, played a bit, quit the match, then started matchmaking again but failed. I recommend using tools like Fiddler to troubleshoot and track the matchmaking state more effectively. It can help you monitor and analyze your API calls to ensure that the matchmaking flow is correct.
@Damar just to clarify, the question is what do we do when we receive the 520300 error code when creating a matchmaking ticket? For example the client crashes after creating the matchmaking ticket, then after restarting the client attempts to create a new ticket while the previous ticket is still in progress. Should we just delete it? I had considered maybe doing nothing and treating that in flight ticket as our current ticket, but the matchmaking params may not match between that request and our new request (ex: game modes are different).
@Damar after talking with @xalbertus1 more I realize that we have 2 issues that need resolving here. We still need to know how to handle the error given that the client can crash and/or quit in an unclean way while the ticket is still searching, the other is as you and @xalbertus1 already discussed. Specifically, we’re creating a matchmaking ticket that is being resolved with a game session. After playing the game session, we’re no longer able to matchmake again as it would appear that the previous ticket was never marked as found. As you said, the match was created and therefore the ticket should have been marked found so I don’t see how going the route of using Fiddler to troubleshoot client-side SDK network traffic is a reasonable approach at this stage of troubleshooting. Can we not start by giving you matchmaking ticket IDs?
After a discussion with the internal team, we have the following recommendations for handling this case. You can put it before start matchmaking. The flow should be:
Get current user match ticket: Call GetUserMatchmakingTickets to check if a match ticket already exists.
If a ticket exists:
Delete the existing ticket using DeleteMatchmakingTicket.
I just did what you suggest and it does not work. The steps I am taking:
-Check if the user has an ongoing ticket (GetUserMatchmakingTickets)
->If there are no tickets, proceed with new ticket creation (CreateMatchmakingTicket)
->If there are tickets active, delete, wait for the confirmation and then proceed with new ticket creation (DeleteMatchmakingTicket and then CreateMatchmakingTicket)
And what’s happening is that when there is an active ticket, after calling DeleteMatchmakingTicket the response is successful but when we try to create a new ticket it fails again due to the same error; it’s like the ticket is not being deleted.
If possible, could you share your user ID and the timestamp (in UTC) when the issue occurred? This will help me track the flow and understand what happened and why it happened.
Thank you @xalbertus1 for the detailed information. After checking with the internal team, we discovered a bug affecting solo matchmaking. We are working on a fix, and I will notify you once it has been deployed.
In the meantime, you can implement a retry mechanism as a workaround. The flow should remain the same, but after creating a match ticket, if it fails and gets an error 520300, add a retry after a specified number of seconds.
The retry mechanism doesn’t work and we end up waiting on the order of minutes before we’re allowed to matchmake again. We’ve tried deleting the ticket and that doesn’t work either. Talking to @xalbertus1 through DM it sounds like this is a known issue on AB’s side. If that is indeed the case the we need an update as this is greatly impacting our ability to test and iterate.
This is a known issue, and we will deploy a fix in the next update. As a temporary solution, we recommend reducing the ticket expiration to 3-5 seconds. This way, after a match ticket is created, it will automatically be deleted after 3-5 seconds, as you should instantly get a match.
We have deployed a hotfix to address the issue where the ruleset team alliance numbers were set to 1. Please let me know if you are still encountering any problems.