NEW_REQUEST_WITH_A_DUPLICATE_PLAYER

Hello there

Sometimes my matchmaking ticket is cancelled due to “NEW_REQUEST_WITH_A_DUPLICATE_PLAYER” error.
This code below, is in Lambda

from future import print_function
import boto3

client = boto3.client( “gamelift” )

def handler( event, context ):
# PlayerId is only for debug.
playerId = event[ “PlayerId” ]
matchmakingTicketId = event[ “MatchmakingTicketId” ]

response = { "TicketStatus" : "NotSet", "IpAddress" : "NotYet", "Port" : 0, "PlayerId" : "NotYet", "PlayerSessionId" : "NotYet" }

if not matchmakingTicketId :
    return response

match_response = client.describe_matchmaking( TicketIds = [ matchmakingTicketId ] )
print( "=====> match_response : ", match_response )

PlayerId is one of parameters for start_matchmaking() in Lambda.

After I get the “NEW_REQUEST_WITH_A_DUPLICATE_PLAYER” error, I always get the same error every time. After creating a new account for the PlayerId, the error disappears because the PlayerId is different but I tested the matchmaking alone with one game client and I submitted my matchmaking one at a time but I don’t remember whether stop_matchmaking() is called or not before closing my client.

This error message below, is result of “client.describe_matchmaking” function in Lambda.

What is a problem?

Any help is appreciated.

Matchmaking tickets will be cancelled if they reference player ids that are referenced in new active matchmaking tickets.

"A player (identified by their player ID) can only be included in one active matchmaking request at a time. When you create a new request for a player, any active matchmaking tickets with the same player ID are automatically canceled. "

https://docs.amazonaws.cn/en_us/gamelift/latest/developerguide/match-client.html

I already read the docs but I tested the matchmaking alone. No one never used my account at all.
If I join a dedicated server after I’m matched with other people by FlexMatch and someone submits a new matchmaking to FlexMatch with the same account that I’m using, what will happen in GameLift?

Can I see NEW_REQUEST_WITH_A_DUPLICATE_PLAYER?

I also test this case. The someone joined another dedicated server.

I really have no idea about that.

Any help is appreciated.

Your players make matchmaking requests using the matchmaker config & player id assigned to them by you. Player Ids should be “A unique identifier for a player” like a UUID.

When their matchmaking requests succeed they get player session connection information. They then join your server using their player id, your server can validate and accept the player session. No other players can connect on the same player session once its accepted. Ideally your player ids are not something players care about (they are just an internal identifier for the player).

If you have clients that are making overlapping or duplicate matchmaking requests (or your backfill requests are not accurately tracking connected players) then you will see matchmaking tickets being cancelled because the matchmaker is already trying to match that player based on their ids ie 2 active matchmaking tickets where the Players param contains the same player id, will result in one ticket being cancelled.

As to your questions:

If you join a server after matchmaking, and someone requests a new match with your player id, then nothing really happens:

  • Your player id may be matched by the request
  • A new player session would be created on the new server for your player
  • But the session will timeout because you know nothing about it and are playing on the other server

Can you see a NEW_REQUEST_WITH_A_DUPLICATE_PLAYER?

  • Either quickly submit duplicate start-matchmaking requests where Players contains the same player Id or overlap matchmaking requests such that the same player Id occurs in two active tickets on the matchmaker
    • This can be hard to test in low volumes so you may need to adjust your ruleset to slow it down to allow the tickets intefere with each other.

Hopefully thats helpful.

Thank you very much. It helped me.