Documentation
¶
Overview ¶
Package WebSocketMultiplayerPeer provides methods for working with WebSocketMultiplayerPeer object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AsMultiplayerPeer() MultiplayerPeer.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsPacketPeer() PacketPeer.Instance
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsWebSocketMultiplayerPeer() Instance
- func (self Instance) CreateClient(url string) error
- func (self Instance) CreateServer(port int) error
- func (self Instance) GetPeer(peer_id int) [1]gdclass.WebSocketPeer
- func (self Instance) GetPeerAddress(id int) string
- func (self Instance) GetPeerPort(id int) int
- func (self Instance) HandshakeHeaders() []string
- func (self Instance) HandshakeTimeout() Float.X
- func (self Instance) InboundBufferSize() int
- func (self Instance) MaxQueuedPackets() int
- func (self Instance) OutboundBufferSize() int
- func (self Instance) SetHandshakeHeaders(value []string)
- func (self Instance) SetHandshakeTimeout(value Float.X)
- func (self Instance) SetInboundBufferSize(value int)
- func (self Instance) SetMaxQueuedPackets(value int)
- func (self Instance) SetOutboundBufferSize(value int)
- func (self Instance) SetSupportedProtocols(value []string)
- func (self Instance) SupportedProtocols() []string
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Instance ¶
type Instance [1]gdclass.WebSocketMultiplayerPeer
Base class for WebSocket server and client, allowing them to be used as multiplayer peer for the [MultiplayerAPI]. [b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] 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.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsMultiplayerPeer ¶
func (self Instance) AsMultiplayerPeer() MultiplayerPeer.Instance
func (Instance) AsPacketPeer ¶
func (self Instance) AsPacketPeer() PacketPeer.Instance
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsWebSocketMultiplayerPeer ¶
func (Instance) CreateClient ¶
Starts a new multiplayer client connecting to the given [param url]. TLS certificates will be verified against the hostname when connecting using the [code]wss://[/code] protocol. You can pass the optional [param tls_client_options] parameter to customize the trusted certification authorities, or disable the common name verification. See [method TLSOptions.client] and [method TLSOptions.client_unsafe]. [b]Note:[/b] It is recommended to specify the scheme part of the URL, i.e. the [param url] should start with either [code]ws://[/code] or [code]wss://[/code].
func (Instance) CreateServer ¶
Starts a new multiplayer server listening on the given [param port]. You can optionally specify a [param bind_address], and provide valid [param tls_server_options] to use TLS. See [method TLSOptions.server].
func (Instance) GetPeer ¶
func (self Instance) GetPeer(peer_id int) [1]gdclass.WebSocketPeer
Returns the [WebSocketPeer] associated to the given [param peer_id].
func (Instance) GetPeerAddress ¶
Returns the IP address of the given peer.
func (Instance) GetPeerPort ¶
Returns the remote port of the given peer.