Try to fix the ancient package queue desync problem

This commit is contained in:
Sofia 2020-08-08 09:29:15 +03:00
parent e3dfb3aa61
commit edd6e1def3

View File

@ -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<Packet> 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);
}