• Api Documentation
  • Manual
  • FishNet.Managing.Server
  • ServerManager
Show / Hide Table of Contents
  • FishNet
    • InstanceFinder
  • FishNet.Authenticating
    • Authenticator
  • FishNet.Broadcast
    • IBroadcast
  • FishNet.Broadcast.Helping
    • BroadcastHandlerBase
  • FishNet.CodeGenerating
    • AllowMutableSyncTypeAttribute
    • CustomComparerAttribute
    • DefaultDeltaReaderAttribute
    • DefaultDeltaWriterAttribute
    • DefaultReaderAttribute
    • DefaultWriterAttribute
    • ExcludeSerializationAttribute
    • IncludeSerializationAttribute
    • NotSerializerAttribute
    • ReadUnallocatedAttribute
    • UseGlobalCustomSerializerAttribute
  • FishNet.Component.Animating
    • NetworkAnimator
  • FishNet.Component.ColliderRollback
    • ColliderRollback
    • RollbackManager
    • RollbackPhysicsType
  • FishNet.Component.Observing
    • DistanceCondition
    • GridCondition
    • GridEntry
    • HashGrid
    • HashGrid.GridAxes
    • HostOnlyCondition
    • MatchCondition
    • MatchCondition.ConditionCollections
    • OwnerOnlyCondition
    • SceneCondition
  • FishNet.Component.Ownership
    • PredictedOwner
    • PredictedSpawn
  • FishNet.Component.Prediction
    • NetworkCollider
    • NetworkCollider2D
    • NetworkCollision
    • NetworkCollision2D
    • NetworkTrigger
    • NetworkTrigger2D
    • OfflineRigidbody
    • Rigidbody2DState
    • RigidbodyPauser
    • RigidbodyState
    • RigidbodyStateExtensions
    • RigidbodyStateSerializers
    • RigidbodyType
  • FishNet.Component.Scenes
    • DefaultScene
  • FishNet.Component.Spawning
    • PlayerSpawner
  • FishNet.Component.Transforming
    • DetachableNetworkTickSmoother
    • MonoTickSmoother
    • NetworkTickSmoother
    • NetworkTransform
    • NetworkTransform.ComponentConfigurationType
    • NetworkTransform.GoalData
    • NetworkTransform.RateData
    • NetworkTransform.SnappedAxes
    • NetworkTransform.TransformData
    • NetworkTransform.TransformData.ExtrapolateState
    • SynchronizedProperty
  • FishNet.Component.Utility
    • BandwidthDisplay
    • PingDisplay
  • FishNet.Connection
    • NetworkConnection
    • NetworkConnectionExtensions
  • FishNet.Managing
    • NetworkManager
    • NetworkManager.HostIterationOrder
    • NetworkManager.PersistenceType
    • NetworkManagerExtensions
    • RemoteTimeoutType
  • FishNet.Managing.Client
    • ClientManager
    • ClientObjects
  • FishNet.Managing.Debugging
    • DebugManager
  • FishNet.Managing.Logging
    • LevelLoggingConfiguration
    • LoggingConfiguration
    • LoggingType
  • FishNet.Managing.Object
    • DualPrefab
    • ManagedObjects
  • FishNet.Managing.Observing
    • ObserverManager
  • FishNet.Managing.Predicting
    • PredictionManager
    • PredictionManager.PostPhysicsSyncTransformDel
    • PredictionManager.PostReconcileDel
    • PredictionManager.PostReplicateReplayDel
    • PredictionManager.PrePhysicsSyncTransformDel
    • PredictionManager.PreReconcileDel
    • PredictionManager.PreReplicateReplayDel
    • PredictionManager.ReconcileDel
    • PredictionManager.ReplicateReplayDel
    • ReplicateStateOrder
  • FishNet.Managing.Scened
    • ClientPresenceChangeEventArgs
    • DefaultSceneProcessor
    • EmptyStartScenesBroadcast
    • LoadOptions
    • LoadParams
    • LoadQueueData
    • PreferredScene
    • ReplaceOption
    • SceneLoadData
    • SceneLoadEndEventArgs
    • SceneLoadPercentEventArgs
    • SceneLoadStartEventArgs
    • SceneLookupData
    • SceneManager
    • SceneProcessorBase
    • SceneScopeType
    • SceneUnloadData
    • SceneUnloadEndEventArgs
    • SceneUnloadStartEventArgs
    • UnloadedScene
    • UnloadOptions
    • UnloadOptions.ServerUnloadMode
    • UnloadParams
    • UnloadQueueData
  • FishNet.Managing.Server
    • ClientConnectionChangeBroadcast
    • ConnectedClientsBroadcast
    • KickReason
    • ServerManager
    • ServerObjects
  • FishNet.Managing.Statistic
    • NetworkTrafficArgs
    • NetworkTraficStatistics
    • StatisticsManager
  • FishNet.Managing.Timing
    • EstimatedTick
    • EstimatedTick.OldTickOption
    • PhysicsMode
    • PreciseTick
    • PreciseTickExtensions
    • PreciseTickSerializer
    • TickRounding
    • TickType
    • TimeManager
  • FishNet.Managing.Transporting
    • IntermediateLayer
    • LatencySimulator
    • TransportManager
  • FishNet.Managing.Utility
    • Packets
  • FishNet.Object
    • ClientAttribute
    • DataOrderType
    • DespawnType
    • EmptyNetworkBehaviour
    • GlobalPreserveOwnedObjects
    • NetworkBehaviour
    • NetworkObject
    • NetworkObject.HostVisibilityUpdatedDelegate
    • NetworkObjectIdComparer
    • NetworkPreserveOwnedObjects
    • ObserversRpcAttribute
    • ReplicateState
    • ReplicateStateExtensions
    • RpcAttribute
    • ServerAttribute
    • ServerRpcAttribute
    • TargetRpcAttribute
    • TransformProperties
    • TransformPropertiesCls
    • TransformPropertiesFlag
    • TransformPropertiesOptionExtensions
  • FishNet.Object.Prediction
    • AdaptiveInterpolationType
    • ChildTransformTickSmoother
    • IReconcileData
    • IReplicateData
    • PredictionigidbodySerializers
    • PredictionRigidbody
    • PredictionRigidbody.AllForceData
    • PredictionRigidbody.EntryData
    • PredictionRigidbody.ForceApplicationType
    • PredictionRigidbody.IForceData
    • PredictionRigidbody2D
    • PredictionRigidbody2D.AllForceData
    • PredictionRigidbody2D.EntryData
    • PredictionRigidbody2D.ForceApplicationType
    • PredictionRigidbody2D2DSerializers
    • ReconcileAttribute
    • ReplicateAttribute
  • FishNet.Object.Synchronizing
    • ByteSyncVar
    • DoubleSyncVar
    • FloatSyncVar
    • ICustomSync
    • IntSyncVar
    • LongSyncVar
    • ReadPermission
    • SbyteSyncVar
    • ShortSyncVar
    • SyncDictionary<TKey, TValue>
    • SyncHashSet<T>
    • SyncList<T>
    • SyncObjectAttribute
    • SyncStopwatch
    • SyncStopwatch.SyncTypeChanged
    • SyncStopwatchOperation
    • SyncTimer
    • SyncTimer.SyncTypeChanged
    • SyncTimerOperation
    • SyncTypeSettings
    • SyncVarAttribute
    • UIntSyncVar
    • ULongSyncVar
    • UShortSyncVar
    • Vector2IntSyncVar
    • Vector2SyncVar
    • Vector3IntSyncVar
    • Vector3SyncVar
    • Vector4SyncVar
    • WritePermission
  • FishNet.Observing
    • HostVisibilityUpdateTypes
    • NetworkObserver
    • NetworkObserver.ConditionOverrideType
    • ObserverCondition
    • ObserverConditionType
  • FishNet.Serializing
    • AutoPackType
    • DeltaSerializerOption
    • DeltaSerializerOptionExtensions
    • PooledReader
    • PooledWriter
    • Reader
    • Reader.DataSource
    • ReaderPool
    • SubStream
    • Writer
    • WriterPool
  • FishNet.Transporting
    • Channel
    • ClientConnectionStateArgs
    • ClientReceivedDataArgs
    • ConnectedClientsArgs
    • IPAddressType
    • LocalConnectionState
    • RemoteConnectionState
    • RemoteConnectionStateArgs
    • ServerConnectionStateArgs
    • ServerReceivedDataArgs
    • Transport
    • TransportConsts
  • GameKit.Dependencies.Utilities
    • ApplicationState
    • Arrays
    • BasicQueue<T>
    • Booleans
    • Bytes
    • CanvaseGroups
    • CanvasGroupBlockingType
    • CollectionCaches<T>
    • CollectionCaches<T1, T2>
    • Collider2DExtensions
    • ColliderExtensions
    • DictionaryFN
    • Disks
    • Enums
    • Floats
    • Hashing
    • Ints
    • IOs
    • IResettable
    • IWeighted
    • Layers
    • LayoutGroups
    • Materials
    • Maths
    • ObjectCaches<T>
    • Objects
    • Particles
    • PointerMonoBehaviour
    • Quaternions
    • ResettableCollectionCaches<T>
    • ResettableCollectionCaches<T1, T2>
    • ResettableObjectCaches<T>
    • ResettableT1CollectionCaches<T1, T2>
    • ResettableT2CollectionCaches<T1, T2>
    • Strings
    • Transforms
    • UInts
    • Vectors
    • WeightedRandom
  • GameKit.Dependencies.Utilities.ObjectPooling
    • ListStack<GameObject>
    • ObjectPool
    • PoolData
  • GameKit.Dependencies.Utilities.ObjectPooling.Examples
    • Projectile
    • ProjectileSpawner
  • GameKit.Dependencies.Utilities.Types
    • ByteRange
    • CanvasGroupFader
    • CanvasGroupFader.FadeGoalType
    • CanvasTracker
    • DDOL
    • FloatRange
    • FloatRange2D
    • IntRange
    • IOrderable
    • RectTransformResizer
    • RectTransformResizer.ResizeData
    • RectTransformResizer.ResizeDelegate
    • ResettableRingBuffer<T>
    • ResettableRingBuffer<T>.Enumerator
    • RingBuffer<T>
    • RingBuffer<T>.Enumerator
    • SceneAttribute
    • ScrollbarValueSetter
    • SingletonScriptableObject<T>
    • SmoothCameraTarget
    • TimedOperation
    • UIntRange
    • Vector2Range
  • GameKit.Dependencies.Utilities.Types.CanvasContainers
    • ButtonData
    • ButtonData.PressedDelegate
    • FloatingContainer
    • FloatingImage
    • ImageButtonData
    • ResizableContainer
  • GameKit.Dependencies.Utilities.Types.OptionMenuButtons
    • FloatingOptions

Class ServerManager

A container for server data and actions.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
ServerManager
Inherited Members
UnityEngine.MonoBehaviour.IsInvoking()
UnityEngine.MonoBehaviour.CancelInvoke()
UnityEngine.MonoBehaviour.Invoke(System.String, System.Single)
UnityEngine.MonoBehaviour.InvokeRepeating(System.String, System.Single, System.Single)
UnityEngine.MonoBehaviour.CancelInvoke(System.String)
UnityEngine.MonoBehaviour.IsInvoking(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String, System.Object)
UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StartCoroutine_Auto(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(UnityEngine.Coroutine)
UnityEngine.MonoBehaviour.StopCoroutine(System.String)
UnityEngine.MonoBehaviour.StopAllCoroutines()
UnityEngine.MonoBehaviour.print(System.Object)
UnityEngine.MonoBehaviour.useGUILayout
UnityEngine.MonoBehaviour.runInEditMode
UnityEngine.Behaviour.enabled
UnityEngine.Behaviour.isActiveAndEnabled
UnityEngine.Component.GetComponent(System.Type)
UnityEngine.Component.GetComponent<T>()
UnityEngine.Component.TryGetComponent(System.Type, UnityEngine.Component)
UnityEngine.Component.TryGetComponent<T>(T)
UnityEngine.Component.GetComponent(System.String)
UnityEngine.Component.GetComponentInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentInChildren(System.Type)
UnityEngine.Component.GetComponentInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentInChildren<T>()
UnityEngine.Component.GetComponentsInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInChildren(System.Type)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInChildren<T>()
UnityEngine.Component.GetComponentsInChildren<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentInParent(System.Type, System.Boolean)
UnityEngine.Component.GetComponentInParent(System.Type)
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentInParent<T>()
UnityEngine.Component.GetComponentsInParent(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInParent(System.Type)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInParent<T>()
UnityEngine.Component.GetComponents(System.Type)
UnityEngine.Component.GetComponents(System.Type, System.Collections.Generic.List<UnityEngine.Component>)
UnityEngine.Component.GetComponents<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponents<T>()
UnityEngine.Component.CompareTag(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object)
UnityEngine.Component.SendMessageUpwards(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, System.Object)
UnityEngine.Component.SendMessage(System.String)
UnityEngine.Component.SendMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object)
UnityEngine.Component.BroadcastMessage(System.String)
UnityEngine.Component.BroadcastMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.transform
UnityEngine.Component.gameObject
UnityEngine.Component.tag
UnityEngine.Object.GetInstanceID()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Destroy(UnityEngine.Object, System.Single)
UnityEngine.Object.Destroy(UnityEngine.Object)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object, System.Boolean)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object)
UnityEngine.Object.FindObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfType(System.Type, System.Boolean)
UnityEngine.Object.FindObjectsByType(System.Type, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsByType(System.Type, UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfTypeIncludingAssets(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>()
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindObjectsOfTypeAll(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type)
UnityEngine.Object.FindFirstObjectByType(System.Type)
UnityEngine.Object.FindAnyObjectByType(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type, System.Boolean)
UnityEngine.Object.FindFirstObjectByType(System.Type, UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType(System.Type, UnityEngine.FindObjectsInactive)
UnityEngine.Object.ToString()
UnityEngine.Object.name
UnityEngine.Object.hideFlags
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FishNet.Managing.Server
Assembly: FishNet.Runtime.dll
Syntax
[DisallowMultipleComponent]
[AddComponentMenu("FishNet/Manager/ServerManager")]
public sealed class ServerManager : MonoBehaviour

Fields

Clients

Authenticated and non-authenticated connected clients.

Declaration
[HideInInspector]
public Dictionary<int, NetworkConnection> Clients
Field Value
Type Description
System.Collections.Generic.Dictionary<System.Int32, NetworkConnection>

MAXIMUM_REMOTE_CLIENT_TIMEOUT_DURATION

Maximum value the remote client timeout can be set to.

Declaration
public const ushort MAXIMUM_REMOTE_CLIENT_TIMEOUT_DURATION = 1500
Field Value
Type Description
System.UInt16

Properties

NetworkManager

NetworkManager for server.

Declaration
[HideInInspector]
public NetworkManager NetworkManager { get; }
Property Value
Type Description
NetworkManager

Objects

Handling and information for objects on the server.

Declaration
public ServerObjects Objects { get; }
Property Value
Type Description
ServerObjects

ShareIds

True to share the Ids of clients and the objects they own with other clients. No sensitive information is shared.

Declaration
public bool ShareIds { get; }
Property Value
Type Description
System.Boolean

Started

True if the server connection has started.

Declaration
public bool Started { get; }
Property Value
Type Description
System.Boolean

Methods

AnyServerStarted(Nullable<Int32>)

Returns true if any server socket is in the started state.

Declaration
public bool AnyServerStarted(int? excludedIndex = null)
Parameters
Type Name Description
System.Nullable<System.Int32> excludedIndex

When set the transport on this index will be ignored. This value is only used with Multipass.

Returns
Type Description
System.Boolean

Broadcast<T>(T, Boolean, Channel)

Sends a broadcast to all clients.

Declaration
public void Broadcast<T>(T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable)
    where T : struct, IBroadcast
Parameters
Type Name Description
T message

Broadcast data being sent; for example: an instance of your broadcast type.

System.Boolean requireAuthenticated

True if the clients must be authenticated for this broadcast to send.

Channel channel

Channel to send on.

Type Parameters
Name Description
T

Type of broadcast to send.

Broadcast<T>(NetworkConnection, T, Boolean, Channel)

Sends a broadcast to a connection.

Declaration
public void Broadcast<T>(NetworkConnection connection, T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable)
    where T : struct, IBroadcast
Parameters
Type Name Description
NetworkConnection connection

Connection to send to.

T message

Broadcast data being sent; for example: an instance of your broadcast type.

System.Boolean requireAuthenticated

True if the client must be authenticated for this broadcast to send.

Channel channel

Channel to send on.

Type Parameters
Name Description
T

Type of broadcast to send.

Broadcast<T>(NetworkObject, T, Boolean, Channel)

Sends a broadcast to observers.

Declaration
public void Broadcast<T>(NetworkObject networkObject, T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable)
    where T : struct, IBroadcast
Parameters
Type Name Description
NetworkObject networkObject

NetworkObject to use Observers from.

T message

Broadcast data being sent; for example: an instance of your broadcast type.

System.Boolean requireAuthenticated

True if the clients must be authenticated for this broadcast to send.

Channel channel

Channel to send on.

Type Parameters
Name Description
T

Type of broadcast to send.

Broadcast<T>(HashSet<NetworkConnection>, T, Boolean, Channel)

Sends a broadcast to connections.

Declaration
public void Broadcast<T>(HashSet<NetworkConnection> connections, T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable)
    where T : struct, IBroadcast
Parameters
Type Name Description
System.Collections.Generic.HashSet<NetworkConnection> connections

Connections to send to.

T message

Broadcast data being sent; for example: an instance of your broadcast type.

System.Boolean requireAuthenticated

True if the clients must be authenticated for this broadcast to send.

Channel channel

Channel to send on.

Type Parameters
Name Description
T

Type of broadcast to send.

BroadcastExcept<T>(NetworkConnection, T, Boolean, Channel)

Sends a broadcast to all connections except excluded.

Declaration
public void BroadcastExcept<T>(NetworkConnection excludedConnection, T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable)
    where T : struct, IBroadcast
Parameters
Type Name Description
NetworkConnection excludedConnection

Connection to exclude.

T message

Broadcast data being sent; for example: an instance of your broadcast type.

System.Boolean requireAuthenticated

True if the clients must be authenticated for this broadcast to send.

Channel channel

Channel to send on.

Type Parameters
Name Description
T

Type of broadcast to send.

BroadcastExcept<T>(HashSet<NetworkConnection>, T, Boolean, Channel)

Sends a broadcast to all connections except excluded.

Declaration
public void BroadcastExcept<T>(HashSet<NetworkConnection> excludedConnections, T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable)
    where T : struct, IBroadcast
Parameters
Type Name Description
System.Collections.Generic.HashSet<NetworkConnection> excludedConnections

Connections to send to.

T message

Broadcast data being sent; for example: an instance of your broadcast type.

System.Boolean requireAuthenticated

True if the clients must be authenticated for this broadcast to send.

Channel channel

Channel to send on.

Type Parameters
Name Description
T

Type of broadcast to send.

BroadcastExcept<T>(HashSet<NetworkConnection>, NetworkConnection, T, Boolean, Channel)

Sends a broadcast to connections except excluded.

Declaration
public void BroadcastExcept<T>(HashSet<NetworkConnection> connections, NetworkConnection excludedConnection, T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable)
    where T : struct, IBroadcast
Parameters
Type Name Description
System.Collections.Generic.HashSet<NetworkConnection> connections

Connections to send to.

NetworkConnection excludedConnection

Connection to exclude.

T message

Broadcast data being sent; for example: an instance of your broadcast type.

System.Boolean requireAuthenticated

True if the clients must be authenticated for this broadcast to send.

Channel channel

Channel to send on.

Type Parameters
Name Description
T

Type of broadcast to send.

BroadcastExcept<T>(HashSet<NetworkConnection>, HashSet<NetworkConnection>, T, Boolean, Channel)

Sends a broadcast to connections except excluded.

Declaration
public void BroadcastExcept<T>(HashSet<NetworkConnection> connections, HashSet<NetworkConnection> excludedConnections, T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable)
    where T : struct, IBroadcast
Parameters
Type Name Description
System.Collections.Generic.HashSet<NetworkConnection> connections

Connections to send to.

System.Collections.Generic.HashSet<NetworkConnection> excludedConnections

Connections to exclude.

T message

Broadcast data being sent; for example: an instance of your broadcast type.

System.Boolean requireAuthenticated

True if the clients must be authenticated for this broadcast to send.

Channel channel

Channel to send on.

Type Parameters
Name Description
T

Type of broadcast to send.

Despawn(NetworkObject, Nullable<DespawnType>)

Despawns an object over the network. Can only be called on the server.

Declaration
public void Despawn(NetworkObject networkObject, DespawnType? despawnType = null)
Parameters
Type Name Description
NetworkObject networkObject

NetworkObject instance to despawn.

System.Nullable<DespawnType> despawnType

Despawn override type.

Despawn(GameObject, Nullable<DespawnType>)

Despawns an object over the network. Can only be called on the server.

Declaration
public void Despawn(GameObject go, DespawnType? despawnType = null)
Parameters
Type Name Description
UnityEngine.GameObject go

GameObject instance to despawn.

System.Nullable<DespawnType> despawnType

GetAuthenticator()

Gets the Authenticator for this manager.

Declaration
public Authenticator GetAuthenticator()
Returns
Type Description
Authenticator

GetStartOnHeadless()

Gets StartOnHeadless value.

Declaration
public bool GetStartOnHeadless()
Returns
Type Description
System.Boolean

Kick(NetworkConnection, KickReason, LoggingType, String)

Kicks a connection immediately while invoking OnClientKick.

Declaration
public void Kick(NetworkConnection conn, KickReason kickReason, LoggingType loggingType = LoggingType.Common, string log = "")
Parameters
Type Name Description
NetworkConnection conn

Client to kick.

KickReason kickReason

Reason client is being kicked.

LoggingType loggingType

How to print logging as.

System.String log

Optional message to be debug logged.

Kick(NetworkConnection, Reader, KickReason, LoggingType, String)

Kicks a connection immediately while invoking OnClientKick.

Declaration
public void Kick(NetworkConnection conn, Reader reader, KickReason kickReason, LoggingType loggingType = LoggingType.Common, string log = "")
Parameters
Type Name Description
NetworkConnection conn

Client to kick.

Reader reader

Reader to clear before kicking.

KickReason kickReason

Reason client is being kicked.

LoggingType loggingType

How to print logging as.

System.String log

Optional message to be debug logged.

Kick(Int32, KickReason, LoggingType, String)

Kicks a connection immediately while invoking OnClientKick.

Declaration
public void Kick(int clientId, KickReason kickReason, LoggingType loggingType = LoggingType.Common, string log = "")
Parameters
Type Name Description
System.Int32 clientId

ClientId to kick.

KickReason kickReason

Reason client is being kicked.

LoggingType loggingType

How to print logging as.

System.String log

Optional message to be debug logged.

OneServerStarted()

Returns true if only one server is started.

Declaration
public bool OneServerStarted()
Returns
Type Description
System.Boolean

RegisterBroadcast<T>(Action<NetworkConnection, T, Channel>, Boolean)

Registers a method to call when a Broadcast arrives.

Declaration
public void RegisterBroadcast<T>(Action<NetworkConnection, T, Channel> handler, bool requireAuthentication = true)
    where T : struct, IBroadcast
Parameters
Type Name Description
System.Action<NetworkConnection, T, Channel> handler

Method to call.

System.Boolean requireAuthentication

True if the client must be authenticated for the method to call.

Type Parameters
Name Description
T

Type of broadcast being registered.

SetAuthenticator(Authenticator)

Gets the Authenticator for this manager, and initializes it.

Declaration
public void SetAuthenticator(Authenticator value)
Parameters
Type Name Description
Authenticator value

SetFrameRate(UInt16)

Declaration
public void SetFrameRate(ushort value)
Parameters
Type Name Description
System.UInt16 value

SetRemoteClientTimeout(RemoteTimeoutType, UInt16)

Sets timeout settings. Can be used at runtime.

Declaration
public void SetRemoteClientTimeout(RemoteTimeoutType timeoutType, ushort duration)
Parameters
Type Name Description
RemoteTimeoutType timeoutType
System.UInt16 duration

SetStartOnHeadless(Boolean)

Sets StartOnHeadless value.

Declaration
public void SetStartOnHeadless(bool value)
Parameters
Type Name Description
System.Boolean value

New value to use.

Spawn(NetworkObject, NetworkConnection, Scene)

Spawns an object over the network. Can only be called on the server.

Declaration
public void Spawn(NetworkObject nob, NetworkConnection ownerConnection = null, Scene scene = default(Scene))
Parameters
Type Name Description
NetworkObject nob

MetworkObject instance to spawn.

NetworkConnection ownerConnection

Connection to give ownership to.

UnityEngine.SceneManagement.Scene scene

Spawn(GameObject, NetworkConnection, Scene)

Spawns an object over the network. Can only be called on the server.

Declaration
public void Spawn(GameObject go, NetworkConnection ownerConnection = null, Scene scene = default(Scene))
Parameters
Type Name Description
UnityEngine.GameObject go

GameObject instance to spawn.

NetworkConnection ownerConnection

Connection to give ownership to.

UnityEngine.SceneManagement.Scene scene

StartConnection()

Starts the local server connection.

Declaration
public bool StartConnection()
Returns
Type Description
System.Boolean

StartConnection(UInt16)

Starts the local server using port.

Declaration
public bool StartConnection(ushort port)
Parameters
Type Name Description
System.UInt16 port

Port to start on.

Returns
Type Description
System.Boolean

StopConnection(Boolean)

Stops the local server connection.

Declaration
public bool StopConnection(bool sendDisconnectMessage)
Parameters
Type Name Description
System.Boolean sendDisconnectMessage

True to send a disconnect message to all clients first.

Returns
Type Description
System.Boolean

UnregisterBroadcast<T>(Action<NetworkConnection, T, Channel>)

Unregisters a method call from a Broadcast type.

Declaration
public void UnregisterBroadcast<T>(Action<NetworkConnection, T, Channel> handler)
    where T : struct, IBroadcast
Parameters
Type Name Description
System.Action<NetworkConnection, T, Channel> handler

Method to unregister.

Type Parameters
Name Description
T

Type of broadcast being unregistered.

Events

OnAuthenticationResult

Called when authenticator has concluded a result for a connection. Boolean is true if authentication passed, false if failed.

Declaration
public event Action<NetworkConnection, bool> OnAuthenticationResult
Event Type
Type Description
System.Action<NetworkConnection, System.Boolean>

OnClientKick

Called when a client is removed from the server using Kick. This is invoked before the client is disconnected. NetworkConnection when available, clientId, and KickReason are provided.

Declaration
public event Action<NetworkConnection, int, KickReason> OnClientKick
Event Type
Type Description
System.Action<NetworkConnection, System.Int32, KickReason>

OnRemoteConnectionState

Called when a remote client state changes with the server.

Declaration
public event Action<NetworkConnection, RemoteConnectionStateArgs> OnRemoteConnectionState
Event Type
Type Description
System.Action<NetworkConnection, RemoteConnectionStateArgs>

OnServerConnectionState

Called after the local server connection state changes.

Declaration
public event Action<ServerConnectionStateArgs> OnServerConnectionState
Event Type
Type Description
System.Action<ServerConnectionStateArgs>
In This Article
  • Fields
    • Clients
    • MAXIMUM_REMOTE_CLIENT_TIMEOUT_DURATION
  • Properties
    • NetworkManager
    • Objects
    • ShareIds
    • Started
  • Methods
    • AnyServerStarted(Nullable<Int32>)
    • Broadcast<T>(T, Boolean, Channel)
    • Broadcast<T>(NetworkConnection, T, Boolean, Channel)
    • Broadcast<T>(NetworkObject, T, Boolean, Channel)
    • Broadcast<T>(HashSet<NetworkConnection>, T, Boolean, Channel)
    • BroadcastExcept<T>(NetworkConnection, T, Boolean, Channel)
    • BroadcastExcept<T>(HashSet<NetworkConnection>, T, Boolean, Channel)
    • BroadcastExcept<T>(HashSet<NetworkConnection>, NetworkConnection, T, Boolean, Channel)
    • BroadcastExcept<T>(HashSet<NetworkConnection>, HashSet<NetworkConnection>, T, Boolean, Channel)
    • Despawn(NetworkObject, Nullable<DespawnType>)
    • Despawn(GameObject, Nullable<DespawnType>)
    • GetAuthenticator()
    • GetStartOnHeadless()
    • Kick(NetworkConnection, KickReason, LoggingType, String)
    • Kick(NetworkConnection, Reader, KickReason, LoggingType, String)
    • Kick(Int32, KickReason, LoggingType, String)
    • OneServerStarted()
    • RegisterBroadcast<T>(Action<NetworkConnection, T, Channel>, Boolean)
    • SetAuthenticator(Authenticator)
    • SetFrameRate(UInt16)
    • SetRemoteClientTimeout(RemoteTimeoutType, UInt16)
    • SetStartOnHeadless(Boolean)
    • Spawn(NetworkObject, NetworkConnection, Scene)
    • Spawn(GameObject, NetworkConnection, Scene)
    • StartConnection()
    • StartConnection(UInt16)
    • StopConnection(Boolean)
    • UnregisterBroadcast<T>(Action<NetworkConnection, T, Channel>)
  • Events
    • OnAuthenticationResult
    • OnClientKick
    • OnRemoteConnectionState
    • OnServerConnectionState
Back to top Generated by DocFX