private void ServerPacketsForClientsClean() { PacketsToClient.Clear(); foreach (var pInfo in PrunedPacketsToClient.Values) { switch (pInfo.Packet.PType) { case PacketType.AiData: { var iPacket = (AiDataPacket)pInfo.Packet; PacketAiPool.Return(iPacket); break; } case PacketType.CompBase: { var iPacket = (CompBasePacket)pInfo.Packet; PacketCompBasePool.Return(iPacket); break; } case PacketType.CompState: { var iPacket = (CompStatePacket)pInfo.Packet; PacketStatePool.Return(iPacket); break; } case PacketType.TargetChange: { var iPacket = (TargetPacket)pInfo.Packet; PacketTargetPool.Return(iPacket); break; } case PacketType.WeaponReload: { var iPacket = (WeaponReloadPacket)pInfo.Packet; PacketReloadPool.Return(iPacket); break; } case PacketType.Construct: { var iPacket = (ConstructPacket)pInfo.Packet; PacketConstructPool.Return(iPacket); break; } case PacketType.ConstructFoci: { var iPacket = (ConstructFociPacket)pInfo.Packet; PacketConstructFociPool.Return(iPacket); break; } case PacketType.WeaponAmmo: { var iPacket = (WeaponAmmoPacket)pInfo.Packet; PacketAmmoPool.Return(iPacket); break; } } } PrunedPacketsToClient.Clear(); }