summaryrefslogtreecommitdiffstats
path: root/src/core/internal_network
diff options
context:
space:
mode:
authorFearlessTobi <thm.frey@gmail.com>2022-07-31 04:46:26 +0200
committerFearlessTobi <thm.frey@gmail.com>2022-09-09 14:30:22 +0200
commitf5e635addaef59159bf6bc529b17954eda3684a1 (patch)
tree6d6b518611b377b6bd79e3156eb16f60f5045698 /src/core/internal_network
parentMerge pull request #8819 from liamwhite/cash-money (diff)
downloadyuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar
yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.gz
yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.bz2
yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.lz
yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.xz
yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.zst
yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.zip
Diffstat (limited to 'src/core/internal_network')
-rw-r--r--src/core/internal_network/socket_proxy.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/internal_network/socket_proxy.cpp b/src/core/internal_network/socket_proxy.cpp
index 0c746bd82..7d5d37bbc 100644
--- a/src/core/internal_network/socket_proxy.cpp
+++ b/src/core/internal_network/socket_proxy.cpp
@@ -6,6 +6,7 @@
#include "common/assert.h"
#include "common/logging/log.h"
+#include "common/zstd_compression.h"
#include "core/internal_network/network.h"
#include "core/internal_network/network_interface.h"
#include "core/internal_network/socket_proxy.h"
@@ -32,8 +33,11 @@ void ProxySocket::HandleProxyPacket(const ProxyPacket& packet) {
return;
}
+ auto decompressed = packet;
+ decompressed.data = Common::Compression::DecompressDataZSTD(packet.data);
+
std::lock_guard guard(packets_mutex);
- received_packets.push(packet);
+ received_packets.push(decompressed);
}
template <typename T>
@@ -185,6 +189,8 @@ std::pair<s32, Errno> ProxySocket::Send(const std::vector<u8>& message, int flag
void ProxySocket::SendPacket(ProxyPacket& packet) {
if (auto room_member = room_network.GetRoomMember().lock()) {
if (room_member->IsConnected()) {
+ packet.data = Common::Compression::CompressDataZSTDDefault(packet.data.data(),
+ packet.data.size());
room_member->SendProxyPacket(packet);
}
}