ConnectionController beta
Interface of @v12-engine/client
ts
export interface ConnectionControllerThe connection to a server, in a game (client.connection): how it is (state, the same as client.ui.connection()), and what can be done once it is lost: try again (retry), or leave (leave). A dropped connection is tried again by itself, with longer and longer waits (RETRY_WAITS), back in the same seat once it comes back; a server that says no (the game is over, the player let go) is lost at once. A game played in the page is always connected
Members
dispose
ts
dispose(): void;Stops trying: the client does, as the game goes
leave
ts
leave(): void;Out of the game, where the place it is played in has a way out (the pause menu's Leave)
retry
ts
retry(): void;Tries again now: from lost, the waits over again
state
ts
state(): ConnectionState;How the connection is now: the same as client.ui.connection()