Repository navigation
SceneMultiplayer
Home | API by Category | Complete API Index | API Status
| Field | Value |
|---|---|
| Full name | Electron2D.SceneMultiplayer |
| Namespace | Electron2D |
| Kind | class |
| Category | API Networking |
Polls scene peers, typed RPCs, spawning/property replication, authentication and custom packets with server relay.
public class Electron2D.SceneMultiplayerThe transport remains caller-owned. Packet/authentication spans are borrowed during callbacks. Root paths locate nodes; immutable typed RPC tokens replace reflection. Preparation/path discovery allocates, while repeated ready span/message processing reuses bounded buffers. Calls/disposal require the owner thread.
Inherits: MultiplayerAPI
Kind: constructor
public SceneMultiplayer()Creates a scene interface with local offline authority.
Kind: event
public event System.Action<System.Int32> PeerAuthenticatingOccurs before admission when a direct peer begins authentication.
Kind: event
public event System.Action<System.Int32> PeerAuthenticationFailedOccurs after a pending peer fails/disconnects/expires.
Kind: event
public event Electron2D.MultiplayerPacketHandler PeerPacketDelivers custom bytes with original sender identity; storage is borrowed only during the callback.
Kind: method
public System.Void Clear()Clears admitted/pending/path state without closing the borrowed transport.
Kind: method
public System.Void CompleteAuth(System.Int32 id)Commits local authentication and sends its completion; admission waits for remote completion.
-
id: Pending direct identity.
Kind: method
public System.Void DisconnectPeer(System.Int32 id)Removes a direct peer and closes its connection, suppressing this interface's local removal event.
-
id: Direct remote identity; relayed client peers cannot be closed by another client.
Kind: method
protected override System.Void Dispose(System.Boolean disposing)Kind: method
public System.Int32[] GetAuthenticatingPeers()Returns a caller-owned snapshot of direct peers awaiting bilateral authentication.
Pending identities, without admitted peers.
Kind: method
public override System.Int32[] GetPeers()Kind: method
protected override System.Collections.Generic.IEnumerable<Electron2D.PropertyDescriptor> GetPropertyDescriptors()Kind: method
public override System.Int32 GetRemoteSenderID()Kind: method
public override System.Int32 GetUniqueID()Kind: method
public override System.Void ObjectConfigurationAdd(Electron2D.Node node, Electron2D.MultiplayerSpawner spawner)Kind: method
public override System.Void ObjectConfigurationAdd(Electron2D.Node node, Electron2D.MultiplayerSynchronizer synchronizer)Kind: method
public override System.Void ObjectConfigurationAdd(System.String rootPath)Kind: method
public override System.Void ObjectConfigurationRemove(Electron2D.Node node, Electron2D.MultiplayerSpawner spawner)Kind: method
public override System.Void ObjectConfigurationRemove(Electron2D.Node node, Electron2D.MultiplayerSynchronizer synchronizer)Kind: method
public override System.Void ObjectConfigurationRemove(System.String rootPath)Kind: method
public override System.Void Poll()Kind: method
public override System.Void RPC<TNode, T>(System.Int32 peer, TNode node, RPCMethod<TNode, T> method, T arguments)Kind: method
public System.Void SendAuth(System.Int32 id, System.ReadOnlySpan<System.Byte> data)Sends nonempty authentication bytes before either participant completes authentication.
-
id: Pending direct remote identity. -
data: Borrowed nonempty bytes.
Kind: method
public System.Void SendBytes(System.ReadOnlySpan<System.Byte> bytes, System.Int32 id = 0, Electron2D.TransferMode mode = Reliable, System.Int32 channel = 0)Sends nonempty custom bytes to admitted peers.
-
bytes: Borrowed payload. -
id: Zero broadcasts, positive targets, negative excludes. -
mode: Requested transport mode. -
channel: Nonnegative channel.
Kind: method
protected override System.Void ValidateDisposal()Kind: property
public Electron2D.MultiplayerPacketHandler AuthCallback { get; set; }Gets or sets a borrowed authentication-data callback; null automatically admits new peers.
Changes apply to new authentication sessions; pending sessions retain the current callback.
Kind: property
public System.Double AuthTimeout { get; set; }Gets or sets the monotonic authentication deadline in seconds.
3 initially; finite nonnegative, zero disables expiration.
Kind: property
public System.Int32 MaxDeltaPacketSize { get; set; }Gets or sets the maximum whole encoded change-only synchronization packet size.
65535 initially; at least 128 bytes. Complete synchronizer groups are batched without splitting their properties.
Kind: property
public System.Int32 MaxPacketBytes { get; set; }Gets or sets the complete encoded message budget prepared on transport assignment.
65536 initially; 64 through 64 MiB. Change while no live network transport is configured.
Kind: property
public System.Int32 MaxSyncPacketSize { get; set; }Gets or sets the maximum whole encoded periodic synchronization packet size.
1350 initially; at least 128 bytes, bounded by 64 MiB and actual prepared/transport capacity.
Kind: property
public Electron2D.MultiplayerPeer MultiplayerPeer { get; set; }Gets or replaces a borrowed connecting/connected transport; replacement clears network/path state.
-
T:System.InvalidOperationException: A disconnected or disposed peer is supplied.
Kind: property
public System.Boolean RefuseNewConnections { get; set; }Gets or sets admission policy on the configured transport.
False without a peer; setting without a peer fails.
Kind: property
public System.String RootPath { get; set; }Gets or sets the absolute scene root used by relative node RPC paths.
Empty until SceneTree assignment. Changing it invalidates prepared path discovery.
Kind: property
public System.Boolean ServerRelay { get; set; }Gets or sets whether supported transports notify clients and relay messages through the server.
True initially; changing live topology is caller-controlled.