[Gamelift] Stop players from entering a game session

0

I would like to stop players from entering a game session once a minimum number of players have joined. Here's an example:

  • The maximum number of players that could be in a given game session is 50.
  • The minimum number of required players to start a game session is 25.
  • Once the minimum of 25 players is reached, I would like to "close" the game session so that new players cannot join this game session

I know that in the matchmaking rule set, there is this logic:

    "teams" : [{
        "name": "allplayers",
        "maxPlayers" : 50,
        "minPlayers" : 25
    }],

However, with the above logic, players can still enter the game session after the 25 limit is reached. How can I "close" the game session once the 25 limit is reached? By "close", I mean that new players cannot join this running game session.

Thanks!

preguntada hace un año296 visualizaciones
1 Respuesta
1

Hi!

There are a couple of ways you could potentially do this.

Once the game session has started, you can invoke UpdatePlayerSessionCreationPolicy through the server SDK with a DENY_ALL policy. This prevents the game session from accepting new players

Alternatively if this decision is being made outside of the game server itself (for instance a backend client service):

  • You could call the UpdateGameSession API with the required max player session count, to update the maximum number of players that can be connected simultaneously to the game session.
  • You could call the UpdateGameSession API with a DENY_ALL player session creation policy. This will prevent the game session from accepting any new players.

Thanks!

AWS
respondido hace un año
  • Thanks! Will try this out and keep you updated!

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas