From d93c2073896e63aca5a859fe7182ba24dbe84cd3 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 28 May 2017 19:16:05 +0500 Subject: 2017-05-28 --- src/network/Network.cpp | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) (limited to 'src/network/Network.cpp') diff --git a/src/network/Network.cpp b/src/network/Network.cpp index ac84494..b3b1e4b 100644 --- a/src/network/Network.cpp +++ b/src/network/Network.cpp @@ -57,8 +57,8 @@ Packet Network::ReceivePacket() { } Field fLen = FieldParser::Parse(VarInt, bufLen); size_t packetLen = fLen.GetVarInt() + fLen.GetLength(); - if (packetLen > 1024 * 1024 * 30) - std::cout << "OMG! SIZEOF PACKET IS " << packetLen << std::endl; + if (packetLen > 1024 * 1024 * 15) + LOG(WARNING)<<"OMG SIZEOF PACKAGE IS "< 0; i--) - if (bufPack[i] == 'N') - losted++; - if (losted > 100) { - if (m_socket.receive(bufPack + rec, packetLen - rec, rec) != sf::Socket::Done) { - throw 93; - } - std::cout << "Keep receiving!" << std::endl; - } - //One more time - losted = 0; - for (int i = packetLen - 2; i > 0; i--) - if (bufPack[i] == 'N') - losted++; - if (losted > 100) { - std::cout << "\x1b[31m" << "Losted " << losted << " bytes of " << packetLen << "\x1b[0m" << std::endl; - delete[] bufPack; - throw 93; - }*/ - throw 94; } -- cgit v1.2.3