LLAPITransport.ClientConnect: changed AddHost(topology) to AddHost(topology, 0) so it works in standalone AND webgl

This commit is contained in:
vis2k 2018-08-22 15:06:11 +02:00
parent aa2c004615
commit 6a6f942f7f

View File

@ -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;