SceneMultiplayer

package
v0.0.0-...-ae8aae0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package SceneMultiplayer provides methods for working with SceneMultiplayer 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
	AsSceneMultiplayer() Instance
}

type Error

type Error = gd.Error //gd:Error
const (
	/*Methods that return [enum Error] return [constant OK] when no error occurred.
	  Since [constant OK] has value 0, and all other error constants are positive integers, it can also be used in boolean checks.
	  [b]Example:[/b]
	  [codeblock]
	  var error = method_that_returns_error()
	  if error != OK:
	      printerr("Failure!")

	  # Or, alternatively:
	  if error:
	      printerr("Still failing!")
	  [/codeblock]
	  [b]Note:[/b] Many functions do not return an error code, but will print error messages to standard output.*/
	Ok Error = 0
	/*Generic error.*/
	Failed Error = 1
	/*Unavailable error.*/
	ErrUnavailable Error = 2
	/*Unconfigured error.*/
	ErrUnconfigured Error = 3
	/*Unauthorized error.*/
	ErrUnauthorized Error = 4
	/*Parameter range error.*/
	ErrParameterRangeError Error = 5
	/*Out of memory (OOM) error.*/
	ErrOutOfMemory Error = 6
	/*File: Not found error.*/
	ErrFileNotFound Error = 7
	/*File: Bad drive error.*/
	ErrFileBadDrive Error = 8
	/*File: Bad path error.*/
	ErrFileBadPath Error = 9
	/*File: No permission error.*/
	ErrFileNoPermission Error = 10
	/*File: Already in use error.*/
	ErrFileAlreadyInUse Error = 11
	/*File: Can't open error.*/
	ErrFileCantOpen Error = 12
	/*File: Can't write error.*/
	ErrFileCantWrite Error = 13
	/*File: Can't read error.*/
	ErrFileCantRead Error = 14
	/*File: Unrecognized error.*/
	ErrFileUnrecognized Error = 15
	/*File: Corrupt error.*/
	ErrFileCorrupt Error = 16
	/*File: Missing dependencies error.*/
	ErrFileMissingDependencies Error = 17
	/*File: End of file (EOF) error.*/
	ErrFileEof Error = 18
	/*Can't open error.*/
	ErrCantOpen Error = 19
	/*Can't create error.*/
	ErrCantCreate Error = 20
	/*Query failed error.*/
	ErrQueryFailed Error = 21
	/*Already in use error.*/
	ErrAlreadyInUse Error = 22
	/*Locked error.*/
	ErrLocked Error = 23
	/*Timeout error.*/
	ErrTimeout Error = 24
	/*Can't connect error.*/
	ErrCantConnect Error = 25
	/*Can't resolve error.*/
	ErrCantResolve Error = 26
	/*Connection error.*/
	ErrConnectionError Error = 27
	/*Can't acquire resource error.*/
	ErrCantAcquireResource Error = 28
	/*Can't fork process error.*/
	ErrCantFork Error = 29
	/*Invalid data error.*/
	ErrInvalidData Error = 30
	/*Invalid parameter error.*/
	ErrInvalidParameter Error = 31
	/*Already exists error.*/
	ErrAlreadyExists Error = 32
	/*Does not exist error.*/
	ErrDoesNotExist Error = 33
	/*Database: Read error.*/
	ErrDatabaseCantRead Error = 34
	/*Database: Write error.*/
	ErrDatabaseCantWrite Error = 35
	/*Compilation failed error.*/
	ErrCompilationFailed Error = 36
	/*Method not found error.*/
	ErrMethodNotFound Error = 37
	/*Linking failed error.*/
	ErrLinkFailed Error = 38
	/*Script failed error.*/
	ErrScriptFailed Error = 39
	/*Cycling link (import cycle) error.*/
	ErrCyclicLink Error = 40
	/*Invalid declaration error.*/
	ErrInvalidDeclaration Error = 41
	/*Duplicate symbol error.*/
	ErrDuplicateSymbol Error = 42
	/*Parse error.*/
	ErrParseError Error = 43
	/*Busy error.*/
	ErrBusy Error = 44
	/*Skip error.*/
	ErrSkip Error = 45
	/*Help error. Used internally when passing [code]--version[/code] or [code]--help[/code] as executable options.*/
	ErrHelp Error = 46
	/*Bug error, caused by an implementation issue in the method.
	  [b]Note:[/b] If a built-in method returns this code, please open an issue on [url=https://github.com/godotengine/godot/issues]the GitHub Issue Tracker[/url].*/
	ErrBug Error = 47
	/*Printer on fire error (This is an easter egg, no built-in methods return this error code).*/
	ErrPrinterOnFire Error = 48
)

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 New

func New() Instance

func (Instance) AllowObjectDecoding

func (self Instance) AllowObjectDecoding() bool

func (Instance) AsMultiplayerAPI

func (self Instance) AsMultiplayerAPI() MultiplayerAPI.Instance

func (Instance) AsObject

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

func (Instance) AsRefCounted

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

func (Instance) AsSceneMultiplayer

func (self Instance) AsSceneMultiplayer() Instance

func (Instance) AuthCallback

func (self Instance) AuthCallback() Callable.Function

func (Instance) AuthTimeout

func (self Instance) AuthTimeout() Float.X

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

func (self Instance) CompleteAuth(id int) error

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

func (self Instance) DisconnectPeer(id int)

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

func (self Instance) GetAuthenticatingPeers() []int32

Returns the IDs of the peers currently trying to authenticate with this [MultiplayerAPI].

func (Instance) MaxDeltaPacketSize

func (self Instance) MaxDeltaPacketSize() int

func (Instance) MaxSyncPacketSize

func (self Instance) MaxSyncPacketSize() int

func (Instance) OnPeerAuthenticating

func (self Instance) OnPeerAuthenticating(cb func(id int))

func (Instance) OnPeerAuthenticationFailed

func (self Instance) OnPeerAuthenticationFailed(cb func(id int))

func (Instance) OnPeerPacket

func (self Instance) OnPeerPacket(cb func(id int, packet []byte))

func (Instance) RefuseNewConnections

func (self Instance) RefuseNewConnections() bool

func (Instance) RootPath

func (self Instance) RootPath() string

func (Instance) SendAuth

func (self Instance) SendAuth(id int, data []byte) error

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

func (self Instance) SendBytes(bytes []byte) 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.

func (Instance) ServerRelay

func (self Instance) ServerRelay() bool

func (Instance) SetAllowObjectDecoding

func (self Instance) SetAllowObjectDecoding(value bool)

func (Instance) SetAuthCallback

func (self Instance) SetAuthCallback(value Callable.Function)

func (Instance) SetAuthTimeout

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

func (Instance) SetMaxDeltaPacketSize

func (self Instance) SetMaxDeltaPacketSize(value int)

func (Instance) SetMaxSyncPacketSize

func (self Instance) SetMaxSyncPacketSize(value int)

func (Instance) SetRefuseNewConnections

func (self Instance) SetRefuseNewConnections(value bool)

func (Instance) SetRootPath

func (self Instance) SetRootPath(value string)

func (Instance) SetServerRelay

func (self Instance) SetServerRelay(value bool)

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