Not all players joining a session are added to the Matchmaker MatchProperties and Matchmaker Session players list

  • My server creates a session with MultiplayerServerService.Instance.StartMultiplaySessionManagerAsync when allocated
  • Clients sign in with UGS Auth using
AuthenticationService.Instance.SwitchProfile(RandomString(30));
AuthenticationService.Instance.SignInAnonymouslyAsync();
  • Clients search for a game using MultiplayerService.Instance.MatchmakeSessionAsync

In my case I have 2 clients that log the following player Ids after signing in

A
[Auth] Signed in with player ID h4A5GVMmiLuQdEIxafMiU8mdU1hm

B
[Auth] Signed in with player ID uFuRVTIebg3eXXxzitgXHYOjr9S7

Both clients successfully find the same match and connect. I assign my own Ids as well to clients and these are different from each other.
The server subscribes to session.PlayerJoined and session.PlayerHasLeft.
In my case session.PlayerJoined is only called for the first player Id and, funny enough, session.PlayerHasLeft is only called for the second player Id once the second client closes the application.
The server also logs the Session.GetMatchmakingResults().MatchProperties after each connection and disconnection and these only contain the first player Id as well.

Both clients run on the same machine. I know that that should be possible as I used the Matchmaker without sessions before and never ran into this issue. So I suspect this is a Sessions issue?

Edit:
I tested this with 2 friends and no Players are added except for the first player who made the server spin up.

The last answer from Unity staff in this forum was posted December 6th. The last update for the Multiplayer services package was released 2.5 months ago. Has this team been disbanded?

Hello! Thanks for raising this issue. To help us investigate it further, please share more details at your earliest convenience:

  • Are you able to share a code snippet here of your implementation for us to examine?

Any of those details may help us to find a resolution. Thanks!

Thanks for getting back to me.

Server side

    private static IMultiplaySessionManager sessionManager;

    public static StoredMatchProperties MatchProperties => 
        sessionManager.Session.GetMatchmakingResults().MatchProperties;

    public static async Task ConnectToMultiplay(int maxConnections)
    {
        await UnityServices.InitializeAsync();

        if (UnityServices.Instance.GetMultiplayerService() != null)
        {
            await ServerAuthenticationService.Instance.SignInFromServerAsync();
            var token = ServerAuthenticationService.Instance.AccessToken;

            var callbacks = new MultiplaySessionManagerEventCallbacks();
            callbacks.Allocated += OnServerAllocatedCallback;

            var sessionManagerOptions = new MultiplaySessionManagerOptions()
            {
                SessionOptions = new SessionOptions()
                {
                    // max player count per server is 16
                    MaxPlayers = maxConnections
                }
                .WithNetworkHandler(ServerControl.CustomNetworkHandler)
                .WithDirectNetwork()
                .WithBackfillingConfiguration(enable: true, automaticallyRemovePlayers: true, 
                    autoStart: false, playerConnectionTimeout: 30, backfillingLoopInterval: 1),

                MultiplayServerOptions = new MultiplayServerOptions(
                    serverName: DefaultServerName,
                    gameType: DefaultGameType,
                    buildId: DefaultBuildId,
                    map: DefaultMap,
                    autoReady: false
                ),
                Callbacks = callbacks
            };
            sessionManager = await MultiplayerServerService.Instance.StartMultiplaySessionManagerAsync(sessionManagerOptions);

            async void OnServerAllocatedCallback(IMultiplayAllocation obj)
            {
                var session = sessionManager.Session;
                session.PlayerJoined += Session_PlayerJoined;
                session.PlayerHasLeft += Session_PlayerHasLeft;

                LogServerConfig();

                await sessionManager.SetPlayerReadinessAsync(true);
                await sessionManager.Session.StartBackfillingAsync();
            }
        }
    }

    private static void Session_PlayerJoined(string playerId)
    {
        Debug.Log($"Player with Id {playerId} joined the session.");
    }

    private static void Session_PlayerHasLeft(string playerId)
    {
        Debug.Log($"Player with Id {playerId} left the session.");
    }

Client side

public static async Task TryFindGame()
    {
        var matchmakerOptions = new MatchmakerOptions
        {
            QueueName = UGSShared.Matchmaking_Queue_DayOne,
            TicketAttributes = new Dictionary<string, object>() { { "GameDay", "DayOne" } }, 
        };

        var sessionOptions = new SessionOptions()
        {
            // Max player count per team is 4
            MaxPlayers = Team.MaxMemberCount 
        }.WithNetworkHandler(ClientControl.CustomNetworkHandler)
         .WithDirectNetwork();

        matchmakerCancellationSource = new CancellationTokenSource();

        try
        {
            ActiveSession = await MultiplayerService.Instance.MatchmakeSessionAsync(matchmakerOptions,
                sessionOptions, matchmakerCancellationSource.Token);
        }
        catch (SessionException e)
        {
            Debug.LogException(e);
        }
        finally
        {
            CancelMatchmaking();
        }
    }

And the Custom NetworkHandler (Server is already started when connecting to the Multiplayer Services so it doesn’t do anything server side)

public class UGSCustomNetworkHandler : INetworkHandler
{
    private NetworkConfiguration _connectionData;

    public UGSCustomNetworkHandler() { }

#if UNITY_EDITOR || !UNITY_SERVER
    private ClientControl client;
    public UGSCustomNetworkHandler(ClientControl client) 
    {
        this.client = client;
    }
#endif

    public Task StartAsync(NetworkConfiguration configuration)
    {
        _connectionData = configuration;

#if UNITY_EDITOR || !UNITY_SERVER
        if (configuration.Role == NetworkRole.Client)
        {
            client.ConnectToServer(configuration.DirectNetworkPublishAddress);
        }
#endif
        return Task.CompletedTask;
    }

    public Task StopAsync()
    {
        return Task.CompletedTask;
    }
}

Also tried calling Session.RefreshAsync occassionally on the Server. Issue still persists.

bump bump bump bump

Thanks for sharing the code snippets. It looks fine from initial review. I haven’t seen any similar reports of this issue. To help us try to reproduce the issue, can you please share a bit more details:

  • Which version of Multiplayer Services package are you using?
  • Do you notice any errors in client or server logs?
  • Can you share details of the rules for your Matchmaker pool in the Unity Cloud dashboard?
  • Are you able to try the Small Scale Competitive Multiplayer Template and confirm if the issue occurs for you in the template?

Any further details can help us try to reproduce this issue or provide guidance. Thanks!

  • Multiplayer Services Package version 1.1.8
  • No errors
  • Matchmaker Pool rules
{
  "Name": "Day One",
  "MatchDefinition": {
    "Teams": [
      {
        "Name": "All",
        "TeamCount": {
          "Min": 1,
          "Max": 4
        },
        "PlayerCount": {
          "Min": 1,
          "Max": 4,
          "Relaxations": []
        }
      }
    ],
    "MatchRules": []
  },
  "BackfillEnabled": true
}
  • I can’t try the template, the setup step of the cloud project doesn’t work. Specifically, Tutorial ‘Unity Gaming Services Setup’ step 7/12 just leads to a blank page in UGS cloud. So the setup is probably not successful.
    Trying to upload the build then shows Failed to Upload build: No Permissions. Please make sure you have enable game server hosting in the dashboard.
    Tried with multiple organizations, including the one my actual project is in.

Any ideas? Bump bump bump

Hello! We have discussed this issue internally and have some guidance to share.

  • Session.GetMatchmakingResults() is a snapshot at the time of the match creation. It is NEVER updated.

  • That means, after the match creation, if you want an up to date list, you have to maintain it yourself (or check the session properties instead of matchmaker).

I hope that helps to clarify. Please let us know if you have any other questions or need any help.

There is nothing in the SessionProperties except for _session_network and even if Session.GetMatchmakingResults() is never updated, surely the sessions player list should be? But the PlayerJoined and PlayerHasLeft events are not raised correctly either, as mentioned before.

Thanks for reporting that your PlayerJoined and PlayerHasLeft events are not working as expected. We haven’t seen any similar reports, and the issue has not yet been reproduced internally.

To help us investigate further, would you be able to try updating to Multiplayer Services 2.1.3 with game server hosting support to confirm if the issue persists?

In another thread, it was announced that Unity Matchmaker: Third-Party Hosting Support is Now Generally Available:

With the deprecation of Unity Multiplay Hosting set for March 31, 2026, this feature provides the essential tools to migrate your backend infrastructure while maintaining a seamless experience for your players.

The Matchmaker documentation includes some guidance for setting up the Matchmaker hosting providers for various server hosting platforms.

It would greatly help the investigation if you can confirm whether you notice the issue persisting with a more recent version of Multiplayer Services. Please review the documentation above and let us know if you can give that a try. Thanks!

Hi, so I’ve cloned the matchmaking providers repo, deployed it via the Unity editor and now the Client throws

SessionException: Ticket Failed: AllocationError

Edit:
I had the incorrect Function Names. I corrected those.

Now with Matchmaker Pools Hosting type set to Multiplay or Cloud Code the Server is allocated but the Client doesn’t connect to it and throws

SessionException: Ticket Failed: {"detail":"the maximum server capacity has been reached","requestId":"f602d8b9-0f78-47ed-a4fe-e147b0ae9cd2","request_id":"f602d8b9-0f78-47ed-a4fe-e147b0ae9cd2","status":400,"title":"Bad Request"}
  at Unity.Services.Multiplayer.Matchmaker.SetMatchFailure

Could the issue here be that I now no longer call SessionManager.SetPlayerReadinessAsync(true); as there is no SessionManager anymore? If so, how can we set the PlayerReadiness now?

Edit:
There is also an issue on the Server itself, trying to retrieve the MatchmakingResults


[Multiplayer]: BadRequest (21400) 
 Title: Bad Request 
 Errors: Bad Request
[Multiplayer]: Error while fetching matchmaking results from allocation payload: HTTP/1.1 400 Bad Request

My server code is pretty much exactly the code snippet you linked

await UnityServices.InitializeAsync();
await ServerAuthenticationService.Instance.SignInWithServiceAccountAsync(ServiceKeyId, ServiceSecretKey);

var sessionOptions = new SessionOptions()
{
    MaxPlayers = maxConnections
}
.WithNetworkHandler(ServerControl.CustomNetworkHandler)
.WithDirectNetwork()
.WithBackfillingConfiguration(enable: true, automaticallyRemovePlayers: true,
autoStart: false, playerConnectionTimeout: 30, backfillingLoopInterval: 1);
session = await MultiplayerServerService.Instance.
    CreateMatchSessionAsync("MATCH_ID", sessionOptions);

session.PlayerJoined += Session_PlayerJoined;
session.PlayerHasLeft += Session_PlayerHasLeft;
await session.StartBackfillingAsync();

Edit 2: The Server error was fixed by just supplying a random number as the MatchID. Is that what we are supposed to do? I noticed that the MatchId displayed in the Dashboard is not the same I supplied though.
Either way, the Client side issue persists.

ideas? bump bump bump bump bump bump

Hello! Thanks for your patience here. I noticed you shared this error log:

“the maximum server capacity has been reached”

To address this issue, can you try increasing your Maximum available servers value in your Fleet Scaling settings? Please give that a try and let us know if the issue persists.

Honestly? Well, it does exactly what you would expect. It keeps spinning up servers and eventually times out with

SessionException: Ticket Timeout: Matchmaking took longer than the timeout value configured for the pool.

I will be really honest with you, yes, I have had a lot of patience now and I’m really about to throw everything UGS out.