Riptide
Riptide copied to clipboard
Client.Connect Lag
Hi. i use unity 6
i have Problem With connect function lag rpitide 2.2.0
Deep profile it and see what exactly inside the Connect call is causing it.
hi
in Client.cs
public bool Connect(string hostAddress, int maxConnectionAttempts = 5, byte messageHandlerGroupId = 0, Message message = null, bool useMessageHandlers = true)
if (useMessageHandlers)
CreateMessageHandlersDictionary(messageHandlerGroupId);
must change to
if (useMessageHandlers && (messageHandlers == null || messageHandlers.Count == 0))
{
CreateMessageHandlersDictionary(messageHandlerGroupId);
}
That would just make the allocations only happen on the first Connect call though, which is where it's arguably the most important to avoid/reduce them...