WebSocketMultiplayerPeer
Base class for WebSocket server and client.
class WebSocketMultiplayerPeerBase class for WebSocket server and client, allowing them to be used as multiplayer peer for the MultiplayerAPI.
Base class for WebSocket server and client.
class WebSocketMultiplayerPeerBase class for WebSocket server and client, allowing them to be used as multiplayer peer for the MultiplayerAPI.
import SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class MultiplayerAPIHigh-level multiplayer API interface.
class MultiplayerPeerAbstract class for specialized PacketPeers used by the MultiplayerAPI.
protocol CustomStringConvertibleA type with a customized textual representation.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA 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 : VariantStorableTypes 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 VariantStorableTypes that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
override class var godotClassName: StringName { get }final var handshakeHeaders: PackedStringArray { get set }The extra headers to use during handshake. See handshakeHeaders for more details.
final var handshakeTimeout: Double { get set }The maximum time each peer can stay in a connecting state before being dropped.
final var inboundBufferSize: Int32 { get set }The inbound buffer size for connected peers. See inboundBufferSize for more details.
final var maxQueuedPackets: Int32 { get set }The maximum number of queued packets for connected peers. See maxQueuedPackets for more details.
final var outboundBufferSize: Int32 { get set }The outbound buffer size for connected peers. See outboundBufferSize for more details.
final var supportedProtocols: PackedStringArray { get set }The supported WebSocket sub-protocols. See supportedProtocols for more details.
final func createClient(url: String, tlsClientOptions: TLSOptions? = nil) -> GodotError Starts a new multiplayer client connecting to the given url. TLS certificates will be verified against the hostname when connecting using the wss:// protocol. You can pass the optional tlsClientOptions parameter to customize the trusted certification authorities, or disable the common name verification. See client(trustedChain:commonNameOverride:) and clientUnsafe(trustedChain:).
final func createServer(port: Int32, bindAddress: String = "*", tlsServerOptions: TLSOptions? = nil) -> GodotError Starts a new multiplayer server listening on the given port. You can optionally specify a bindAddress, and provide valid tlsServerOptions to use TLS. See server(key:certificate:).
final func getPeer(peerId: Int32) -> WebSocketPeer? Returns the WebSocketPeer associated to the given peerId.
final func getPeerAddress(id: Int32) -> String Returns the IP address of the given peer.
final func getPeerPort(id: Int32) -> Int32 Returns the remote port of the given peer.