Multipass
Last updated
Last updated
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.
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 TransportManager. 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.
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.
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().
As covered in the component settings 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.
You may also access functions on a single transport by specifying the index of which transport to use.