Fish-Net: Networking Evolved
  • Overview
    • What is FishNet?
      • Features
        • Unity Compatibility
        • Performance
          • Benchmark Setup
          • Fish-Networking Vs Mirror
      • Pro, Projects, and Support
      • Business Support
      • Development
        • Changelog
        • Roadmap
      • Branding
      • Legal Restrictions
    • Showcase
      • Upcoming Releases
    • Asset Integrations
      • Fish-Network-Discovery
    • Community Resources
  • Guides
    • Getting Started
      • Installing Fish-Networking
      • Getting Connected
      • Preparing Your Player
      • Moving Your Player Around
      • Spawning and Despawning Items
      • Using SyncVars to Sync Colors
      • Connecting to Remote Devices
      • Beyond the Basics
    • High-Level Overview
      • Fundamentals
      • Networking Models
      • Terminology
        • Server, Client, Host
        • Communicating
        • Miscellaneous
      • Transports
    • Features
      • Server and Client Identification
        • Executing on Server or Client
        • NetworkConnections
      • Networked GameObjects and Scripts
        • NetworkObjects
        • NetworkBehaviour
        • Spawning and Despawning
          • Predicted Spawning
          • Nested NetworkObjects
          • Object Pooling
      • Network State Events
      • Network Communication
        • Remote Procedure Calls
        • SyncTypes
          • Customizing Behavior
          • SyncVar
          • SyncList
          • SyncHashSet
          • SyncDictionary
          • SyncTimer
          • SyncStopwatch
          • Custom SyncType
        • Broadcasts
      • Data Serialization
        • Custom Serializers
          • Interface Serializers
          • Inheritance Serializers
      • Ownership
        • Using Ownership To Read Values
      • Area of Interest (Observer System)
        • Modifying Conditions
        • Custom Conditions
      • Scene Management
        • Scene Events
        • Scene Data
          • SceneLookupData
          • SceneLoadData
          • SceneUnloadData
        • Loading Scenes
          • Automatic Online and Offline Scenes
        • Unloading Scenes
        • Scene Stacking
        • Scene Caching
        • Scene Visibility
        • Persisting NetworkObjects
        • Custom Scene Processors
          • Addressables
      • InstanceFinder
      • Addressables
      • Transports
        • Multipass
      • Prediction
        • What Is Client-Side Prediction
        • Configuring PredictionManager
        • Configuring TimeManager
        • Configuring NetworkObject
        • Offline Rigidbodies
        • Interpolations
        • Creating Code
          • Controlling An Object
          • Non-Controlled Object
          • Understanding ReplicateState
            • Using States In Code
            • Predicting States In Code
          • Advanced Controls
        • Custom Comparers
        • PredictionRigidbody
        • Using NetworkColliders
      • Lag Compensation
        • States
        • Raycast
        • Projectiles
    • Upgrading API
    • Server Hosting
      • Edgegap - Official Partner
        • Getting Started with Edgegap
      • Hathora
        • Getting Started with Hathora
      • Amazon Web Services (AWS)
        • Getting Started with AWS
    • Upgrading To Fish-Networking
    • Troubleshooting
      • Technical Limitations
      • Creating Bug Reports
        • Report Example
      • FAQ
  • FishNet Building Blocks
    • Components
      • Managers
        • NetworkManager
        • TimeManager
        • PredictionManager
        • ServerManager
        • ClientManager
        • SceneManager
        • TransportManager
          • IntermediateLayer
        • StatisticsManager
        • ObserverManager
          • HashGrid
        • RollbackManager (Pro Feature)
      • Prediction
        • Network Collider
          • NetworkCollision
          • NetworkCollision2D
          • NetworkTrigger
          • NetworkTrigger2D
        • OfflineRigidbody
        • PredictedOwner
        • PredictedSpawn
      • Utilities
        • PingDisplay
        • BandwidthDisplay
        • Tick Smoothers
          • NetworkTickSmoother
          • OfflineTickSmoother
          • MonoTickSmoother [Obsolete]
          • DetachableNetworkTickSmoother [Obsolete]
      • PlayerSpawner
      • DefaultScene
      • ServerSpawner
      • Authenticator
      • ColliderRollback
      • NetworkAnimator
      • NetworkBehaviour
      • NetworkTransform
      • NetworkObject
      • NetworkObserver
    • Prefabs
      • NetworkManager
      • NetworkHudCanvas
    • ScriptableObjects
      • ObserverConditions
        • DistanceCondition
        • GridCondition
        • HostOnlyCondition
        • MatchCondition
        • OwnerOnlyCondition
        • SceneCondition
      • SpawnablePrefabs
        • DefaultPrefabObjects
        • SinglePrefabObjects
        • DualPrefabObjects
      • LevelLoggingConfiguration
    • Transports
      • Tugboat
      • Multipass
      • Yak (Pro Feature)
      • Bayou
      • FishyWebRTC
      • FishyUnityTransport
      • FishySteamworks (Steam)
      • FishyEOS (Epic Online Services)
      • FishyFacepunch (Steam)
      • FishyRealtime (Photon)
  • API Documentation
    • API Reference
Powered by GitBook
On this page
  • Server Side Events
  • OnAuthenticationResult
  • OnServerConnectionState
  • OnRemoteConnectionState
  • Client Side Events
  • OnAuthenticated
  • OnClientConnectionState
  • OnRemoteConnectionState
  • Shared Events
  • OnPreTick
  • OnTick
  • OnPostTick
  1. Guides
  2. Features

Network State Events

You can take advantage of numerous available events to stay informed about the current state of the network.

PreviousObject PoolingNextNetwork Communication

Last updated 1 day ago

This is not a comprehensive list of available events, but merely some of the most commonly used ones. To view all the available ones check out the .

Server Side Events

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.


Client Side Events

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.


Shared Events

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 .

API pages
OnAuthenticationResult
NetworkConnection
OnServerConnectionState
OnRemoteConnectionState
OnAuthenticated
ServerManager.Clients
ClientManager.Clients
OnClientConnectionState
ClientManager.Clients
OnRemoteConnectionState
ServerManager.ShareIds
OnPreTick
OnTick
OnPostTick
PhysicsMode.TimeManager
NetworkConnection
ServerConnectionStateArgs
NetworkConnection
RemoteConnectionStateArgs
ClientConnectionStateArgs
RemoteConnectionStateArgs