mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkConnection.ValidatePacketSize: syntax
This commit is contained in:
parent
d818b2d4aa
commit
227efb6c7a
@ -133,9 +133,10 @@ public void Send<T>(T msg, int channelId = Channels.Reliable)
|
||||
// => it's important to log errors, so the user knows what went wrong.
|
||||
protected static bool ValidatePacketSize(ArraySegment<byte> segment, int channelId)
|
||||
{
|
||||
if (segment.Count > Transport.activeTransport.GetMaxPacketSize(channelId))
|
||||
int max = Transport.activeTransport.GetMaxPacketSize(channelId);
|
||||
if (segment.Count > max)
|
||||
{
|
||||
Debug.LogError($"NetworkConnection.ValidatePacketSize: cannot send packet larger than {Transport.activeTransport.GetMaxPacketSize(channelId)} bytes, was {segment.Count} bytes");
|
||||
Debug.LogError($"NetworkConnection.ValidatePacketSize: cannot send packet larger than {max} bytes, was {segment.Count} bytes");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user