Skip to content

Commit c65fb75

Browse files
committed
feat(transport): Added UNET user channels
1 parent c3a6f5b commit c65fb75

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

MLAPI/Data/Transports/UNET/UnetTransport.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public class UnetTransport : Transport
1717
public int ServerListenPort = 7777;
1818
public int ServerWebsocketListenPort = 8887;
1919
public bool SupportWebsocket = false;
20+
public List<TransportChannel> Channels = new List<TransportChannel>();
21+
2022

2123
// Relay
2224
public bool UseMLAPIRelay = false;
@@ -262,6 +264,14 @@ public ConnectionConfig GetConfig()
262264
channelNameToId.Add(MLAPI_CHANNELS[i].Name, channelId);
263265
}
264266

267+
for (int i = 0; i < Channels.Count; i++)
268+
{
269+
int channelId = AddChannel(Channels[i].Type, config);
270+
271+
channelIdToName.Add(channelId, Channels[i].Name);
272+
channelNameToId.Add(Channels[i].Name, channelId);
273+
}
274+
265275
return config;
266276
}
267277

0 commit comments

Comments
 (0)