From edd6e1def37b163cc951480aadd67666b6dcb36b Mon Sep 17 00:00:00 2001 From: teascade Date: Sat, 8 Aug 2020 09:29:15 +0300 Subject: [PATCH] Try to fix the ancient package queue desync problem --- Assets/Scripts/TeaNet/Peers/ConnectionManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/TeaNet/Peers/ConnectionManager.cs b/Assets/Scripts/TeaNet/Peers/ConnectionManager.cs index 1a3fe93..47c0096 100644 --- a/Assets/Scripts/TeaNet/Peers/ConnectionManager.cs +++ b/Assets/Scripts/TeaNet/Peers/ConnectionManager.cs @@ -86,8 +86,8 @@ namespace NeonTea.Quakeball.TeaNet.Peers { Protocol protocol = Peer.GetProtocol(conn.Internal.AssignedProtocol); if (protocol != null && conn.IsReady()) { ByteBuffer buffer = protocol.BuildMessage(conn); - List list = PacketQueue[uid]; - buffer.Write(list.Count); + Packet[] list = PacketQueue[uid].ToArray(); + buffer.Write(list.Length); foreach (Packet p in list) { buffer.WritePacket(protocol, p); }