MLAPI.NetworkManager
The main component of the library
#
InheritanceSystem.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
#
ImplementsINetworkUpdateSystem
#
Inherited MembersMonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.Invoke(String, Single)
MonoBehaviour.InvokeRepeating(String, Single, Single)
MonoBehaviour.CancelInvoke(String)
MonoBehaviour.IsInvoking(String)
MonoBehaviour.StartCoroutine(String)
MonoBehaviour.StartCoroutine(String, Object)
MonoBehaviour.StartCoroutine(IEnumerator)
MonoBehaviour.StartCoroutine_Auto(IEnumerator)
MonoBehaviour.StopCoroutine(IEnumerator)
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopCoroutine(String)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.print(Object)
MonoBehaviour.useGUILayout
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent(Type)
Component.GetComponent<T>()
Component.GetComponent(String)
Component.GetComponentInChildren(Type, Boolean)
Component.GetComponentInChildren(Type)
Component.GetComponentInChildren<T>(Boolean)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren(Type, Boolean)
Component.GetComponentsInChildren(Type)
Component.GetComponentsInChildren<T>(Boolean)
Component.GetComponentsInChildren<T>(Boolean, List<T>)"
Component.GetComponentsInChildren<T>()
Component.GetComponentsInChildren<T>(List<T>)"
Component.GetComponentInParent(Type)
Component.GetComponentInParent<T>()
Component.GetComponentsInParent(Type, Boolean)
Component.GetComponentsInParent(Type)
Component.GetComponentsInParent<T>(Boolean)
Component.GetComponentsInParent<T>(Boolean, List<T>)"
Component.GetComponentsInParent<T>()
Component.GetComponents(Type)
Component.GetComponents(Type, List<Component>)
Component.GetComponents<T>(List<T>)"
Component.GetComponents<T>()
Component.CompareTag(String)
Component.SendMessageUpwards(String, Object, SendMessageOptions)
Component.SendMessageUpwards(String, Object)
Component.SendMessageUpwards(String)
Component.SendMessageUpwards(String, SendMessageOptions)
Component.SendMessage(String, Object)
Component.SendMessage(String)
Component.SendMessage(String, Object, SendMessageOptions)
Component.SendMessage(String, SendMessageOptions)
Component.BroadcastMessage(String, Object, SendMessageOptions)
Component.BroadcastMessage(String, Object)
Component.BroadcastMessage(String)
Component.BroadcastMessage(String, SendMessageOptions)
Component.transform
Component.gameObject
Component.tag
Component.rigidbody
Component.rigidbody2D
Component.camera
Component.light
Component.animation
Component.constantForce
Component.renderer
Component.audio
Component.guiText
Component.networkView
Component.guiElement
Component.guiTexture
Component.collider
Component.collider2D
Component.hingeJoint
Component.particleEmitter
Component.particleSystem
Object.GetInstanceID()
Object.GetHashCode()
Object.Equals(Object)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate(Object, Transform, Boolean)
Object.Instantiate<T>(T)"
Object.Instantiate<T>(T, Vector3, Quaternion)"
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)"
Object.Instantiate<T>(T, Transform)"
Object.Instantiate<T>(T, Transform, Boolean)"
Object.Destroy(Object, Single)
Object.Destroy(Object)
Object.DestroyImmediate(Object, Boolean)
Object.DestroyImmediate(Object)
Object.FindObjectsOfType(Type)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object, Single)
Object.DestroyObject(Object)
Object.FindSceneObjectsOfType(Type)
Object.FindObjectsOfTypeIncludingAssets(Type)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.FindObjectsOfTypeAll(Type)
Object.FindObjectOfType(Type)
Object.ToString()
Object.name
Object.hideFlags
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
#
Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
Fields#
ConnectedClientsGets a dictionary of connected clients and their clientId keys. This is only populated on the server.
#
Declaration#
Field ValueType | Description |
---|---|
System.Collections.Generic.Dictionary<System.UInt64, NetworkClient> |
#
ConnectedClientsListGets a list of connected clients. This is only populated on the server.
#
Declaration#
Field ValueType | Description |
---|---|
System.Collections.Generic.List<NetworkClient> |
#
DontDestroyGets or sets if the NetworkManager should be marked as DontDestroyOnLoad
#
Declaration#
Field ValueType | Description |
---|---|
System.Boolean |
#
LogLevelThe log level to use
#
Declaration#
Field ValueType | Description |
---|---|
LogLevel |
#
NetworkConfigThe current NetworkConfig
#
Declaration#
Field ValueType | Description |
---|---|
NetworkConfig |
#
PendingClientsGets a dictionary of the clients that have been accepted by the transport but are still pending by the MLAPI. This is only populated on the server.
#
Declaration#
Field ValueType | Description |
---|---|
System.Collections.Generic.Dictionary<System.UInt64, PendingClient> |
#
RunInBackgroundGets or sets if the application should be set to run in background
#
Declaration#
Field ValueType | Description |
---|---|
System.Boolean |
#
Properties#
ConnectedHostnameThe current hostname we are connected to, used to validate certificate
#
Declaration#
Property ValueType | Description |
---|---|
System.String |
#
IsClientGets Whether or not a client is running
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsConnectedClientGets if we are connected as a client
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsHostGets if we are running as host
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsListeningGets Whether or not we are listening for connections
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsServerGets Whether or not a server is running
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
LocalClientIdThe clientId the server calls the local client by, only valid for clients
#
Declaration#
Property ValueType | Description |
---|---|
System.UInt64 |
#
NetworkTimeA synchronized time, represents the time in seconds since the server application started. Is replicated across all clients
#
Declaration#
Property ValueType | Description |
---|---|
System.Single |
#
ServerClientIdGets the networkId of the server
#
Declaration#
Property ValueType | Description |
---|---|
System.UInt64 |
#
SingletonThe singleton instance of the NetworkManager
#
Declaration#
Property ValueType | Description |
---|---|
NetworkManager |
#
Methods#
DisconnectClient(UInt64)Disconnects the remote client.
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | clientId | The ClientId to disconnect |
#
NetworkUpdate(NetworkUpdateStage)#
Declaration#
ParametersType | Name | Description |
---|---|---|
NetworkUpdateStage | updateStage |
#
SetSingleton()#
Declaration#
Shutdown()#
Declaration#
StartClient()Starts a client
#
Declaration#
ReturnsType | Description |
---|---|
SocketTasks |
#
StartHost(Nullable<Vector3>, Nullable<Quaternion>, Nullable<Boolean>, Nullable<UInt64>, Stream)Starts a Host
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.Nullable<UnityEngine.Vector3> | position | |
System.Nullable<UnityEngine.Quaternion> | rotation | |
System.Nullable<System.Boolean> | createPlayerObject | |
System.Nullable<System.UInt64> | prefabHash | |
System.IO.Stream | payloadStream |
#
ReturnsType | Description |
---|---|
SocketTasks |
#
StartServer()Starts a server
#
Declaration#
ReturnsType | Description |
---|---|
SocketTasks |
#
StopClient()Stops the running client
#
Declaration#
StopHost()Stops the running host
#
Declaration#
StopServer()Stops the running server
#
Declaration#
Events#
ConnectionApprovalCallbackThe callback to invoke during connection approval
#
Declaration#
Event TypeType | Description |
---|---|
System.Action<System.Byte[], System.UInt64, NetworkManager.ConnectionApprovedDelegate> |
#
OnClientConnectedCallbackThe callback to invoke once a client connects. This callback is only ran on the server and on the local client that connects.
#
Declaration#
Event TypeType | Description |
---|---|
System.Action<System.UInt64> |
#
OnClientDisconnectCallbackThe callback to invoke when a client disconnects. This callback is invoked on a client when the server shuts down or disconnects the client. It is only run on the server and the local client that disconnects.
The callback is not invoked on the client when the client-side invokes the NetworkManager.StopClient
method or when the client side application shuts down abruptly (for example, no graceful disconnection where server or client notified it was exiting).
#
Declaration#
Event TypeType | Description |
---|---|
System.Action<System.UInt64> |
#
OnPerformanceDataEvent#
Declaration#
Event TypeType | Description |
---|---|
NetworkManager.PerformanceDataEventHandler |
#
OnServerStartedThe callback to invoke once the server is ready
#
Declaration#
Event TypeType | Description |
---|---|
System.Action |
#
ImplementsINetworkUpdateSystem
#
Extension MethodsNetworkUpdateLoop.RegisterAllNetworkUpdates(INetworkUpdateSystem)
NetworkUpdateLoop.RegisterNetworkUpdate(INetworkUpdateSystem, NetworkUpdateStage)
NetworkUpdateLoop.UnregisterAllNetworkUpdates(INetworkUpdateSystem)
NetworkUpdateLoop.UnregisterNetworkUpdate(INetworkUpdateSystem, NetworkUpdateStage)