Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
Table of contents
-
var delta_interval: float = 0.0 -
var public_visibility: bool = true -
var replication_config: SceneReplicationConfig -
var replication_interval: float = 0.0 -
var root_path: NodePath = NodePath("..") -
var visibility_update_mode = VISIBILITY_PROCESS_IDLE -
func add_visibility_filter(filter: Callable) -> void -
const func get_visibility_for(peer: int) -> bool -
func remove_visibility_filter(filter: Callable) -> void -
func set_visibility_for(visible: bool) -> void -
func update_visibility(for_peer: int = 0) -> void -
const VISIBILITY_PROCESS_IDLE = 0 enum VisibilityUpdateMode -
const VISIBILITY_PROCESS_PHYSICS = 1 enum VisibilityUpdateMode -
const VISIBILITY_PROCESS_NONE = 2 enum VisibilityUpdateMode -
enum VisibilityUpdateMode -
signal delta_synchronized() -
signal synchronized() -
signal visibility_changed(for_peer: int)
MultiplayerSynchronizer #
is_instantiable, Node, core, not_builtin_classes
Synchronizes properties from the multiplayer authority to the remote peers.
By default, MultiplayerSynchronizer synchronizes configured properties to all peers.
Visibility can be handled directly with set_visibility_for or as-needed with add_visibility_filter and update_visibility.
MultiplayerSpawners will handle nodes according to visibility of synchronizers as long as the node at root_path was spawned by one.
Internally, MultiplayerSynchronizer uses MultiplayerAPI.object_configuration_add to notify synchronization start passing the Node at root_path as the object and itself as the configuration, and uses MultiplayerAPI.object_configuration_remove to notify synchronization end in a similar way.
Note: Synchronization is not supported for Object type properties, like Resource. Properties that are unique to each peer, like the instance IDs of Objects (see Object.get_instance_id) or RIDs, will also not work in synchronization.
Members #
var delta_interval: float = 0.0#
Time interval between delta synchronizations. Used when the replication is set to SceneReplicationConfig.REPLICATION_MODE_ON_CHANGE. If set to 0.0 (the default), delta synchronizations happen every network process frame.
var public_visibility: bool = true#
Whether synchronization should be visible to all peers by default. See set_visibility_for and add_visibility_filter for ways of configuring fine-grained visibility options.
var replication_config: SceneReplicationConfig#
Resource containing which properties to synchronize.
var replication_interval: float = 0.0#
Time interval between synchronizations. Used when the replication is set to SceneReplicationConfig.REPLICATION_MODE_ALWAYS. If set to 0.0 (the default), synchronizations happen every network process frame.
var root_path: NodePath = NodePath("..")#
Node path that replicated properties are relative to.
If root_path was spawned by a MultiplayerSpawner, the node will be also be spawned and despawned based on this synchronizer visibility options.
var visibility_update_mode = VISIBILITY_PROCESS_IDLE#
Specifies when visibility filters are updated (see VisibilityUpdateMode for options).
Methods #
func add_visibility_filter(filter: Callable) -> void#
Adds a peer visibility filter for this synchronizer.
const func get_visibility_for(peer: int) -> bool#
Queries the current visibility for peer peer.
func remove_visibility_filter(filter: Callable) -> void#
Removes a peer visibility filter from this synchronizer.
func set_visibility_for(visible: bool) -> void#
Sets the visibility of peer to visible. If peer is 0, the value of public_visibility will be updated instead.
func update_visibility(for_peer: int = 0) -> void#
Updates the visibility of for_peer according to visibility filters. If for_peer is 0 (the default), all peers' visibilties are updated.
Annotations #
Constants #
const VISIBILITY_PROCESS_IDLE = 0 enum VisibilityUpdateMode#
Visibility filters are updated during process frames (see Node.NOTIFICATION_INTERNAL_PROCESS).
const VISIBILITY_PROCESS_PHYSICS = 1 enum VisibilityUpdateMode#
Visibility filters are updated during physics frames (see Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS).
const VISIBILITY_PROCESS_NONE = 2 enum VisibilityUpdateMode#
Visibility filters are not updated automatically, and must be updated manually by calling update_visibility.
Constructors #
Enums #
VisibilityUpdateMode#
enum VisibilityUpdateMode {
VISIBILITY_PROCESS_IDLE = 0,
VISIBILITY_PROCESS_PHYSICS = 1,
VISIBILITY_PROCESS_NONE = 2,
} Operators #
Signals #
signal delta_synchronized()#
Emitted when a new delta synchronization state is received by this synchronizer after the properties have been updated.
signal synchronized()#
Emitted when a new synchronization state is received by this synchronizer after the properties have been updated.
signal visibility_changed(for_peer: int)#
Emitted when visibility of for_peer is updated. See update_visibility.