From 1f49e7e4350298dad2e0a6e340b608a80a625e4b Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Thu, 30 Jul 2020 04:38:19 +0500 Subject: Network usage optimization --- src/Network.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Network.cpp') diff --git a/src/Network.cpp b/src/Network.cpp index bb92e7f..4280b50 100644 --- a/src/Network.cpp +++ b/src/Network.cpp @@ -98,7 +98,8 @@ void Network::SendPacket(Packet &packet, int compressionThreshold) { stream->WriteVarInt(packetSize.GetCountedSize()); stream->WriteVarInt(packet.GetPacketId()); packet.ToStream(stream.get()); - } + } + stream->Flush(); } std::shared_ptr Network::ReceivePacketByPacketId(int packetId, ConnectionState state, StreamInput &stream) { -- cgit v1.2.3