res://addons/w4gd/matchmaker/webrtc_manager.gd

Inherits: RefCounted

Manages WebRTC connections for WebRTC lobbies.

Properties

Array

ice_servers

WebRTCMultiplayerPeer

webrtc_multiplayer_peer

Methods

bool

are_peers_ready ( )

int

get_peer_count ( )

int

get_peer_id_for_player ( String player_id )

String

get_player_id_for_peer ( int peer_id )

void

poll ( )

res://addons/w4gd/rest-client/client_request.gd

refresh_sessions ( )

void

reset ( )

void

subscribe ( )

void

unsubscribe ( )


Signals

mesh_created ( Variant multiplayer_peer )

Emitted when the WebRTC mesh is created.


peers_not_ready ( )

Emitted when one or more of the WebRTC peers is no longer connected, or a new peer has joined that we haven't connected to yet.


peers_ready ( )

Emitted when connections to all WebRTC peers have been established.


Property Descriptions

Array ice_servers

The ICE servers used to help the peers connect.


WebRTCMultiplayerPeer webrtc_multiplayer_peer

The multiplayer peer that was created for this lobby.


Method Descriptions

bool are_peers_ready ( )

Returns true if all peers are ready; otherwise, false.


int get_peer_count ( )

Gets the number of peers.


int get_peer_id_for_player ( String player_id )

Gets the peer id of the player for the given player UUID.


String get_player_id_for_peer ( int peer_id )

Gets the UUID of the player in the database for the given peer id.


void poll ( )

Rechecks if the peers are all ready and emits the peers_ready or peers_not_ready signal.


res://addons/w4gd/rest-client/client_request.gd refresh_sessions ( )

Refreshes the WebRTC sessions based on the sessions in the database.


void reset ( )

Resets the WebRTC manager, closing the multiplayer peer, and clearing all sessions.


void subscribe ( )

There is currently no description for this method.


void unsubscribe ( )

There is currently no description for this method.