Documentation ¶
Overview ¶
Package MultiplayerSynchronizer provides methods for working with MultiplayerSynchronizer object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AddVisibilityFilter(filter func(peer_id int) bool)
- func (self Instance) AsMultiplayerSynchronizer() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) DeltaInterval() Float.X
- func (self Instance) GetVisibilityFor(peer int) bool
- func (self Instance) OnDeltaSynchronized(cb func())
- func (self Instance) OnSynchronized(cb func())
- func (self Instance) OnVisibilityChanged(cb func(for_peer int))
- func (self Instance) PublicVisibility() bool
- func (self Instance) RemoveVisibilityFilter(filter Callable.Function)
- func (self Instance) ReplicationConfig() [1]gdclass.SceneReplicationConfig
- func (self Instance) ReplicationInterval() Float.X
- func (self Instance) RootPath() string
- func (self Instance) SetDeltaInterval(value Float.X)
- func (self Instance) SetPublicVisibility(value bool)
- func (self Instance) SetReplicationConfig(value [1]gdclass.SceneReplicationConfig)
- func (self Instance) SetReplicationInterval(value Float.X)
- func (self Instance) SetRootPath(value string)
- func (self Instance) SetVisibilityFor(peer int, visible bool)
- func (self Instance) SetVisibilityUpdateMode(value gdclass.MultiplayerSynchronizerVisibilityUpdateMode)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) UpdateVisibility()
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) VisibilityUpdateMode() gdclass.MultiplayerSynchronizerVisibilityUpdateMode
- type VisibilityUpdateMode
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 Instance ¶
type Instance [1]gdclass.MultiplayerSynchronizer
By default, [MultiplayerSynchronizer] synchronizes configured properties to all peers. Visibility can be handled directly with [method set_visibility_for] or as-needed with [method add_visibility_filter] and [method update_visibility]. [MultiplayerSpawner]s will handle nodes according to visibility of synchronizers as long as the node at [member root_path] was spawned by one. Internally, [MultiplayerSynchronizer] uses [method MultiplayerAPI.object_configuration_add] to notify synchronization start passing the [Node] at [member root_path] as the [code]object[/code] and itself as the [code]configuration[/code], and uses [method MultiplayerAPI.object_configuration_remove] to notify synchronization end in a similar way. [b]Note:[/b] Synchronization is not supported for [Object] type properties, like [Resource]. Properties that are unique to each peer, like the instance IDs of [Object]s (see [method Object.get_instance_id]) or [RID]s, will also not work in synchronization.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddVisibilityFilter ¶
Adds a peer visibility filter for this synchronizer. [param filter] should take a peer ID [int] and return a [bool].
func (Instance) AsMultiplayerSynchronizer ¶
func (Instance) DeltaInterval ¶
func (Instance) GetVisibilityFor ¶
Queries the current visibility for peer [param peer].
func (Instance) OnDeltaSynchronized ¶
func (self Instance) OnDeltaSynchronized(cb func())
func (Instance) OnSynchronized ¶
func (self Instance) OnSynchronized(cb func())
func (Instance) OnVisibilityChanged ¶
func (Instance) PublicVisibility ¶
func (Instance) RemoveVisibilityFilter ¶
Removes a peer visibility filter from this synchronizer.
func (Instance) ReplicationConfig ¶
func (self Instance) ReplicationConfig() [1]gdclass.SceneReplicationConfig
func (Instance) ReplicationInterval ¶
func (Instance) SetDeltaInterval ¶
func (Instance) SetPublicVisibility ¶
func (Instance) SetReplicationConfig ¶
func (self Instance) SetReplicationConfig(value [1]gdclass.SceneReplicationConfig)
func (Instance) SetReplicationInterval ¶
func (Instance) SetRootPath ¶
func (Instance) SetVisibilityFor ¶
Sets the visibility of [param peer] to [param visible]. If [param peer] is [code]0[/code], the value of [member public_visibility] will be updated instead.
func (Instance) SetVisibilityUpdateMode ¶
func (self Instance) SetVisibilityUpdateMode(value gdclass.MultiplayerSynchronizerVisibilityUpdateMode)
func (*Instance) UnsafePointer ¶
func (Instance) UpdateVisibility ¶
func (self Instance) UpdateVisibility()
Updates the visibility of [param for_peer] according to visibility filters. If [param for_peer] is [code]0[/code] (the default), all peers' visibilties are updated.
func (Instance) VisibilityUpdateMode ¶
func (self Instance) VisibilityUpdateMode() gdclass.MultiplayerSynchronizerVisibilityUpdateMode
type VisibilityUpdateMode ¶
type VisibilityUpdateMode = gdclass.MultiplayerSynchronizerVisibilityUpdateMode //gd:MultiplayerSynchronizer.VisibilityUpdateMode
const ( /*Visibility filters are updated during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]).*/ VisibilityProcessIdle VisibilityUpdateMode = 0 /*Visibility filters are updated during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]).*/ VisibilityProcessPhysics VisibilityUpdateMode = 1 /*Visibility filters are not updated automatically, and must be updated manually by calling [method update_visibility].*/ VisibilityProcessNone VisibilityUpdateMode = 2 )