mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 15:36:10 +00:00
fix compiler error in decomp
This commit is contained in:
parent
e46d4b2f0e
commit
1f7c498bd9
@ -9,5 +9,5 @@
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
std::vector<char> Comp(std::span<char> input);
|
||||
std::vector<char> DeComp(std::span<char> input);
|
||||
std::vector<char> Comp(std::span<const char> input);
|
||||
std::vector<char> DeComp(std::span<const char> input);
|
||||
|
@ -15,14 +15,14 @@
|
||||
#include <cstring>
|
||||
#endif
|
||||
|
||||
std::vector<char> Comp(std::span<char> input) {
|
||||
std::vector<char> Comp(std::span<const char> input) {
|
||||
auto max_size = compressBound(input.size());
|
||||
std::vector<char> output(max_size);
|
||||
uLongf output_size = output.size();
|
||||
int res = compress(
|
||||
reinterpret_cast<Bytef*>(output.data()),
|
||||
&output_size,
|
||||
reinterpret_cast<Bytef*>(input.data()),
|
||||
reinterpret_cast<const Bytef*>(input.data()),
|
||||
static_cast<uLongf>(input.size()));
|
||||
if (res != Z_OK) {
|
||||
error("zlib compress() failed: " + std::to_string(res));
|
||||
@ -33,7 +33,7 @@ std::vector<char> Comp(std::span<char> input) {
|
||||
return output;
|
||||
}
|
||||
|
||||
std::vector<char> DeComp(std::span<char> input) {
|
||||
std::vector<char> DeComp(std::span<const char> input) {
|
||||
std::vector<char> output_buffer(std::min<size_t>(input.size() * 5, 15 * 1024 * 1024));
|
||||
|
||||
uLongf output_size = output_buffer.size();
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "linuxfixes.h"
|
||||
#include <arpa/inet.h>
|
||||
#include <cstring>
|
||||
#include <errno.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
@ -22,7 +21,6 @@
|
||||
|
||||
#include "Logger.h"
|
||||
#include <array>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
SOCKET UDPSock = -1;
|
||||
@ -52,7 +50,7 @@ void SendLarge(std::string Data) {
|
||||
void UDPParser(std::string_view Packet) {
|
||||
if (Packet.substr(0, 4) == "ABG:") {
|
||||
auto substr = Packet.substr(4);
|
||||
auto res = DeComp(std::span<char>(substr.data(), substr.size()));
|
||||
auto res = DeComp(std::span<const char>(substr.data(), substr.size()));
|
||||
Packet = std::string(res.data(), res.size());
|
||||
}
|
||||
ServerParser(Packet);
|
||||
|
Loading…
x
Reference in New Issue
Block a user