From be7e2f1616036a9a23342b2b018f92fceda81792 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 12 Nov 2020 01:33:35 +0100 Subject: [PATCH] =?UTF-8?q?possible=20fix=20for=20ping=3D=3F?= --- src/Network/InitClient.cpp | 16 ++++++++++------ src/Network/VehicleData.cpp | 4 ---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Network/InitClient.cpp b/src/Network/InitClient.cpp index 83c8ad5..3a19e01 100644 --- a/src/Network/InitClient.cpp +++ b/src/Network/InitClient.cpp @@ -23,14 +23,18 @@ int OpenID(){ }while (!found); return ID; } -void Respond(Client*c, const std::string& MSG, bool Rel){ +void Respond(Client* c, const std::string& MSG, bool Rel) { Assert(c); char C = MSG.at(0); - if(Rel || C == 'W' || C == 'Y' || C == 'V' || C == 'E'){ - if(C == 'O' || C == 'T' || MSG.length() > 1000)SendLarge(c,MSG); - else TCPSend(c,MSG); - }else UDPSend(c,MSG); - + if (Rel || C == 'W' || C == 'Y' || C == 'V' || C == 'E') { + if (C == 'O' || C == 'T' || MSG.length() > 1000) { + SendLarge(c, MSG); + } else { + TCPSend(c, MSG); + } + } else { + UDPSend(c, MSG); + } } void SendToAll(Client*c, const std::string& Data, bool Self, bool Rel){ if (!Self)Assert(c); diff --git a/src/Network/VehicleData.cpp b/src/Network/VehicleData.cpp index 893049c..f775bbb 100644 --- a/src/Network/VehicleData.cpp +++ b/src/Network/VehicleData.cpp @@ -172,10 +172,6 @@ std::string UDPRcvFromClient(sockaddr_in& client) { #endif // WIN32 return ""; } - Ret = Ret.substr(0,Rcv); - if(Ret.find("Zp") != std::string::npos && Ret.size() > 500){ - abort(); - } return Ret.substr(0,Rcv); }