Fish-Net: Networking Evolved
  • Introduction
    • Getting Started
    • Showcase
      • Upcoming Releases
    • Legal Restrictions
    • Pro, Projects, and Support
    • Business Support
    • Branding
  • Manual
    • General
      • Unity Compatibility
      • Changelog
        • Development Road Map
        • Major Version Update Solutions
      • Development
      • Performance
        • Benchmark Setup
        • Fish-Networking Vs Mirror
      • Terminology
        • Miscellaneous
        • Communicating
        • Server, Client, Host
      • Transports
      • Add-ons
        • Edgegap and other Hosting
        • Fish-Network-Discovery
      • Feature Comparison
      • Upgrading To Fish-Networking
    • Guides
      • Frequently Asked Questions (FAQ)
      • Creating Bug Reports
        • Report Example
      • Technical Limitations
      • Third-Party
      • Getting Started
        • Commonly Used Guides
        • Ownership - Moving Soon
        • Step-by-Step
          • Getting Connected
          • Preparing Your Player
      • Components
        • Managers
          • NetworkManager
          • TimeManager
          • PredictionManager
          • ServerManager
          • ClientManager
          • SceneManager
          • TransportManager
            • IntermediateLayer
          • StatisticsManager
          • ObserverManager
            • HashGrid
          • RollbackManager (Pro Feature)
        • Transports
          • FishyWebRTC
          • Bayou
          • FishyEOS (Epic Online Services)
          • FishyFacepunch (Steam)
          • FishyRealtime
          • FishySteamworks (Steam)
          • FishyUnityTransport
          • Multipass
          • Tugboat
          • Yak (Pro Feature)
        • Prediction
          • Network Collider
            • NetworkCollision
            • NetworkCollision2D
            • NetworkTrigger
            • NetworkTrigger2D
          • OfflineRigidbody
          • PredictedOwner
          • PredictedSpawn
        • Utilities
          • Tick Smoothers
            • NetworkTickSmoother
            • OfflineTickSmoother
          • MonoTickSmoother [Obsolete]
          • DetachableNetworkTickSmoother [Obsolete]
          • BandwidthDisplay
          • DefaultScene
          • PingDisplay
        • Authenticator
        • ColliderRollback
        • NetworkAnimator
        • NetworkBehaviour
        • NetworkTransform
        • NetworkObject
        • NetworkObserver
      • InstanceFinder
      • Ownership
        • Using Ownership To Read Values
      • Spawning and Despawning
        • Predicted Spawning
        • Nested NetworkObjects
        • Object Pooling
      • Components
      • NetworkBehaviour
      • NetworkObjects
      • Attributes, Quality of Life
      • Remote Procedure Calls
        • Broadcast
      • SyncTypes
        • Customizing Behavior
        • SyncVar
        • SyncList
        • SyncHashSet
        • SyncDictionary
        • SyncTimer
        • SyncStopwatch
        • Custom SyncType
      • Observers
        • Modifying Conditions
        • Custom Conditions
      • Automatic Serializers
      • Custom Serializers
        • Interface Serializers
        • Inheritance Serializers
      • Addressables
      • Scene Management
        • Scene Events
        • Scene Data
          • SceneLookupData
          • SceneLoadData
          • SceneUnloadData
        • Loading Scenes
        • Unloading Scenes
        • Scene Stacking
        • Scene Caching
        • Scene Visibility
        • Persisting NetworkObjects
        • Custom Scene Processors
          • 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
    • Server Hosting
      • Edgegap - Official Partner
        • Getting Started with Edgegap
      • Hathora
        • Getting Started with Hathora
      • Amazon Web Services (AWS)
        • Getting Started with AWS
    • API
Powered by GitBook
On this page
  • Setup
  • Client
  • Server
  1. Manual
  2. Guides
  3. Transports

Multipass

PreviousTransportsNextPrediction

Last updated 1 year ago

You may want to access specific transports directly. You can do so by getting a reference to Multipass and calling multipassReference.GetTransport<Type>().

The Transports collection is also publicly accessible within Multipass.

Setup

Like other transports to use Multipass it must be added to a gameObject, generally your NetworkManager object. After adding Multipass you must assign it as the transport to use within . If TransportManager is not added to your NetworkManager automatically; you may need to add the component first. Once Multipass is added and specified in your TransportManager add whichever other transports you wish to support. Drag the added reference of each transport to Transports under Multipass.

Be sure that each transport within Multipass is listening on a different port.

Client

A client may only use one transport within Multipass, while the server may listen on all the transports at once.

For client actions to work you must specify which transport to use for the client.

//This can be done easily using the TransportManager.
Multipass mp = transportManager.GetTransport<Multipass>();

//In this example if the build is a webGL build
//then use Bayou, otherwise use Tugboat.

#if UNITY_WEBGL && !UNITY_EDITOR
mp.SetClientTransport<Bayou>();
#else
mp.SetClientTransport<Tugboat>();
#endif

The example above shows using Bayou and Tugboat, but you may of course use your own logic for any number of transports.

Once a client transport is set you may perform functions normally as if you were using only one transport. An example of this would be: ClientManager.StartConnection().

Server

//Start all servers transports. This requires GlobalServerActions to be true.
serverManagerReference.StartConnection();

You may also access functions on a single transport by specifying the index of which transport to use.

//Start the connection on index 0.
Multipass mp = TransportManager.GetTransport<Multipass>();
//The true parameter is to indicate you are starting a server.
mp.StartConnection(true, 0);

As covered in the GlobalServerActions will execute server actions on all transports specified within Multipass. If you were to call ServerManager.StartConnection() while GlobalServerActions is true then the server would start on all transports; otherwise an error will be thrown.

TransportManager
component settings
Setup example.