[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!

gefragt vor einem Jahr294 Aufrufe
1 Antwort
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
beantwortet vor einem Jahr
  • Thanks! Will try this out and keep you updated!

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen