Cgameclient

CGameClient class

A Game client instance is used to join a game room on the server

Signature:

export declare class CGameClient<S extends BaseRoomState = any, CM = any, RM = any> 

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CGameClient class.

Properties

Property

Modifiers

Type

Description

room

readonly

GameRoom<S, CM, RM>

state

readonly

any

status

readonly

ConnectionStatus

synced

readonly

boolean

Methods

Method

Modifiers

Description

join(opts)

Used to join a game room on the server Returns a GameRoom instance

leave()

onDisconnect(cb)

onMessage(cb)

onMessage(type, cb)

onState(cb)

onStatusChange(cb)

reconnect()

send(message)

send(type, data)