Skip to content

Commit 75fd623

Browse files
committed
Fixed issue preventing internal handshake to be sent
1 parent 9508233 commit 75fd623

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

MLAPI/MonoBehaviours/Core/NetworkingManager.cs

+7-4
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ private void Update()
369369
writer.Write(NetworkConfig.ConnectionData);
370370
}
371371
}
372-
Send(clientId, "MLAPI_CONNECTION_REQUEST", "MLAPI_INTERNAL", writeStream.GetBuffer());
372+
Send(clientId, "MLAPI_CONNECTION_REQUEST", "MLAPI_INTERNAL", writeStream.GetBuffer(), null, true);
373373
}
374374
}
375375
break;
@@ -866,7 +866,7 @@ internal void PassthroughSend(int targetId, int sourceId, ushort messageType, in
866866
}
867867
}
868868

869-
internal void Send(int clientId, string messageType, string channelName, byte[] data, uint? networkId = null)
869+
internal void Send(int clientId, string messageType, string channelName, byte[] data, uint? networkId = null, bool skipQueue = false)
870870
{
871871
if(clientId == -1 && isHost)
872872
{
@@ -910,7 +910,10 @@ internal void Send(int clientId, string messageType, string channelName, byte[]
910910
}
911911
if (isPassthrough)
912912
clientId = serverClientId;
913-
NetworkTransport.QueueMessageForSending(hostId, clientId, MessageManager.channels[channelName], stream.GetBuffer(), sizeOfStream, out error);
913+
if (skipQueue)
914+
NetworkTransport.Send(hostId, clientId, MessageManager.channels[channelName], stream.GetBuffer(), sizeOfStream, out error);
915+
else
916+
NetworkTransport.QueueMessageForSending(hostId, clientId, MessageManager.channels[channelName], stream.GetBuffer(), sizeOfStream, out error);
914917
}
915918
}
916919

@@ -1185,7 +1188,7 @@ private void HandleApproval(int clientId, bool approved)
11851188
}
11861189
}
11871190
}
1188-
Send(clientId, "MLAPI_CONNECTION_APPROVED", "MLAPI_INTERNAL", writeStream.GetBuffer());
1191+
Send(clientId, "MLAPI_CONNECTION_APPROVED", "MLAPI_INTERNAL", writeStream.GetBuffer(), null, true);
11891192
}
11901193

11911194
//Inform old clients of the new player

0 commit comments

Comments
 (0)