Class NetworkEventsListener
public abstract class NetworkEventsListener : NetickBaseBehaviour
- Inheritance
-
NetworkEventsListener
- Derived
Constructors
NetworkEventsListener()
protected NetworkEventsListener()
Properties
Sandbox
public NetworkSandbox Sandbox { get; }
Property Value
Methods
OnClientConnected(NetworkSandbox, NetworkConnection)
Called on the server when a specific client has connected.
public virtual void OnClientConnected(NetworkSandbox sandbox, NetworkConnection client)
Parameters
sandboxNetworkSandboxclientNetworkConnection
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
sandboxNetworkSandboxclientNetworkConnectiontransportDisconnectReasonTransportDisconnectReason
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
sandboxNetworkSandboxreasonConnectionFailedReason
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
sandboxNetworkSandboxrequestNetworkConnectionRequest
OnConnectedToServer(NetworkSandbox, NetworkConnection)
Called on the client when connection to the server has been initiated.
public virtual void OnConnectedToServer(NetworkSandbox sandbox, NetworkConnection server)
Parameters
sandboxNetworkSandboxserverNetworkConnection
OnDataReceived(NetworkSandbox, NetworkConnection, byte, byte*, int, TransportDeliveryMethod)
public virtual void OnDataReceived(NetworkSandbox sandbox, NetworkConnection sender, byte id, byte* data, int length, TransportDeliveryMethod transportDeliveryMethod)
Parameters
sandboxNetworkSandboxsenderNetworkConnectionidbytedatabyte*lengthinttransportDeliveryMethodTransportDeliveryMethod
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
sandboxNetworkSandboxserverNetworkConnectiontransportDisconnectReasonTransportDisconnectReason
OnInput(NetworkSandbox)
Called to read inputs.
public virtual void OnInput(NetworkSandbox sandbox)
Parameters
sandboxNetworkSandbox
OnMatchCreated(NetworkSandbox)
public virtual void OnMatchCreated(NetworkSandbox sandbox)
Parameters
sandboxNetworkSandbox
OnMatchListUpdate(NetworkSandbox, List<Session>)
public virtual void OnMatchListUpdate(NetworkSandbox sandbox, List<Session> sessions)
Parameters
sandboxNetworkSandboxsessionsList<Session>
OnObjectCreated(NetworkObject)
Called when a network object has been created/initialized.
public virtual void OnObjectCreated(NetworkObject entity)
Parameters
entityNetworkObject
OnObjectDestroyed(NetworkObject)
Called when a network object has been destroyed/recycled.
public virtual void OnObjectDestroyed(NetworkObject entity)
Parameters
entityNetworkObject
OnPlayerConnected(NetworkSandbox, NetworkPlayer)
Called on the server when a specific player has connected.
[Obsolete("This method will be removed. Use OnPlayerJoined instead.")]
public virtual void OnPlayerConnected(NetworkSandbox sandbox, NetworkPlayer player)
Parameters
sandboxNetworkSandboxplayerNetworkPlayer
OnPlayerDisconnected(NetworkSandbox, NetworkPlayer, TransportDisconnectReason)
Called on the server when a specific player has disconnected.
[Obsolete("This method will be removed. Use OnPlayerLeft instead.")]
public virtual void OnPlayerDisconnected(NetworkSandbox sandbox, NetworkPlayer player, TransportDisconnectReason transportDisconnectReason)
Parameters
sandboxNetworkSandboxplayerNetworkPlayertransportDisconnectReasonTransportDisconnectReason
OnPlayerJoined(NetworkSandbox, NetworkPlayerId)
Called when a specific player has joined the game. This is synced to all clients, including late-joiners..
public virtual void OnPlayerJoined(NetworkSandbox sandbox, NetworkPlayerId player)
Parameters
sandboxNetworkSandboxplayerNetworkPlayerId
OnPlayerLeft(NetworkSandbox, NetworkPlayerId)
Called when a specific player has left the game. This is synced to all clients, including late-joiners..
public virtual void OnPlayerLeft(NetworkSandbox sandbox, NetworkPlayerId player)
Parameters
sandboxNetworkSandboxplayerNetworkPlayerId
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
sandboxNetworkSandbox
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
sandboxNetworkSandbox
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
sandboxNetworkSandboxsceneOperationNetworkSceneOperation
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
sandboxNetworkSandboxsceneOperationNetworkSceneOperation
OnShutdown(NetworkSandbox)
Called when Netick has been shut down.
public virtual void OnShutdown(NetworkSandbox sandbox)
Parameters
sandboxNetworkSandbox
OnStartup(NetworkSandbox)
Called when Netick has been started.
public virtual void OnStartup(NetworkSandbox sandbox)
Parameters
sandboxNetworkSandbox
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
sandboxNetworkSandbox
UnlinkFromNetick()
public void UnlinkFromNetick()