amazonka-gamelift-1.6.1: Amazon GameLift SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.GameLift.StartMatchmaking

Contents

Description

Uses FlexMatch to create a game match for a group of players based on custom matchmaking rules, and starts a new game for the matched players. Each matchmaking request specifies the type of match to build (team configuration, rules for an acceptable match, etc.). The request also specifies the players to find a match for and where to host the new game session for optimal performance. A matchmaking request might start with a single player or a group of players who want to play together. FlexMatch finds additional players as needed to fill the match. Match type, rules, and the queue used to place a new game session are defined in a MatchmakingConfiguration . For complete information on setting up and using FlexMatch, see the topic Adding FlexMatch to Your Game .

To start matchmaking, provide a unique ticket ID, specify a matchmaking configuration, and include the players to be matched. You must also include a set of player attributes relevant for the matchmaking configuration. If successful, a matchmaking ticket is returned with status set to QUEUED . Track the status of the ticket to respond as needed and acquire game session connection information for successfully completed matches.

Tracking ticket status -- A couple of options are available for tracking the status of matchmaking requests:

  • Polling -- Call DescribeMatchmaking . This operation returns the full ticket object, including current status and (for completed tickets) game session connection info. We recommend polling no more than once every 10 seconds.
  • Notifications -- Get event notifications for changes in ticket status using Amazon Simple Notification Service (SNS). Notifications are easy to set up (see CreateMatchmakingConfiguration ) and typically deliver match status changes faster and more efficiently than polling. We recommend that you use polling to back up to notifications (since delivery is not guaranteed) and call DescribeMatchmaking only when notifications are not received within 30 seconds.

Processing a matchmaking request -- FlexMatch handles a matchmaking request as follows:

  • Your client code submits a StartMatchmaking request for one or more players and tracks the status of the request ticket.
  • FlexMatch uses this ticket and others in process to build an acceptable match. When a potential match is identified, all tickets in the proposed match are advanced to the next status.
  • If the match requires player acceptance (set in the matchmaking configuration), the tickets move into status REQUIRES_ACCEPTANCE . This status triggers your client code to solicit acceptance from all players in every ticket involved in the match, and then call AcceptMatch for each player. If any player rejects or fails to accept the match before a specified timeout, the proposed match is dropped (see AcceptMatch for more details).
  • Once a match is proposed and accepted, the matchmaking tickets move into status PLACING . FlexMatch locates resources for a new game session using the game session queue (set in the matchmaking configuration) and creates the game session based on the match data.
  • When the match is successfully placed, the matchmaking tickets move into COMPLETED status. Connection information (including game session endpoint and player session) is added to the matchmaking tickets. Matched players can use the connection information to join the game.

Matchmaking-related operations include:

Synopsis

Creating a Request

startMatchmaking Source #

Creates a value of StartMatchmaking with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • sTicketId - Unique identifier for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift will generate one in the form of a UUID. Use this identifier to track the matchmaking ticket status and retrieve match results.
  • sConfigurationName - Name of the matchmaking configuration to use for this request. Matchmaking configurations must exist in the same region as this request.
  • sPlayers - Information on each player to be matched. This information must include a player ID, and may contain player attributes and latency data to be used in the matchmaking process. After a successful match, Player objects contain the name of the team the player is assigned to.

data StartMatchmaking Source #

Represents the input for a request action.

See: startMatchmaking smart constructor.

Instances
Eq StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Data StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StartMatchmaking -> c StartMatchmaking #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c StartMatchmaking #

toConstr :: StartMatchmaking -> Constr #

dataTypeOf :: StartMatchmaking -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c StartMatchmaking) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c StartMatchmaking) #

gmapT :: (forall b. Data b => b -> b) -> StartMatchmaking -> StartMatchmaking #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StartMatchmaking -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StartMatchmaking -> r #

gmapQ :: (forall d. Data d => d -> u) -> StartMatchmaking -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> StartMatchmaking -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> StartMatchmaking -> m StartMatchmaking #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StartMatchmaking -> m StartMatchmaking #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StartMatchmaking -> m StartMatchmaking #

Read StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Show StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Generic StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Associated Types

type Rep StartMatchmaking :: Type -> Type #

Hashable StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

ToJSON StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

AWSRequest StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Associated Types

type Rs StartMatchmaking :: Type #

ToHeaders StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

ToPath StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

ToQuery StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

NFData StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Methods

rnf :: StartMatchmaking -> () #

type Rep StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

type Rep StartMatchmaking = D1 (MetaData "StartMatchmaking" "Network.AWS.GameLift.StartMatchmaking" "amazonka-gamelift-1.6.1-GajLKSxsevT2faX837q2Xl" False) (C1 (MetaCons "StartMatchmaking'" PrefixI True) (S1 (MetaSel (Just "_sTicketId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "_sConfigurationName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_sPlayers") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Player]))))
type Rs StartMatchmaking Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Request Lenses

sTicketId :: Lens' StartMatchmaking (Maybe Text) Source #

Unique identifier for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift will generate one in the form of a UUID. Use this identifier to track the matchmaking ticket status and retrieve match results.

sConfigurationName :: Lens' StartMatchmaking Text Source #

Name of the matchmaking configuration to use for this request. Matchmaking configurations must exist in the same region as this request.

sPlayers :: Lens' StartMatchmaking [Player] Source #

Information on each player to be matched. This information must include a player ID, and may contain player attributes and latency data to be used in the matchmaking process. After a successful match, Player objects contain the name of the team the player is assigned to.

Destructuring the Response

startMatchmakingResponse Source #

Creates a value of StartMatchmakingResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • srsMatchmakingTicket - Ticket representing the matchmaking request. This object include the information included in the request, ticket status, and match results as generated during the matchmaking process.
  • srsResponseStatus - -- | The response status code.

data StartMatchmakingResponse Source #

Represents the returned data in response to a request action.

See: startMatchmakingResponse smart constructor.

Instances
Eq StartMatchmakingResponse Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Data StartMatchmakingResponse Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StartMatchmakingResponse -> c StartMatchmakingResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c StartMatchmakingResponse #

toConstr :: StartMatchmakingResponse -> Constr #

dataTypeOf :: StartMatchmakingResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c StartMatchmakingResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c StartMatchmakingResponse) #

gmapT :: (forall b. Data b => b -> b) -> StartMatchmakingResponse -> StartMatchmakingResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StartMatchmakingResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StartMatchmakingResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> StartMatchmakingResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> StartMatchmakingResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> StartMatchmakingResponse -> m StartMatchmakingResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StartMatchmakingResponse -> m StartMatchmakingResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StartMatchmakingResponse -> m StartMatchmakingResponse #

Read StartMatchmakingResponse Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Show StartMatchmakingResponse Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Generic StartMatchmakingResponse Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

Associated Types

type Rep StartMatchmakingResponse :: Type -> Type #

NFData StartMatchmakingResponse Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

type Rep StartMatchmakingResponse Source # 
Instance details

Defined in Network.AWS.GameLift.StartMatchmaking

type Rep StartMatchmakingResponse = D1 (MetaData "StartMatchmakingResponse" "Network.AWS.GameLift.StartMatchmaking" "amazonka-gamelift-1.6.1-GajLKSxsevT2faX837q2Xl" False) (C1 (MetaCons "StartMatchmakingResponse'" PrefixI True) (S1 (MetaSel (Just "_srsMatchmakingTicket") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe MatchmakingTicket)) :*: S1 (MetaSel (Just "_srsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))

Response Lenses

srsMatchmakingTicket :: Lens' StartMatchmakingResponse (Maybe MatchmakingTicket) Source #

Ticket representing the matchmaking request. This object include the information included in the request, ticket status, and match results as generated during the matchmaking process.