Attention: Here be dragons
This is the
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
You can add each WebRTCPeerConnection via add_peer or remove them via remove_peer. Peers must be added in WebRTCPeerConnection.STATE_NEW state to allow it to create the appropriate channels. This class will not create offers nor set descriptions, it will only poll them, and notify connections and disconnections.
When creating the peer via create_client or create_server the MultiplayerPeer.is_server_relay_supported method will return
true enabling peer exchange and packet relaying when supported by the MultiplayerAPI implementation.
Note: When exporting to Android, make sure to enable the
INTERNET permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.
get_peers ( )
Three channels will be created for reliable, unreliable, and ordered transport. The value of
unreliable_lifetime will be passed to the
"maxPacketLifetime" option when creating unreliable and ordered channels (see WebRTCPeerConnection.create_data_channel).
Initialize the multiplayer peer as a client with the given
peer_id (must be between 2 and 2147483647). In this mode, you should only call add_peer once and with
1. This mode enables MultiplayerPeer.is_server_relay_supported, allowing the upper MultiplayerAPI layer to perform peer exchange and packet relaying.