Amazon.GameLift.AmazonGameLiftClient.SearchGameSessions C# (CSharp) Method

SearchGameSessions() public method

Retrieves a set of game sessions that match a set of search criteria and sorts them in a specified order. Currently a game session search is limited to a single fleet. Search results include only game sessions that are in ACTIVE status. If you need to retrieve game sessions with a status other than active, use DescribeGameSessions. If you need to retrieve the protection policy for each game session, use DescribeGameSessionDetails.

You can search or sort by the following game session attributes:

  • gameSessionId -- ID value assigned to a game session. This unique value is returned in a GameSession object when a new game session is created.

  • gameSessionName -- Name assigned to a game session. This value is set when requesting a new game session with CreateGameSession or updating with UpdateGameSession. Game session names do not need to be unique to a game session.

  • creationTimeMillis -- Value indicating when a game session was created. It is expressed in Unix time as milliseconds.

  • playerSessionCount -- Number of players currently connected to a game session. This value changes rapidly as players join the session or drop out.

  • maximumSessions -- Maximum number of player sessions allowed for a game session. This value is set when requesting a new game session with CreateGameSession or updating with UpdateGameSession.

  • hasAvailablePlayerSessions -- Boolean value indicating whether or not a game session has reached its maximum number of players. When searching with this attribute, the search value must be true or false. It is highly recommended that all search requests include this filter attribute to optimize search performance and return only sessions that players can join.

To search or sort, specify either a fleet ID or an alias ID, and provide a search filter expression, a sort expression, or both. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a collection of GameSession objects matching the request is returned.

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.

/// The service encountered an unrecoverable internal failure while processing the request. /// Clients can retry such requests immediately or after a waiting period. /// /// One or more parameter values in the request are invalid. Correct the invalid parameter /// values before retrying. /// /// A service resource associated with the request could not be found. Clients should /// not retry such requests. /// /// The service is unable to resolve the routing for a particular alias because it has /// a terminal RoutingStrategy associated with it. The message returned in this /// exception is the message defined in the routing strategy itself. Such requests should /// only be retried if the routing strategy for the specified alias is modified. /// /// The client failed authentication. Clients should not retry such requests. ///
public SearchGameSessions ( SearchGameSessionsRequest request ) : SearchGameSessionsResponse
request Amazon.GameLift.Model.SearchGameSessionsRequest Container for the necessary parameters to execute the SearchGameSessions service method.
return Amazon.GameLift.Model.SearchGameSessionsResponse
        public SearchGameSessionsResponse SearchGameSessions(SearchGameSessionsRequest request)
        {
            var marshaller = new SearchGameSessionsRequestMarshaller();
            var unmarshaller = SearchGameSessionsResponseUnmarshaller.Instance;

            return Invoke<SearchGameSessionsRequest,SearchGameSessionsResponse>(request, marshaller, unmarshaller);
        }
AmazonGameLiftClient