Exclude sessions with PlayerAcceptionPolicy set to Deny from search_game_sessions method


I have a game that can accomodate as much as 50 players. However, the loby window is for 2 minutes and match starts with whoever joined in the match and there are possibilities that the total players in game when match starts is less than 50. To stop further player acceptation, I am setting playeracceptionpolicy to Deny. However, When I use game_lift.search_game_sessions(FleetId = GAMELIFT_FLEET_ID, FilterExpression = "hasAvailablePlayerSessions=true") to search for available sessions, the result still returns those sessions with playeracceptpolicy set to deny. Hoe can I exclude those sessions with playerpolicy set to Deny from the result?

1 Answer

Hello, When working with the search_game_sessions api you should be careful not to call it to track game session status. Instead, you must configure configure an Amazon Simple Notification Service (SNS) topic to receive notifications from FlexMatch or queues. see more here

Also please consider that returned values for playerSessionCount and hasAvailablePlayerSessions change quickly as players join sessions and others drop out. Results should be considered a snapshot in time. Be sure to refresh search results often, and handle sessions that fill up before a player can join.

Remember that the sessions that are created have a timeout of acceptance, that means if the session is still within those 60 seconds you will probably will get some information missmach.

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions

Relevant content