Network State Events
You can take advantage of numerous available events to stay informed about the current state of the network.
Last updated
You can take advantage of numerous available events to stay informed about the current state of the network.
Last updated
Name:
ServerManager.OnAuthenticationResult
Namespace:
FishNet.Managing.Server
Parameters:
This event is called once a client has either been authenticated or failed to authenticate. The parameters are the relevant , and a Boolean representing if that client successfully authenticated or not. This event can be very useful to use to store the NetworkConnection of a client that has successfully connected to the server or to send some message to the newly connected client.
Name:
ServerManager.OnServerConnectionState
Namespace:
FishNet.Managing.Server
Parameters:
This event is called when the server's changes. In other words, immediately when the server starts or stops running. This event is very useful for performing network actions on the server such as loading initial scenes or spawning initial objects.
Name:
ServerManager.OnRemoteConnectionState
Namespace:
FishNet.Managing.Server
Parameters:
This event is called when a client's changes with the server, in other words, immediately when a client connects or disconnects from the server. This event is very useful for detecting when a client has disconnected as well as for authentication scripts to handle sending data or checking if the server is full before authenticating a connection.
Name:
ClientManager.OnAuthenticated
Namespace:
FishNet.Managing.Client
Name:
ClientManager.OnClientConnectionState
Namespace:
FishNet.Managing.Client
Parameters:
This event is called when the local client's changes. In other words, immediately when the client makes or contact with the Fish-Networking server or is disconnected from it. This event is useful for detecting when you are disconnected from the server and when you initially connect. Authentication scripts will often use this event to send initial data to the server so that the server can authenticate the client.
Name:
ClientManager.OnRemoteConnectionState
Namespace:
FishNet.Managing.Client
Parameters:
This event is called when a client's changes. This event is useful for detecting when another player has connected or disconnected from the game.
Name:
TimeManager.OnPreTick
Namespace:
FishNet.Managing.Timing
This event is called right before a network tick occurs, as well as before data is read.
Name:
TimeManager.OnTick
Namespace:
FishNet.Managing.Timing
This event is called when a network tick occurs. This can be useful for sending data to the server at a set rate to prevent sending data too frequently and flooding the connection.
Name:
TimeManager.OnPostTick
Namespace:
FishNet.Managing.Timing
, bool
,
This event is called when the local client has successfully been authenticated with the FishNet server. The client will now have a Client ID and be added to the and collections. This is a good event to use to know when your client is fully connected to the server and ready to play the game.
When this event is invoked the client hasn't yet been added to the collection.
This is only available when using .
This event is called just after a network tick occurs; physics would have already been simulated if using .