UE4 Flexmatch - Player Session ID

I was hoping for some clarification around when to use Player Session ID vs Player ID once a match has been established. Since session verification on the server is performed using the Player Session ID, I was operating under the assumption that I could get away with just that data.

However, when looking at the Matchmaker data I received, it only has Player IDs. No data exists in the GameSessionData, and DescribePlayerSessions isn’t accessible inside of UE4 (from what I have found at least).

Is there a good way to get Player Session IDs for every Player ID inside of UE4, or should I just have players send both when they attempt to connect to my game sessions?

Is there a particular reason why this data is not available inside of the Matchmaker data coming out of FlexMatch?

Hi @RobotBarber

Apologies for the delayed response! I am looking into this.

In the mean time, could you provide more details around your use case? Why do you need to call DescribePlayerSessions from inside UE4?

Is it an option for you to write an Unreal object around DescribePlayerSessions?

My main question was around whether I was approaching this the wrong way from an architectural standpoint. When a user receives a placement from DescribeMatchmaking, they iterate over the player array to find the entry that matches their Player ID and cache the Player Session Token. Then, when they connect, they provide the Session Token to be authenticated. This associates the given connection with that Session Token.

The Matchmaker data received by the server when a session is started includes information about team makeup. However, this team data only includes the Player ID for team members, but not their Session Token.

Because of this, there does not seem to be a way to associate a connection (Session Token) with player data (Player ID) without just passing both IDs when I connect.

I could go through and add a call in FGameLiftServerSDKModule into DescribePlayerSessions, or link the GameLift SDK into my project. I was just wondering if there was A) a better way for me to do that and B) a reason why FlexMatch matchmaker data doesn’t just include both the Player ID and the Session Token, and if this might be added in the future.


Hi @RobotBarber

The FlexMatch matchmaker data does not include the PlayerSessionId because, from a matchmaking perspective, it does not need it. Player sessions are created when a player gets a reserved spot in a game session or when game session placement happens - and this happens after matchmaking has completed.

I believe AcceptPlayerSession may be the API you are looking for.

C# documentation: https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-server-sdk-csharp-ref-actions.html#integration-server-sdk-csharp-ref-acceptplayersession

Let me know if that helps!