reckfellENGINE

MultiplayerSynchronizer

Synchronizes properties from the multiplayer authority to the remote peers.

On this page
class MultiplayerSynchronizerReckfellSharpInherits Entity

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 MultiplayerSynchronizer.SetVisibilityFor or as-needed with MultiplayerSynchronizer.AddVisibilityFilter and MultiplayerSynchronizer.UpdateVisibility. MultiplayerSpawners will handle nodes according to visibility of synchronizers as long as the node at MultiplayerSynchronizer.RootPath was spawned by one. Internally, MultiplayerSynchronizer uses MultiplayerApi.ObjectConfigurationAdd to notify synchronization start passing the Entity at MultiplayerSynchronizer.RootPath as the object and itself as the configuration, and uses MultiplayerApi.ObjectConfigurationRemove to notify synchronization end in a similar way. Note: Synchronization is not supported for ReckfellObject type properties, like Resource. Properties that are unique to each peer, like the instance IDs of ReckfellObjects (see ReckfellObject.GetInstanceId) or Rids, will also not work in synchronization.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

MultiplayerSynchronizerConstructor
# MultiplayerSynchronizer
C#
public MultiplayerSynchronizer();

Properties6

DeltaIntervalProperty
# DeltaInterval
C#
public double DeltaInterval { get; set; }

Time interval between delta synchronizations. Used when the replication is set to SceneReplicationConfig.ReplicationMode.OnChange. If set to 0.0 (the default), delta synchronizations happen every network process frame.

PublicVisibilityProperty
# PublicVisibility
C#
public bool PublicVisibility { get; set; }

Whether synchronization should be visible to all peers by default. See MultiplayerSynchronizer.SetVisibilityFor and MultiplayerSynchronizer.AddVisibilityFilter for ways of configuring fine-grained visibility options.

ReplicationConfigProperty
# ReplicationConfig
C#
public SceneReplicationConfig ReplicationConfig { get; set; }

Resource containing which properties to synchronize.

ReplicationIntervalProperty
# ReplicationInterval
C#
public double ReplicationInterval { get; set; }

Time interval between synchronizations. Used when the replication is set to SceneReplicationConfig.ReplicationMode.Always. If set to 0.0 (the default), synchronizations happen every network process frame.

RootPathProperty
# RootPath
C#
public EntityPath RootPath { get; set; }

Entity path that replicated properties are relative to. If MultiplayerSynchronizer.RootPath was spawned by a MultiplayerSpawner, the node will be also be spawned and despawned based on this synchronizer visibility options.

VisibilityUpdateModeProperty
# VisibilityUpdateMode
C#
public MultiplayerSynchronizer.VisibilityUpdateModeEnum VisibilityUpdateMode { get; set; }

Specifies when visibility filters are updated.

Methods17

AddVisibilityFiltervoid
# AddVisibilityFilter
C#
public void AddVisibilityFilter(Callable filter);

Adds a peer visibility filter for this synchronizer. filter should take a peer ID [int] and return a [bool].

Parameters
NameTypeDefault
filterCallable—
GetDeltaIntervaldouble
# GetDeltaInterval
C#
public double GetDeltaInterval();
Returns double
GetReplicationConfigSceneReplicationConfig
# GetReplicationConfig
C#
public SceneReplicationConfig GetReplicationConfig();
Returns SceneReplicationConfig
GetReplicationIntervaldouble
# GetReplicationInterval
C#
public double GetReplicationInterval();
Returns double
GetRootPathEntityPath
# GetRootPath
C#
public EntityPath GetRootPath();
Returns EntityPath
GetVisibilityForbool
# GetVisibilityFor
C#
public bool GetVisibilityFor(int peer);

Queries the current visibility for peer peer.

Parameters
NameTypeDefault
peerint—
Returns bool
GetVisibilityUpdateModeMultiplayerSynchronizer.VisibilityUpdateModeEnum
# GetVisibilityUpdateMode
C#
public MultiplayerSynchronizer.VisibilityUpdateModeEnum GetVisibilityUpdateMode();
Returns MultiplayerSynchronizer.VisibilityUpdateModeEnum
IsVisibilityPublicbool
# IsVisibilityPublic
C#
public bool IsVisibilityPublic();
Returns bool
RemoveVisibilityFiltervoid
# RemoveVisibilityFilter
C#
public void RemoveVisibilityFilter(Callable filter);

Removes a peer visibility filter from this synchronizer.

Parameters
NameTypeDefault
filterCallable—
SetDeltaIntervalvoid
# SetDeltaInterval
C#
public void SetDeltaInterval(double milliseconds);
Parameters
NameTypeDefault
millisecondsdouble—
SetReplicationConfigvoid
# SetReplicationConfig
C#
public void SetReplicationConfig(SceneReplicationConfig config);
Parameters
NameTypeDefault
configSceneReplicationConfig—
SetReplicationIntervalvoid
# SetReplicationInterval
C#
public void SetReplicationInterval(double milliseconds);
Parameters
NameTypeDefault
millisecondsdouble—
SetRootPathvoid
# SetRootPath
C#
public void SetRootPath(EntityPath path);
Parameters
NameTypeDefault
pathEntityPath—
SetVisibilityForvoid
# SetVisibilityFor
C#
public void SetVisibilityFor(int peer, bool visible);

Sets the visibility of peer to visible. If peer is 0, the value of MultiplayerSynchronizer.PublicVisibility will be updated instead.

Parameters
NameTypeDefault
peerint—
visiblebool—
SetVisibilityPublicvoid
# SetVisibilityPublic
C#
public void SetVisibilityPublic(bool visible);
Parameters
NameTypeDefault
visiblebool—
SetVisibilityUpdateModevoid
# SetVisibilityUpdateMode
C#
public void SetVisibilityUpdateMode(MultiplayerSynchronizer.VisibilityUpdateModeEnum mode);
Parameters
NameTypeDefault
modeMultiplayerSynchronizer.VisibilityUpdateModeEnum—
UpdateVisibilityvoid
# UpdateVisibility
C#
public void UpdateVisibility(int forPeer = 0);

Updates the visibility of for_peer according to visibility filters. If for_peer is 0 (the default), all peers' visibilties are updated.

Parameters
NameTypeDefault
forPeerint0

Signals and events3

DeltaSynchronizedEvent
# DeltaSynchronized
C#
public event Action DeltaSynchronized;

Emitted when a new delta synchronization state is received by this synchronizer after the properties have been updated.

SynchronizedEvent
# Synchronized
C#
public event Action Synchronized;

Emitted when a new synchronization state is received by this synchronizer after the properties have been updated.

VisibilityChangedEvent
# VisibilityChanged
C#
public event MultiplayerSynchronizer.VisibilityChangedEventHandler VisibilityChanged;

Emitted when visibility of for_peer is updated. See MultiplayerSynchronizer.UpdateVisibility.

Handler parameters
NameTypeDefault
forPeerlong—

MultiplayerSynchronizer.VisibilityUpdateModeEnum

ValueDescription
Idle = 0

Visibility filters are updated during process frames (see Entity.NotificationInternalProcess).

None = 2

Visibility filters are not updated automatically, and must be updated manually by calling MultiplayerSynchronizer.UpdateVisibility.

Physics = 1

Visibility filters are updated during physics frames (see Entity.NotificationInternalPhysicsProcess).

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.