From 91b2d1a9bf2ccfc35f4fbcab1e2d9b301ef541de Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 6 Dec 2020 13:55:52 -0500 Subject: [PATCH] Fixed #3824 --- desktop/src/mindustry/desktop/steam/SNet.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/src/mindustry/desktop/steam/SNet.java b/desktop/src/mindustry/desktop/steam/SNet.java index 03a32297c6..1417ffc0b9 100644 --- a/desktop/src/mindustry/desktop/steam/SNet.java +++ b/desktop/src/mindustry/desktop/steam/SNet.java @@ -461,9 +461,10 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, writeBuffer.limit(writeBuffer.capacity()); writeBuffer.position(0); serializer.write(writeBuffer, object); + int length = writeBuffer.position(); writeBuffer.flip(); - snet.sendP2PPacket(sid, writeBuffer, mode == SendMode.tcp ? object instanceof StreamChunk ? P2PSend.ReliableWithBuffering : P2PSend.Reliable : P2PSend.UnreliableNoDelay, 0); + snet.sendP2PPacket(sid, writeBuffer, mode == SendMode.tcp || length >= 1200 ? object instanceof StreamChunk ? P2PSend.ReliableWithBuffering : P2PSend.Reliable : P2PSend.UnreliableNoDelay, 0); }catch(Exception e){ Log.err(e); Log.info("Error sending packet. Disconnecting invalid client!");