WebRTCMultiplayerPeer

    A simple interface to create a peer-to-peer mesh network composed of WebRTCPeerConnection that is compatible with the MultiplayerAPI.

    WebRTCMultiplayerPeer.swift:24
    class WebRTCMultiplayerPeer

    This class constructs a full mesh of WebRTCPeerConnection (one connection for each peer) that can be used as a multiplayerPeer.

    You can add each WebRTCPeerConnection via addPeer(_:peerId:unreliableLifetime:) or remove them via removePeer(peerId:). Peers must be added in WebRTCPeerConnection/ConnectionState/stateNew 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 createClient(peerId:channelsConfig:) or createServer(channelsConfig:) the isServerRelaySupported method will return true enabling peer exchange and packet relaying when supported by the MultiplayerAPI implementation.

    Superclasses

    Citizens in SwiftGodot

    Conformances

    • protocol CustomStringConvertible

      A type with a customized textual representation.

    • protocol Equatable

      A type that can be compared for value equality.

    • protocol Hashable

      A type that can be hashed into a Hasher to produce an integer hash value.

    • protocol Identifiable<ID>

      A class of types whose instances hold the value of an entity with stable identity.

    • protocol VariantRepresentable

      Types that conform to VariantRepresentable can be stored directly in Variant with no conversion. These include all of the Variant types from Godot (for example GString, Rect, Plane), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.

    • protocol VariantStorable

      Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.

    Type members

    Instance members