Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question Can't match make before creating a test allocation

Discussion in 'Matchmaker' started by b4guw1x, Dec 18, 2023.

  1. b4guw1x

    b4guw1x

    Joined:
    Apr 16, 2020
    Posts:
    39
    Hi all.

    I implemented matchmaker-multiplay game server hosting. They are working just fine. But to be able to find match, first i need to create a test allocation. This allocation creates new server instances. And after that, i could join-find matches.

    But there is a problem. When i didn't use multiplay servers for a while, all of the servers shutting down. And since there is no server, i can't find any match (because there is no deallocated available servers). Is it an intended behaviour? I got 30 seconds ticket timeout and i don't know is it enough or not.
     
  2. b4guw1x

    b4guw1x

    Joined:
    Apr 16, 2020
    Posts:
    39
    I solved it. Actually i noticed it. As expected, my timeout was way to short. I set the timeouts to 480 seconds. And at the 135 th second, it finally created the server and start the match.

    upload_2023-12-20_17-52-12.png

    I wish the server creation time would be faster :D
     
  3. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    92
    I can not match tickets, do you have any idea?
     
  4. b4guw1x

    b4guw1x

    Joined:
    Apr 16, 2020
    Posts:
    39
    Do you try to create match tickets 2 times at unity editor (like using paralel sync or some other plugin). Also you need at least 1 not allocated server to create match ticket. Ticket creation has a lot of exceptions. Which one do you get? I use BossRoom sample ticket creation and i get match make responses like this.


    Code (CSharp):
    1.         private async Task<MatchmakerPollingResult> GetMatchAsync()
    2.         {
    3.             var matchmakingResult = await _matchmaker.Matchmake(UserData);
    4.             if (matchmakingResult.result == MatchmakerPollingResult.Success)
    5.             {
    6.                 LoadingPanel.Instance.ChangeSceneWithLoadingConditionally(Constants.SCENE_GAME,
    7.                     () => NetworkManager.Singleton.IsConnectedClient, onSceneLoadCompleted: () => { StartClient(matchmakingResult.ip, matchmakingResult.port); });
    8.             }
    9.  
    10.             return matchmakingResult.result;
    11.         }
    You can see which one is your exception with matchmakingResult.result.

    Here is the types of exceptions.


    Code (CSharp):
    1.             switch (result)
    2.             {
    3.                 case MatchmakerPollingResult.Success:
    4.                     break;
    5.                 case MatchmakerPollingResult.TicketCreationError:
    6.                     break;
    7.                 case MatchmakerPollingResult.TicketRetrievalError:
    8.                     break;
    9.                 case MatchmakerPollingResult.MatchAssignmentError:
    10.                     break;
    11.             }
     
  5. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    92
    Tickets are created successfully, but simply don't match togher
     
  6. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    92
    I'm using parallel sync with two different game account
     
  7. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    92
    I have 3 servers on one machine, like this:
    upload_2024-2-5_20-10-56.png
     
  8. b4guw1x

    b4guw1x

    Joined:
    Apr 16, 2020
    Posts:
    39
    Matchmaking is not working with parallel sync since anonymus sign in is creating same authentication variables. You need to at least one build and one unity editor to create matchmaking tickets and match them as far as i know. Can you try?
     
  9. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    92
    We have found a solution, simply you need to Set a different profile in the UnityServices.InitializeAsync method as a parameter, when you do this, than you can singIn with different acounts on the same pc, but one instance will have profile "default" and the other one will have "clone" profile for example.

    upload_2024-2-8_0-14-29.png
     
    b4guw1x likes this.
  10. b4guw1x

    b4guw1x

    Joined:
    Apr 16, 2020
    Posts:
    39
    Oh that's great to know! Awesome! Thank you for sharing