Documentation
¶
Overview ¶
Package WebSocketMultiplayerPeer provides methods for working with WebSocketMultiplayerPeer object instances.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- func (self *Extension[T]) AsMultiplayerPeer() MultiplayerPeer.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsPacketPeer() PacketPeer.Instance
- func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
- func (self *Extension[T]) AsWebSocketMultiplayerPeer() Instance
- type ID
- 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) WebSocketPeer.Instance
- 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) ID() ID
- 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) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOutboundBufferSize(value int)
- func (self Instance) SetSupportedProtocols(value []string)
- func (self Instance) SupportedProtocols() []string
- 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 Expanded ¶
type Expanded [1]gdclass.WebSocketMultiplayerPeer
func (Expanded) CreateClient ¶
func (self Expanded) CreateClient(url string, tls_client_options TLSOptions.Instance) error
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 (Expanded) CreateServer ¶
func (self Expanded) CreateServer(port int, bind_address string, tls_server_options TLSOptions.Instance) error
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].
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsMultiplayerPeer ¶
func (self *Extension[T]) AsMultiplayerPeer() MultiplayerPeer.Instance
func (*Extension[T]) AsPacketPeer ¶
func (self *Extension[T]) AsPacketPeer() PacketPeer.Instance
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsWebSocketMultiplayerPeer ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
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) WebSocketPeer.Instance
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.