diff --git a/Engine/Plugins/Messaging/UdpMessaging/Source/UdpMessaging/Private/Transport/UdpMessageProcessor.cpp b/Engine/Plugins/Messaging/UdpMessaging/Source/UdpMessaging/Private/Transport/UdpMessageProcessor.cpp index 85f0d43da3cc..ee26e48d9cfc 100644 --- a/Engine/Plugins/Messaging/UdpMessaging/Source/UdpMessaging/Private/Transport/UdpMessageProcessor.cpp +++ b/Engine/Plugins/Messaging/UdpMessaging/Source/UdpMessaging/Private/Transport/UdpMessageProcessor.cpp @@ -994,15 +994,15 @@ void FUdpMessageProcessor::SendKnownNodesToKnownNodes() const int32 NumEndpointsCanSend = (UDP_MESSAGING_SEGMENT_SIZE - sizeof(FUdpMessageSegment::FHeader)) / (sizeof(FIPv4Endpoint) + sizeof(FGuid)) - 1; if (KnownEndpointsView.Num() > NumEndpointsCanSend) { - UE_LOG(LogUdpMessaging, Warning, TEXT("FUdpMessageProcessor::SendKnownNodesToKnownNodes large number of endpoints to share for meshing udp transport.")); + UE_LOG(LogUdpMessaging, Warning, TEXT("FUdpMessageProcessor::SendKnownNodesToKnownNodes large number of endpoints (%d) to share for meshing udp transport."), KnownEndpointsView.Num()); } int32 Index = 0; while (Index < KnownEndpointsView.Num()) { - const uint32 NextBlockIndex = FMath::Min(Index + NumEndpointsCanSend, KnownEndpointsView.Num()); - TArrayView SlicedEndpointView = KnownEndpointsView.Slice(Index, NextBlockIndex); - TArrayView SlicedIdView = KnownIdView.Slice(Index, NextBlockIndex); + const uint32 NextBlockItemCount = FMath::Min(Index + NumEndpointsCanSend, KnownEndpointsView.Num() - Index); + TArrayView SlicedEndpointView = KnownEndpointsView.Slice(Index, NextBlockItemCount); + TArrayView SlicedIdView = KnownIdView.Slice(Index, NextBlockItemCount); OutEndpoints = SlicedEndpointView; OutIds = SlicedIdView;