Launcher update to 1.63.5

- async tcp buffer
- two way encryption on connect
- map security fix
- DNS Lookup on connect
- fixed bug in beamng security
This commit is contained in:
Anonymous275
2020-10-16 17:10:12 +03:00
parent ccdbc51b30
commit 7da9f4fcd2
17 changed files with 340 additions and 134 deletions

View File

@@ -15,22 +15,20 @@ void TCPSend(const std::string&Data){
Terminate = true;
return;
}
int BytesSent = send(TCPSock, Data.c_str(), int(Data.length())+1, 0);
if (BytesSent == 0){
std::string Send = "\n" + Data.substr(0,Data.find(char(0))) + "\n";
size_t Sent = send(TCPSock, Send.c_str(), int(Send.size()), 0);
if (Sent == 0){
debug(Sec("(TCP) Connection closing..."));
Terminate = true;
return;
}
else if (BytesSent < 0) {
else if (Sent < 0) {
debug(Sec("(TCP) send failed with error: ") + std::to_string(WSAGetLastError()));
closesocket(TCPSock);
Terminate = true;
return;
}
}
void ServerParser(const std::string& Data);
void TCPRcv(){
char buf[4096];
int len = 4096;
@@ -51,7 +49,7 @@ void TCPRcv(){
Terminate = true;
return;
}
ServerParser(std::string(buf));
Handler.Handle(std::string(buf));
}
void SyncResources(SOCKET TCPSock);