]> git.deb.at Git - rhonda/impostor.hazel.git/commitdiff
A little tidy
authorForest <forest@innersloth.com>
Sat, 31 Oct 2020 22:31:26 +0000 (15:31 -0700)
committerForest <forest@innersloth.com>
Sat, 31 Oct 2020 22:31:57 +0000 (15:31 -0700)
Hazel/Udp/UdpConnection.Reliable.cs
Hazel/Udp/UdpConnection.cs

index 649f166e1dbac6a07b1572e9f6578750df4a0c8f..01ab48820963cb6cba7d2bcd524272d1955a1687 100644 (file)
@@ -221,7 +221,7 @@ namespace Hazel.Udp
         /// <param name="buffer">The buffer to attach to.</param>
         /// <param name="offset">The offset to attach at.</param>
         /// <param name="ackCallback">The callback to make once the packet has been acknowledged.</param>
-        protected void AttachReliableID(byte[] buffer, int offset, int sendLength, Action ackCallback = null)
+        protected void AttachReliableID(byte[] buffer, int offset, Action ackCallback = null)
         {
             ushort id = (ushort)Interlocked.Increment(ref lastIDAllocated);
 
@@ -233,7 +233,7 @@ namespace Hazel.Udp
                 id,
                 this,
                 buffer,
-                sendLength,
+                buffer.Length,
                 ResendTimeout > 0 ? ResendTimeout : (int)Math.Min(AveragePingMs * this.ResendPingMultiplier, 300),
                 ackCallback);
 
@@ -267,7 +267,7 @@ namespace Hazel.Udp
             bytes[0] = sendOption;
 
             //Add reliable ID
-            AttachReliableID(bytes, 1, bytes.Length, ackCallback);
+            AttachReliableID(bytes, 1, ackCallback);
 
             //Copy data into new array
             Buffer.BlockCopy(data, 0, bytes, bytes.Length - data.Length, data.Length);
index d22542de365bebc99560c7d3b543657a1423d67e..c2de019b8bf9c5c7575282979bb41c3210cb0f16 100644 (file)
@@ -66,7 +66,7 @@ namespace Hazel.Udp
                 case SendOption.Reliable:
                     ResetKeepAliveTimer();
 
-                    AttachReliableID(buffer, 1, buffer.Length);
+                    AttachReliableID(buffer, 1);
                     WriteBytesToConnection(buffer, buffer.Length);
                     Statistics.LogReliableSend(buffer.Length - 3, buffer.Length);
                     break;