diff --git a/Common/Networking/Data/CompositeReader.cs b/Common/Networking/Data/CompositeReader.cs index ceb4a4e..185c731 100644 --- a/Common/Networking/Data/CompositeReader.cs +++ b/Common/Networking/Data/CompositeReader.cs @@ -27,7 +27,7 @@ internal static CompositeReader Create(ArraySegment data) public static implicit operator ArraySegment(CompositeReader cmpw) { - return new ArraySegment(cmpw._ms.GetBuffer(), 0, (int)cmpw._ms.Length); + return cmpw._data; } } } \ No newline at end of file diff --git a/Common/Networking/Peers/PeerBase.cs b/Common/Networking/Peers/PeerBase.cs index acd133c..f7cd443 100644 --- a/Common/Networking/Peers/PeerBase.cs +++ b/Common/Networking/Peers/PeerBase.cs @@ -662,18 +662,18 @@ internal async Task SendUserData(NetworkPacket packet) packet.ConnectionNumber = _connectNumber; int mergedPacketSize = NetConstants.HeaderSize + packet.Data.Count + 2; const int splitThreshold = 20; - if (mergedPacketSize + splitThreshold >= MaximumTransferUnit) - { + //if (mergedPacketSize + splitThreshold >= MaximumTransferUnit) + //{ NetDebug.Write("[P]SendingPacket: " + packet.Property); await PromulManager.RawSendAsync(packet, EndPoint); return; - } - if (_mergePos + mergedPacketSize > MaximumTransferUnit) await SendMerged(); - - FastBitConverter.GetBytes(_mergeData.Data.Array, _mergeData.Data.Offset+_mergePos + NetConstants.HeaderSize, (ushort)packet.Data.Count); - packet.Data.CopyTo(_mergeData.Data.Array, _mergeData.Data.Offset+_mergePos+NetConstants.HeaderSize+2); - _mergePos += packet.Data.Count + 2; - _mergeCount++; + //} + // if (_mergePos + mergedPacketSize > MaximumTransferUnit) await SendMerged(); + // + // FastBitConverter.GetBytes(_mergeData.Data.Array, _mergeData.Data.Offset+_mergePos + NetConstants.HeaderSize, (ushort)packet.Data.Count); + // packet.Data.CopyTo(_mergeData.Data.Array, _mergeData.Data.Offset+_mergePos+NetConstants.HeaderSize+2); + // _mergePos += packet.Data.Count + 2; + // _mergeCount++; } private async Task SendMerged() diff --git a/Runtime/PromulTransport.cs b/Runtime/PromulTransport.cs index b087319..ab4dd78 100644 --- a/Runtime/PromulTransport.cs +++ b/Runtime/PromulTransport.cs @@ -77,7 +77,7 @@ public async Task SendControl(RelayControlMessage rcm, NetworkDelivery qos) public override void Send(ulong clientId, ArraySegment data, NetworkDelivery qos) { - Debug.Log("Sending: " + string.Join(" ", data.Select(e => e.ToString("X")))); + Debug.Log("Sending to " + clientId + ": " + string.Join(" ", data.Select(e => e.ToString("X2")))); Task.Run(async () => { await SendControl(new RelayControlMessage