From 6a6f942f7f405215330d9dcebabfaa1c6446ce0b Mon Sep 17 00:00:00 2001 From: vis2k Date: Wed, 22 Aug 2018 15:06:11 +0200 Subject: [PATCH] LLAPITransport.ClientConnect: changed AddHost(topology) to AddHost(topology, 0) so it works in standalone AND webgl --- .../Runtime/Transport/LLAPITransport.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Unity-Technologies-networking/Runtime/Transport/LLAPITransport.cs b/Unity-Technologies-networking/Runtime/Transport/LLAPITransport.cs index ab3085246..13acd17cf 100644 --- a/Unity-Technologies-networking/Runtime/Transport/LLAPITransport.cs +++ b/Unity-Technologies-networking/Runtime/Transport/LLAPITransport.cs @@ -79,7 +79,11 @@ public bool ClientConnected() public void ClientConnect(string address, int port) { HostTopology hostTopology = new HostTopology(connectionConfig, 1); - clientId = NetworkTransport.AddHost(hostTopology); + + // important: + // AddHost(topology) doesn't work in WebGL. + // AddHost(topology, port) works in standalone and webgl if port=0 + clientId = NetworkTransport.AddHost(hostTopology, 0); clientConnectionId = NetworkTransport.Connect(clientId, address, port, 0, out error); NetworkError networkError = (NetworkError) error;