Skip to content

Commit

Permalink
Fixed issue preventing internal handshake to be sent
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoTenPvP committed Mar 21, 2018
1 parent 9508233 commit 75fd623
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions MLAPI/MonoBehaviours/Core/NetworkingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ private void Update()
writer.Write(NetworkConfig.ConnectionData);
}
}
Send(clientId, "MLAPI_CONNECTION_REQUEST", "MLAPI_INTERNAL", writeStream.GetBuffer());
Send(clientId, "MLAPI_CONNECTION_REQUEST", "MLAPI_INTERNAL", writeStream.GetBuffer(), null, true);
}
}
break;
Expand Down Expand Up @@ -866,7 +866,7 @@ internal void PassthroughSend(int targetId, int sourceId, ushort messageType, in
}
}

internal void Send(int clientId, string messageType, string channelName, byte[] data, uint? networkId = null)
internal void Send(int clientId, string messageType, string channelName, byte[] data, uint? networkId = null, bool skipQueue = false)
{
if(clientId == -1 && isHost)
{
Expand Down Expand Up @@ -910,7 +910,10 @@ internal void Send(int clientId, string messageType, string channelName, byte[]
}
if (isPassthrough)
clientId = serverClientId;
NetworkTransport.QueueMessageForSending(hostId, clientId, MessageManager.channels[channelName], stream.GetBuffer(), sizeOfStream, out error);
if (skipQueue)
NetworkTransport.Send(hostId, clientId, MessageManager.channels[channelName], stream.GetBuffer(), sizeOfStream, out error);
else
NetworkTransport.QueueMessageForSending(hostId, clientId, MessageManager.channels[channelName], stream.GetBuffer(), sizeOfStream, out error);
}
}

Expand Down Expand Up @@ -1185,7 +1188,7 @@ private void HandleApproval(int clientId, bool approved)
}
}
}
Send(clientId, "MLAPI_CONNECTION_APPROVED", "MLAPI_INTERNAL", writeStream.GetBuffer());
Send(clientId, "MLAPI_CONNECTION_APPROVED", "MLAPI_INTERNAL", writeStream.GetBuffer(), null, true);
}

//Inform old clients of the new player
Expand Down

0 comments on commit 75fd623

Please sign in to comment.