diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-08-02 14:43:49 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-08-02 14:43:49 +1000 |
commit | 856e93be3f1a443db2679ad7db9f6890a9b4d936 (patch) | |
tree | 196336b2f821b8c4b07d1c15925978cec5700bff /source/game/StarWorldClient.cpp | |
parent | b318e981e3f454941d3de07a018adb485238fbb9 (diff) |
Skip packet compression on Voice packets
cause 99% of the data is already compressed by Opus
Diffstat (limited to 'source/game/StarWorldClient.cpp')
-rw-r--r-- | source/game/StarWorldClient.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp index f9ad833..24199c3 100644 --- a/source/game/StarWorldClient.cpp +++ b/source/game/StarWorldClient.cpp @@ -2013,7 +2013,7 @@ void WorldClient::connectWire(WireConnection const& output, WireConnection const m_outgoingPackets.append(make_shared<ConnectWirePacket>(output, input)); } -bool WorldClient::sendSecretBroadcast(StringView broadcast, bool raw) { +bool WorldClient::sendSecretBroadcast(StringView broadcast, bool raw, bool compress) { if (!inWorld() || !m_mainPlayer || !m_mainPlayer->getSecretPropertyView(SECRET_BROADCAST_PUBLIC_KEY)) return false; @@ -2030,6 +2030,9 @@ bool WorldClient::sendSecretBroadcast(StringView broadcast, bool raw) { dmg.targetMaterialKind = raw ? broadcast : strf("{}{}{}", SECRET_BROADCAST_PREFIX, StringView((char*)&signature, sizeof(signature)), broadcast); dmg.position = m_mainPlayer->position(); + if (!compress) + damageNotification->setCompressionMode(PacketCompressionMode::Disabled); + m_outgoingPackets.emplace_back(move(damageNotification)); return true; } |