Documentation
¶
Overview ¶
Package SceneMultiplayer provides methods for working with SceneMultiplayer object instances.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AllowObjectDecoding() bool
- func (self Instance) AsMultiplayerAPI() MultiplayerAPI.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsSceneMultiplayer() Instance
- func (self Instance) AuthCallback() Callable.Function
- func (self Instance) AuthTimeout() Float.X
- func (self Instance) Clear()
- func (self Instance) CompleteAuth(id int) error
- func (self Instance) DisconnectPeer(id int)
- func (self Instance) GetAuthenticatingPeers() []int32
- func (self Instance) ID() ID
- func (self Instance) MaxDeltaPacketSize() int
- func (self Instance) MaxSyncPacketSize() int
- func (self Instance) OnPeerAuthenticating(cb func(id int), flags ...Signal.Flags)
- func (self Instance) OnPeerAuthenticationFailed(cb func(id int), flags ...Signal.Flags)
- func (self Instance) OnPeerPacket(cb func(id int, packet []byte), flags ...Signal.Flags)
- func (self Instance) RefuseNewConnections() bool
- func (self Instance) RootPath() string
- func (self Instance) SendAuth(id int, data []byte) error
- func (self Instance) SendBytes(bytes []byte) error
- func (self Instance) ServerRelay() bool
- func (self Instance) SetAllowObjectDecoding(value bool)
- func (self Instance) SetAuthCallback(value Callable.Function)
- func (self Instance) SetAuthTimeout(value Float.X)
- func (self Instance) SetMaxDeltaPacketSize(value int)
- func (self Instance) SetMaxSyncPacketSize(value int)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRefuseNewConnections(value bool)
- func (self Instance) SetRootPath(value string)
- func (self Instance) SetServerRelay(value bool)
- 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.SceneMultiplayer
func (Expanded) SendBytes ¶
func (self Expanded) SendBytes(bytes []byte, id int, mode MultiplayerPeer.TransferMode, channel int) error
Sends the given raw [param bytes] to a specific peer identified by [param id] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers.
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]) AsMultiplayerAPI ¶
func (self *Extension[T]) AsMultiplayerAPI() MultiplayerAPI.Instance
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsSceneMultiplayer ¶
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.SceneMultiplayer
This class is the default implementation of [MultiplayerAPI], used to provide multiplayer functionalities in Godot Engine. This implementation supports RPCs via [method Node.rpc] and [method Node.rpc_id] and requires [method MultiplayerAPI.rpc] to be passed a [Node] (it will fail for other object types). This implementation additionally provide [SceneTree] replication via the [MultiplayerSpawner] and [MultiplayerSynchronizer] nodes, and the [SceneReplicationConfig] resource. [b]Note:[/b] The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. [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) AllowObjectDecoding ¶
func (Instance) AsMultiplayerAPI ¶
func (self Instance) AsMultiplayerAPI() MultiplayerAPI.Instance
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsSceneMultiplayer ¶
func (Instance) AuthCallback ¶
func (Instance) AuthTimeout ¶
func (Instance) Clear ¶
func (self Instance) Clear()
Clears the current SceneMultiplayer network state (you shouldn't call this unless you know what you are doing).
func (Instance) CompleteAuth ¶
Mark the authentication step as completed for the remote peer identified by [param id]. The [signal MultiplayerAPI.peer_connected] signal will be emitted for this peer once the remote side also completes the authentication. No further authentication messages are expected to be received from this peer. If a peer disconnects before completing authentication, either due to a network issue, the [member auth_timeout] expiring, or manually calling [method disconnect_peer], the [signal peer_authentication_failed] signal will be emitted instead of [signal MultiplayerAPI.peer_disconnected].
func (Instance) DisconnectPeer ¶
Disconnects the peer identified by [param id], removing it from the list of connected peers, and closing the underlying connection with it.
func (Instance) GetAuthenticatingPeers ¶
Returns the IDs of the peers currently trying to authenticate with this [MultiplayerAPI].
func (Instance) MaxDeltaPacketSize ¶
func (Instance) MaxSyncPacketSize ¶
func (Instance) OnPeerAuthenticating ¶
func (Instance) OnPeerAuthenticationFailed ¶
func (Instance) OnPeerPacket ¶
func (Instance) RefuseNewConnections ¶
func (Instance) SendAuth ¶
Sends the specified [param data] to the remote peer identified by [param id] as part of an authentication message. This can be used to authenticate peers, and control when [signal MultiplayerAPI.peer_connected] is emitted (and the remote peer accepted as one of the connected peers).
func (Instance) SendBytes ¶
Sends the given raw [param bytes] to a specific peer identified by [param id] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers.