mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-03 06:16:15 +00:00
switch to compression with limit at 30 MB
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
/// Created by Anonymous275 on 7/25/2020
|
||||
///
|
||||
#include "Network/network.hpp"
|
||||
#include <zlib.h>
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
@@ -93,6 +94,8 @@ void ServerSend(std::string Data, bool Rel) {
|
||||
Ack = true;
|
||||
if (C == 'N' || C == 'W' || C == 'Y' || C == 'V' || C == 'E' || C == 'C')
|
||||
Rel = true;
|
||||
if (compressBound(Data.size()) > 1024)
|
||||
Rel = true;
|
||||
if (Ack || Rel) {
|
||||
if (Ack || DLen > 1000)
|
||||
SendLarge(Data);
|
||||
@@ -296,4 +299,4 @@ void TCPGameServer(const std::string& IP, int Port) {
|
||||
if (CSocket != SOCKET_ERROR)
|
||||
KillSocket(CSocket);
|
||||
debug("END OF GAME SERVER");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user