Search Unity

Bug Matchmaking returns a "Found" response while server is not yet ready

Discussion in 'Matchmaker' started by spikyworm5, Feb 1, 2023.

  1. spikyworm5

    spikyworm5

    Joined:
    Jul 13, 2020
    Posts:
    31
    Hello,

    We're using the matchmaking service to allocate a match but we have a problem in which in some cases the matching system returns a server before the initialization completes and the client is unable to connect. In those cases we get a `connection refused` error.

    On the game server side, we are calling
    await MultiplayService.Instance.ReadyServerForPlayersAsync()
    only after the server is fully ready. By "fully ready", I mean that our Mirror server is started and the port is assigned. We even tried waiting for 3 seconds before calling the ready API and also tried calling
    await MultiplayService.Instance.UnreadyServerAsync()
    before starting the initialization but it seems to have no effect.

    On the other hand, waiting for even just 1 second on the client before trying to join the server solves the issue.

    Can you suggest what we might be doing wrong?

    Thanks,
    Maor
     
  2. guillaumedUnity

    guillaumedUnity

    Unity Technologies

    Joined:
    Apr 1, 2021
    Posts:
    36
    Hi, thanks for asking !
    The readiness of the server is not a functionality that is currently supported on the matchmaker.
    But it is in our plan to integrate this so that servers can indicate when they are ready to receive tickets.
    We will let you know when this feature become available.
     
  3. spikyworm5

    spikyworm5

    Joined:
    Jul 13, 2020
    Posts:
    31
    Thank you for your reply. So what is the method
    MultiplayService.Instance.ReadyServerForPlayersAsync
    used for?

    Is there a safe way or a workaround I can use to wait for the server to be ready?
     
    LoicLeGrosFrere likes this.