Table of Contents

Class NetworkEventsListener

Namespace
Netick.Unity
Assembly
Netick.Unity.dll
public abstract class NetworkEventsListener : NetickBaseBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
NetworkEventsListener
Derived
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.transform
Component.gameObject
Component.tag
Object.GetInstanceID()
Object.GetHashCode()
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags
Extension Methods

Constructors

NetworkEventsListener()

protected NetworkEventsListener()

Properties

Sandbox

public NetworkSandbox Sandbox { get; }

Property Value

NetworkSandbox

Methods

OnClientConnected(NetworkSandbox, NetworkConnection)

Called on the server when a specific client has connected.

public virtual void OnClientConnected(NetworkSandbox sandbox, NetworkConnection client)

Parameters

sandbox NetworkSandbox
client NetworkConnection

OnClientDisconnected(NetworkSandbox, NetworkConnection, TransportDisconnectReason)

Called on the server when a specific client has disconnected.

public virtual void OnClientDisconnected(NetworkSandbox sandbox, NetworkConnection client, TransportDisconnectReason transportDisconnectReason)

Parameters

sandbox NetworkSandbox
client NetworkConnection
transportDisconnectReason TransportDisconnectReason

OnConnectFailed(NetworkSandbox, ConnectionFailedReason)

Called on the client when the connection to the server was refused, or simply failed.

public virtual void OnConnectFailed(NetworkSandbox sandbox, ConnectionFailedReason reason)

Parameters

sandbox NetworkSandbox
reason ConnectionFailedReason

OnConnectRequest(NetworkSandbox, NetworkConnectionRequest)

Called on the server when a client tries to connect. Use request to decide whether or not to allow this client to connect.

public virtual void OnConnectRequest(NetworkSandbox sandbox, NetworkConnectionRequest request)

Parameters

sandbox NetworkSandbox
request NetworkConnectionRequest

OnConnectedToServer(NetworkSandbox, NetworkConnection)

Called on the client when connection to the server has been initiated.

public virtual void OnConnectedToServer(NetworkSandbox sandbox, NetworkConnection server)

Parameters

sandbox NetworkSandbox
server NetworkConnection

OnDataReceived(NetworkSandbox, NetworkConnection, byte, byte*, int, TransportDeliveryMethod)

public virtual void OnDataReceived(NetworkSandbox sandbox, NetworkConnection sender, byte id, byte* data, int length, TransportDeliveryMethod transportDeliveryMethod)

Parameters

sandbox NetworkSandbox
sender NetworkConnection
id byte
data byte*
length int
transportDeliveryMethod TransportDeliveryMethod

OnDisconnectedFromServer(NetworkSandbox, NetworkConnection, TransportDisconnectReason)

Called on the client when connection to the server ended, or when a network error caused the disconnection.

public virtual void OnDisconnectedFromServer(NetworkSandbox sandbox, NetworkConnection server, TransportDisconnectReason transportDisconnectReason)

Parameters

sandbox NetworkSandbox
server NetworkConnection
transportDisconnectReason TransportDisconnectReason

OnInput(NetworkSandbox)

Called to read inputs.

public virtual void OnInput(NetworkSandbox sandbox)

Parameters

sandbox NetworkSandbox

OnMatchCreated(NetworkSandbox)

public virtual void OnMatchCreated(NetworkSandbox sandbox)

Parameters

sandbox NetworkSandbox

OnMatchListUpdate(NetworkSandbox, List<Session>)

public virtual void OnMatchListUpdate(NetworkSandbox sandbox, List<Session> sessions)

Parameters

sandbox NetworkSandbox
sessions List<Session>

OnObjectCreated(NetworkObject)

Called when a network object has been created/initialized.

public virtual void OnObjectCreated(NetworkObject entity)

Parameters

entity NetworkObject

OnObjectDestroyed(NetworkObject)

Called when a network object has been destroyed/recycled.

public virtual void OnObjectDestroyed(NetworkObject entity)

Parameters

entity NetworkObject

OnPlayerConnected(NetworkSandbox, NetworkPlayer)

Called on the server when a specific player has connected.

public virtual void OnPlayerConnected(NetworkSandbox sandbox, NetworkPlayer player)

Parameters

sandbox NetworkSandbox
player NetworkPlayer

OnPlayerDisconnected(NetworkSandbox, NetworkPlayer, TransportDisconnectReason)

Called on the server when a specific player has disconnected.

public virtual void OnPlayerDisconnected(NetworkSandbox sandbox, NetworkPlayer player, TransportDisconnectReason transportDisconnectReason)

Parameters

sandbox NetworkSandbox
player NetworkPlayer
transportDisconnectReason TransportDisconnectReason

OnSceneLoadStarted(NetworkSandbox)

Called on both the client and the server before beginning to load the new scene.

[Obsolete("This method will be removed. Use OnSceneLoadDone instead.")]
public virtual void OnSceneLoadStarted(NetworkSandbox sandbox)

Parameters

sandbox NetworkSandbox

OnSceneLoaded(NetworkSandbox)

Called on both the client and the server when the scene has been loaded.

[Obsolete("This method will be removed. Use OnSceneLoadBegan instead.")]
public virtual void OnSceneLoaded(NetworkSandbox sandbox)

Parameters

sandbox NetworkSandbox

OnSceneOperationBegan(NetworkSandbox, NetworkSceneOperation)

Called on both the client and the server when a scene load/unload operation was started.

public virtual void OnSceneOperationBegan(NetworkSandbox sandbox, NetworkSceneOperation sceneOperation)

Parameters

sandbox NetworkSandbox
sceneOperation NetworkSceneOperation

OnSceneOperationDone(NetworkSandbox, NetworkSceneOperation)

Called on both the client and the server when a scene load/unload operation finished.

public virtual void OnSceneOperationDone(NetworkSandbox sandbox, NetworkSceneOperation sceneOperation)

Parameters

sandbox NetworkSandbox
sceneOperation NetworkSceneOperation

OnShutdown(NetworkSandbox)

Called when Netick has been shut down.

public virtual void OnShutdown(NetworkSandbox sandbox)

Parameters

sandbox NetworkSandbox

OnStartup(NetworkSandbox)

Called when Netick has been started.

public virtual void OnStartup(NetworkSandbox sandbox)

Parameters

sandbox NetworkSandbox

OnVisibilityChanged(NetworkSandbox)

Called when a sandbox visibility changes. Use Sandbox.IsVisible to find if the sandbox is visible or not.

public virtual void OnVisibilityChanged(NetworkSandbox sandbox)

Parameters

sandbox NetworkSandbox

UnlinkFromNetick()

public void UnlinkFromNetick()