Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Player

Represents a player in matchmaking.

When starting a matchmaking request, a player has a player ID, attributes, and may have latency data. Team information is added after a match has been successfully completed.

Hierarchy

Index

Constructors

constructor

  • Constructs a new message instance.

    Parameters

    • Optional properties: Properties<Player>

    Returns Player

Properties

Readonly $type

$type: Type

Reference to the reflected type.

Optional latencyInMs

latencyInMs: {}

Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connecting to AWS Regions.

If this property is set, FlexMatch considers the match only in Regions for which latency is reported.

If a matchmaker has a rule that evaluates player latency, players must report latency in order to be matched. If no latency is reported in this scenario, FlexMatch assumes that no Regions are available to the player and the ticket is not matchable.

Type declaration

  • [region: string]: number

Optional playerAttributes

playerAttributes: {}

A collection of key:value pairs containing player information for use in matchmaking.

Player attribute keys must match the playerAttributes used in a matchmaking rule set.

Example:

"PlayerAttributes": {
 skill: { N: 23, type: AttributeValue.DOUBLE },
 gameMode: { S: "deathmatch", type: AttributeValue.STRING },
}

Type declaration

Optional playerId

playerId: string

Unique ID for the player

Optional team

team: string

Name of team that the player is assigned to in a match.

Team names are defined in a matchmaking rule set.

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