Skip to content

Commit 11bd452

Browse files
committed
Added LegacyChannel to config
1 parent 8ea338a commit 11bd452

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

MLAPI/Data/NetworkingConfiguration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class NetworkingConfiguration
3232
public bool EncryptMessages = false;
3333
public bool AllowPassthroughMessages = true;
3434
public bool EnableSceneSwitching = false;
35+
public bool UseLegacyChannel = false;
3536

3637
//Cached config hash
3738
private byte[] ConfigHash = null;

MLAPI/MonoBehaviours/Core/NetworkingManager.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ private ConnectionConfig Init(NetworkingConfiguration netConfig)
106106
ConnectionConfig cConfig = new ConnectionConfig();
107107

108108
//MLAPI channels and messageTypes
109-
NetworkConfig.Channels.Add("MLAPI_RELIABLE_FRAGMENTED_SEQUENCED", QosType.ReliableFragmentedSequenced);
109+
110+
//Legacy channel. ReliableFragmentedSequenced doesn't exist in older Unity versions.
111+
if(NetworkConfig.UseLegacyChannel)
112+
NetworkConfig.Channels.Add("MLAPI_RELIABLE_FRAGMENTED_SEQUENCED", QosType.ReliableSequenced);
113+
else
114+
NetworkConfig.Channels.Add("MLAPI_RELIABLE_FRAGMENTED_SEQUENCED", QosType.ReliableFragmentedSequenced);
115+
110116
NetworkConfig.Channels.Add("MLAPI_POSITION_UPDATE", QosType.StateUpdate);
111117
NetworkConfig.Channels.Add("MLAPI_ANIMATION_UPDATE", QosType.ReliableSequenced);
112118
MessageManager.messageTypes.Add("MLAPI_CONNECTION_REQUEST", 0);

0 commit comments

Comments
 (0)