tanghai 3 лет назад
Родитель
Сommit
e2d3aa7671
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      Unity/Assets/Mono/Module/NetworkTCP/WChannel.cs

+ 2 - 2
Unity/Assets/Mono/Module/NetworkTCP/WChannel.cs

@@ -88,8 +88,8 @@ namespace ET
 
         public void Send(MemoryStream stream)
         {
-            byte[] bytes = new byte[stream.Length];
-            Array.Copy(stream.GetBuffer(), bytes, bytes.Length);
+            byte[] bytes = new byte[stream.Length - stream.Position];
+            Array.Copy(stream.GetBuffer(), stream.Position, bytes, 0, bytes.Length);
             this.queue.Enqueue(bytes);
 
             if (this.isConnected)