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

질문됨 일 년 전281회 조회
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
답변함 일 년 전
  • Thanks! Will try this out and keep you updated!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠