Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GameSession

Properties describing a game session.

A game session in ACTIVE status can host players. When a game session ends, its status is set to TERMINATED.

Once the session ends, the game session object is retained for 30 days. This means you can reuse idempotency token values after this time. Game session logs are retained for 14 days.

Hierarchy

Index

Constructors

constructor

  • Constructs a new message instance.

    Parameters

    Returns GameSession

Properties

Readonly $type

$type: Type

Reference to the reflected type.

Optional creationTime

creationTime: number

Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds.

Optional creatorId

creatorId: string

A unique identifier for a player.

This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.

Optional currentPlayerSessionCount

currentPlayerSessionCount: number

Number of players currently in the game session.

Optional dnsName

dnsName: string

DNS identifier assigned to the instance that is running the game session.

Values have the following format:

  • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.
  • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing)

When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

Optional fleetArn

fleetArn: string

The Amazon Resource Name (ARN) associated with the GameLift fleet that this game session is running on.

Optional fleetId

fleetId: string

A unique identifier for a fleet that the game session is running on.

Optional gameProperties

gameProperties: GameProperty[]

Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

You can search for active game sessions based on this custom data with SearchGameSessions.

Optional gameSessionData

gameSessionData: string

Set of custom game session properties, formatted as a single string value.

This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

Optional gameSessionId

gameSessionId: string

A unique identifier for the game session.

A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>.

Optional ipAddress

ipAddress: string

IP address of the instance that is running the game session.

When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

Optional matchmakerData

matchmakerData: string

Information about the matchmaking process that was used to create the game session.

It is in JSON syntax, formatted as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data. Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill).

Optional name

name: string

A descriptive label that is associated with a game session.

Session names do not need to be unique.

Optional port

port: number

Port number for the game session.

To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

Optional status

status: "ACTIVE" | "ACTIVATED" | "TERMINATING" | "TERMINATED" | "ERROR"

Current status of the game session.

A game session must have an ACTIVE status to have player sessions.

Optional statusReason

statusReason: "INTERRUPTED"

Provides additional information about game session status.

INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.

Optional terminationTime

terminationTime: number

Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds.

Static Readonly $type

$type: Type

Reference to the reflected type.

Methods

toJSON

  • toJSON(): {}
  • Converts this message to JSON.

    Returns {}

    JSON object

    • [k: string]: any

Static create

  • create<T>(this: Constructor<T>, properties?: {}): Message<T>
  • Creates a new message of this type using the specified properties.

    Type parameters

    Parameters

    • this: Constructor<T>
    • Optional properties: {}
      • [k: string]: any

    Returns Message<T>

    Message instance

Static decode

  • decode<T>(this: Constructor<T>, reader: Uint8Array | Reader): T
  • Decodes a message of this type.

    Type parameters

    Parameters

    • this: Constructor<T>
    • reader: Uint8Array | Reader

      Reader or buffer to decode

    Returns T

    Decoded message

Static decodeDelimited

  • decodeDelimited<T>(this: Constructor<T>, reader: Uint8Array | Reader): T
  • Decodes a message of this type preceeded by its length as a varint.

    Type parameters

    Parameters

    • this: Constructor<T>
    • reader: Uint8Array | Reader

      Reader or buffer to decode

    Returns T

    Decoded message

Static encode

  • encode<T>(this: Constructor<T>, message: T | {}, writer?: Writer): Writer
  • Encodes a message of this type.

    Type parameters

    Parameters

    • this: Constructor<T>
    • message: T | {}

      Message to encode

    • Optional writer: Writer

    Returns Writer

    Writer

Static encodeDelimited

  • encodeDelimited<T>(this: Constructor<T>, message: T | {}, writer?: Writer): Writer
  • Encodes a message of this type preceeded by its length as a varint.

    Type parameters

    Parameters

    • this: Constructor<T>
    • message: T | {}

      Message to encode

    • Optional writer: Writer

    Returns Writer

    Writer

Static fromObject

  • fromObject<T>(this: Constructor<T>, object: {}): T
  • Creates a new message of this type from a plain object. Also converts values to their respective internal types.

    Type parameters

    Parameters

    • this: Constructor<T>
    • object: {}

      Plain object

      • [k: string]: any

    Returns T

    Message instance

Static toObject

  • toObject<T>(this: Constructor<T>, message: T, options?: IConversionOptions): {}
  • Creates a plain object from a message of this type. Also converts values to other types if specified.

    Type parameters

    Parameters

    • this: Constructor<T>
    • message: T

      Message instance

    • Optional options: IConversionOptions

    Returns {}

    Plain object

    • [k: string]: any

Static verify

  • verify(message: {}): string
  • Verifies a message of this type.

    Parameters

    • message: {}

      Plain object to verify

      • [k: string]: any

    Returns string

    null if valid, otherwise the reason why it is not

Generated using TypeDoc