diff --git a/MLAPI/Data/NetworkingConfiguration.cs b/MLAPI/Data/NetworkingConfiguration.cs index 9237738..2bc956c 100644 --- a/MLAPI/Data/NetworkingConfiguration.cs +++ b/MLAPI/Data/NetworkingConfiguration.cs @@ -32,6 +32,7 @@ namespace MLAPI public bool EncryptMessages = false; public bool AllowPassthroughMessages = true; public bool EnableSceneSwitching = false; + public bool UseLegacyChannel = false; //Cached config hash private byte[] ConfigHash = null; diff --git a/MLAPI/MonoBehaviours/Core/NetworkingManager.cs b/MLAPI/MonoBehaviours/Core/NetworkingManager.cs index df98db8..839594f 100644 --- a/MLAPI/MonoBehaviours/Core/NetworkingManager.cs +++ b/MLAPI/MonoBehaviours/Core/NetworkingManager.cs @@ -106,7 +106,13 @@ namespace MLAPI ConnectionConfig cConfig = new ConnectionConfig(); //MLAPI channels and messageTypes - NetworkConfig.Channels.Add("MLAPI_RELIABLE_FRAGMENTED_SEQUENCED", QosType.ReliableFragmentedSequenced); + + //Legacy channel. ReliableFragmentedSequenced doesn't exist in older Unity versions. + if(NetworkConfig.UseLegacyChannel) + NetworkConfig.Channels.Add("MLAPI_RELIABLE_FRAGMENTED_SEQUENCED", QosType.ReliableSequenced); + else + NetworkConfig.Channels.Add("MLAPI_RELIABLE_FRAGMENTED_SEQUENCED", QosType.ReliableFragmentedSequenced); + NetworkConfig.Channels.Add("MLAPI_POSITION_UPDATE", QosType.StateUpdate); NetworkConfig.Channels.Add("MLAPI_ANIMATION_UPDATE", QosType.ReliableSequenced); MessageManager.messageTypes.Add("MLAPI_CONNECTION_REQUEST", 0);