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

質問済み 1年前294ビュー
1回答
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
回答済み 1年前
  • Thanks! Will try this out and keep you updated!

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ