Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

DEFAULT_OBJECT_MAX_SYNC_RATE: 30 = 30
disableMultiplayerForTesting: boolean = false

Set to true in testing to avoid relying on the multiplayer extension.

hostPeerId: string | null = null
playerNumber: number | null = null

Functions

  • endLobbyGame(): Promise<void>
  • endLobbyWhenHostLeaves(enable: boolean): void
  • getCurrentPlayerNumber(): number
  • getCurrentPlayerUsername(): string
  • getObjectsSynchronizationRate(): number
  • getPlayerUsername(playerNumber: number): string
  • Returns the player username at the given number in the lobby. The number is shifted by one, so that the first player has number 1.

    Parameters

    • playerNumber: number

    Returns string

  • getPlayersInLobbyCount(): number
  • handleHostDisconnected(__namedParameters: { runtimeScene: RuntimeScene }): Promise<void>
  • handleLobbyGameEnded(): void
  • hasLobbyGameJustEnded(): boolean
  • hasLobbyGameJustStarted(): boolean
  • isCurrentPlayerHost(): boolean
  • isLobbyGameRunning(): boolean
  • isMigratingHost(): boolean
  • isPlayerConnected(playerNumber: number): boolean
  • isReadyToSendOrReceiveGameUpdateMessages(): boolean
  • leaveGameLobby(): Promise<void>
  • markConnectionAsConnected(): void
  • When the first heartbeat is received, we consider the connection to the host as working, we inform the backend services that the connection is ready, so it can start the game when everyone is ready.

    Returns void

  • openLobbiesWindow(runtimeScene: RuntimeScene): Promise<void>
  • setObjectsSynchronizationRate(rate: number): void
  • shouldEndLobbyWhenHostLeaves(): boolean
  • showLobbiesCloseButton(runtimeScene: RuntimeScene, visible: boolean): void

Generated using TypeDoc