Skip to main content

ConnectedLensModule.MatchmakingConfig

Class

Configuration for matchmaking when creating a session.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v375

Configuration for matchmaking when creating a session. If not set on session options, no matchmaking occurs (direct session join).

Index

Extends

Properties

lobbyMode

lobbyMode: LobbyMode

Camera Kit

How matchmaking fills the session. Unset is classic matchmaking.

Since

Lens Scripting Version 387

Default Value

ConnectedLensModule.MatchmakingConfig.LobbyMode.Unset
@cameraKit

Example

var config = ConnectedLensModule.MatchmakingConfig.create(2, 6, 4);
config.lobbyMode = ConnectedLensModule.MatchmakingConfig.LobbyMode.Open;

maxPlayerCount

readonly maxPlayerCount: number

Maximum number of players allowed in the match. Must be at least 2 and at most 64.

Since

Lens Scripting Version 375


minPlayerCount

readonly minPlayerCount: number

Minimum number of players required to start the match. Must be at least 1.

Since

Lens Scripting Version 375


targetPlayerCount

targetPlayerCount: number

Target number of players that matchmaking attempts to fill for the session. Defaults to minPlayerCount if not explicitly set.

Since

Lens Scripting Version 375

Default Value

null

Methods

create()

static create(minPlayerCount, maxPlayerCount, targetPlayerCount?): MatchmakingConfig

Creates a new MatchmakingConfig instance with the specified player counts.

Parameters

ParameterTypeDescription
minPlayerCountnumberMinimum players required (1-64)
maxPlayerCountnumberMaximum players allowed (2-64, must be >= minPlayerCount)
targetPlayerCount?numberOptional. Number of players matchmaking aims to fill the session with. Omit it to leave the target unset, in which case matchmaking uses minPlayerCount. Equivalent to assigning ConnectedLensModule.MatchmakingConfig#targetPlayerCount afterwards.

Returns

MatchmakingConfig

Since

Lens Scripting Version 375


getMaxPlayerCountLimit()

static getMaxPlayerCountLimit(): number

Returns the maximum allowed value for maxPlayerCount.

Returns

number

Since

Lens Scripting Version 375


getMinPlayerCountLimit()

static getMinPlayerCountLimit(): number

Returns the minimum allowed value for minPlayerCount.

Returns

number

Since

Lens Scripting Version 375


getTypeName()

static getTypeName(): TypeName<MatchmakingConfig>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<MatchmakingConfig>

Since

Lens Scripting Version 375

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame

Nested types

Enumerations

EnumerationDescription
LobbyModeHow matchmaking fills a session. Set it on ConnectedLensModule.MatchmakingConfig#lobbyMode.
LobbyStateOpen/close gate of an open-lobby session. Read it with MultiplayerSession#getLobbyState; the session host changes it with MultiplayerSession#setLobbyState.