WebSocketMultiplayerPeer

package
v0.0.0-...-5fa07e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package WebSocketMultiplayerPeer provides methods for working with WebSocketMultiplayerPeer object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsWebSocketMultiplayerPeer() Instance
}

type Instance

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 New

func New() Instance

func (Instance) AsMultiplayerPeer

func (self Instance) AsMultiplayerPeer() MultiplayerPeer.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsPacketPeer

func (self Instance) AsPacketPeer() PacketPeer.Instance

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsWebSocketMultiplayerPeer

func (self Instance) AsWebSocketMultiplayerPeer() Instance

func (Instance) CreateClient

func (self Instance) CreateClient(url string) 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 (Instance) CreateServer

func (self Instance) CreateServer(port int) 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].

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

func (self Instance) GetPeerAddress(id int) string

Returns the IP address of the given peer.

func (Instance) GetPeerPort

func (self Instance) GetPeerPort(id int) int

Returns the remote port of the given peer.

func (Instance) HandshakeHeaders

func (self Instance) HandshakeHeaders() []string

func (Instance) HandshakeTimeout

func (self Instance) HandshakeTimeout() Float.X

func (Instance) InboundBufferSize

func (self Instance) InboundBufferSize() int

func (Instance) MaxQueuedPackets

func (self Instance) MaxQueuedPackets() int

func (Instance) OutboundBufferSize

func (self Instance) OutboundBufferSize() int

func (Instance) SetHandshakeHeaders

func (self Instance) SetHandshakeHeaders(value []string)

func (Instance) SetHandshakeTimeout

func (self Instance) SetHandshakeTimeout(value Float.X)

func (Instance) SetInboundBufferSize

func (self Instance) SetInboundBufferSize(value int)

func (Instance) SetMaxQueuedPackets

func (self Instance) SetMaxQueuedPackets(value int)

func (Instance) SetOutboundBufferSize

func (self Instance) SetOutboundBufferSize(value int)

func (Instance) SetSupportedProtocols

func (self Instance) SetSupportedProtocols(value []string)

func (Instance) SupportedProtocols

func (self Instance) SupportedProtocols() []string

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL