diff options
author | Hartmnt <hartmunt@protonmail.com> | 2022-09-05 19:47:15 +0300 |
---|---|---|
committer | Hartmnt <hartmunt@protonmail.com> | 2022-09-08 11:47:39 +0300 |
commit | bacb371f833bb6863b6bbdb43c2894b89750feb1 (patch) | |
tree | 5676079417ab2bf57d5b5a78cd8f5ab813dd6f53 /src/murmur | |
parent | 6dd2b31974a48dfb3839bc1ef1bc29674ec7ed9d (diff) |
REFAC(client, server): Rename uiVersion to m_version
Renames the internal version member variables from "uiVersion"
to "m_version"
Diffstat (limited to 'src/murmur')
-rw-r--r-- | src/murmur/AudioReceiverBuffer.cpp | 6 | ||||
-rw-r--r-- | src/murmur/AudioReceiverBuffer.h | 4 | ||||
-rw-r--r-- | src/murmur/Messages.cpp | 20 | ||||
-rw-r--r-- | src/murmur/MurmurIce.cpp | 4 | ||||
-rw-r--r-- | src/murmur/Server.cpp | 10 | ||||
-rw-r--r-- | src/murmur/ServerUser.cpp | 2 | ||||
-rw-r--r-- | src/murmur/ServerUser.h | 2 |
7 files changed, 24 insertions, 24 deletions
diff --git a/src/murmur/AudioReceiverBuffer.cpp b/src/murmur/AudioReceiverBuffer.cpp index f27217157..e8330ceb5 100644 --- a/src/murmur/AudioReceiverBuffer.cpp +++ b/src/murmur/AudioReceiverBuffer.cpp @@ -135,9 +135,9 @@ void AudioReceiverBuffer::preprocessBuffer(std::vector< AudioReceiver > &receive // Note: The list doesn't contains any duplicate receivers std::sort(receiverList.begin(), receiverList.end(), [](const AudioReceiver &lhs, const AudioReceiver &rhs) { // 1. Sort into block of compatible protocol versions - if (!Mumble::Protocol::protocolVersionsAreCompatible(lhs.getReceiver().uiVersion, - rhs.getReceiver().uiVersion)) { - return lhs.getReceiver().uiVersion < rhs.getReceiver().uiVersion; + if (!Mumble::Protocol::protocolVersionsAreCompatible(lhs.getReceiver().m_version, + rhs.getReceiver().m_version)) { + return lhs.getReceiver().m_version < rhs.getReceiver().m_version; } // 2. Within each block, sort based on the audio context diff --git a/src/murmur/AudioReceiverBuffer.h b/src/murmur/AudioReceiverBuffer.h index b5d6d9822..71a6f54e4 100644 --- a/src/murmur/AudioReceiverBuffer.h +++ b/src/murmur/AudioReceiverBuffer.h @@ -80,8 +80,8 @@ public: // the exact same audio packet (thus: no re-encoding required between sending the packet to them). range.end = std::lower_bound(begin, end, *begin, [](const AudioReceiver &lhs, const AudioReceiver &rhs) { return lhs.getContext() == rhs.getContext() - && Mumble::Protocol::protocolVersionsAreCompatible(lhs.getReceiver().uiVersion, - rhs.getReceiver().uiVersion) + && Mumble::Protocol::protocolVersionsAreCompatible(lhs.getReceiver().m_version, + rhs.getReceiver().m_version) // Allow a little variance between volume adjustments && std::abs(lhs.getVolumeAdjustment().factor - rhs.getVolumeAdjustment().factor) < 0.05f; }); diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp index 7914a5927..486a22946 100644 --- a/src/murmur/Messages.cpp +++ b/src/murmur/Messages.cpp @@ -71,7 +71,7 @@ { \ MumbleProto::PermissionDenied mppd; \ mppd.set_type(MumbleProto::PermissionDenied_DenyType_##type); \ - if (uSource->uiVersion < version) \ + if (uSource->m_version < version) \ mppd.set_reason(u8(text)); \ sendMessage(uSource, mppd); \ } @@ -361,7 +361,7 @@ void Server::msgAuthenticate(ServerUser *uSource, MumbleProto::Authenticate &msg mpcs.set_position(c->iPosition); - if ((uSource->uiVersion >= Version::fromComponents(1, 2, 2)) && !c->qbaDescHash.isEmpty()) + if ((uSource->m_version >= Version::fromComponents(1, 2, 2)) && !c->qbaDescHash.isEmpty()) mpcs.set_description_hash(blob(c->qbaDescHash)); else if (!c->qsDesc.isEmpty()) mpcs.set_description(u8(c->qsDesc)); @@ -449,7 +449,7 @@ void Server::msgAuthenticate(ServerUser *uSource, MumbleProto::Authenticate &msg mpus.set_name(u8(u->qsName)); if (u->iId >= 0) mpus.set_user_id(u->iId); - if (uSource->uiVersion >= Version::fromComponents(1, 2, 2)) { + if (uSource->m_version >= Version::fromComponents(1, 2, 2)) { if (!u->qbaTextureHash.isEmpty()) mpus.set_texture_hash(blob(u->qbaTextureHash)); else if (!u->qbaTexture.isEmpty()) @@ -476,7 +476,7 @@ void Server::msgAuthenticate(ServerUser *uSource, MumbleProto::Authenticate &msg mpus.set_self_deaf(true); else if (u->bSelfMute) mpus.set_self_mute(true); - if ((uSource->uiVersion >= Version::fromComponents(1, 2, 2)) && !u->qbaCommentHash.isEmpty()) + if ((uSource->m_version >= Version::fromComponents(1, 2, 2)) && !u->qbaCommentHash.isEmpty()) mpus.set_comment_hash(blob(u->qbaCommentHash)); else if (!u->qsComment.isEmpty()) mpus.set_comment(u8(u->qsComment)); @@ -532,7 +532,7 @@ void Server::msgAuthenticate(ServerUser *uSource, MumbleProto::Authenticate &msg sendMessage(uSource, mpsug); } - if (uSource->uiVersion < Version::fromComponents(1, 4, 0) && Meta::mp.iMaxListenersPerChannel != 0 + if (uSource->m_version < Version::fromComponents(1, 4, 0) && Meta::mp.iMaxListenersPerChannel != 0 && Meta::mp.iMaxListenerProxiesPerUser != 0) { // The server has the ChannelListener feature enabled but the client that connects doesn't have version 1.4.0 or // newer meaning that this client doesn't know what ChannelListeners are. Thus we'll send that user a @@ -1930,7 +1930,7 @@ void Server::msgVersion(ServerUser *uSource, MumbleProto::Version &msg) { RATELIMIT(uSource); - uSource->uiVersion = MumbleProto::getVersion(msg); + uSource->m_version = MumbleProto::getVersion(msg); if (msg.has_release()) { uSource->qsRelease = convertWithSizeRestriction(msg.release(), 100); } @@ -1943,7 +1943,7 @@ void Server::msgVersion(ServerUser *uSource, MumbleProto::Version &msg) { } log(uSource, QString("Client version %1 (%2 %3: %4)") - .arg(Version::toString(uSource->uiVersion)) + .arg(Version::toString(uSource->m_version)) .arg(uSource->qsOS) .arg(uSource->qsOSVersion) .arg(uSource->qsRelease)); @@ -2015,7 +2015,7 @@ void Server::msgUserList(ServerUser *uSource, MumbleProto::UserList &msg) { } else { MumbleProto::PermissionDenied mppd; mppd.set_type(MumbleProto::PermissionDenied_DenyType_UserName); - if (uSource->uiVersion < Version::fromComponents(1, 2, 1)) + if (uSource->m_version < Version::fromComponents(1, 2, 1)) mppd.set_reason(u8(QString::fromLatin1("%1 is not a valid username").arg(name))); else mppd.set_name(u8(name)); @@ -2147,8 +2147,8 @@ void Server::msgUserStats(ServerUser *uSource, MumbleProto::UserStats &msg) { MumbleProto::Version *mpv; mpv = msg.mutable_version(); - if (pDstServerUser->uiVersion != Version::UNKNOWN) { - MumbleProto::setVersion(*mpv, pDstServerUser->uiVersion); + if (pDstServerUser->m_version != Version::UNKNOWN) { + MumbleProto::setVersion(*mpv, pDstServerUser->m_version); } if (!pDstServerUser->qsRelease.isEmpty()) { mpv->set_release(u8(pDstServerUser->qsRelease)); diff --git a/src/murmur/MurmurIce.cpp b/src/murmur/MurmurIce.cpp index 900694b9e..928033f91 100644 --- a/src/murmur/MurmurIce.cpp +++ b/src/murmur/MurmurIce.cpp @@ -112,8 +112,8 @@ static void userToUser(const ::User *p, Murmur::User &mp) { const ServerUser *u = static_cast< const ServerUser * >(p); mp.onlinesecs = u->bwr.onlineSeconds(); mp.bytespersec = u->bwr.bandwidth(); - mp.version2 = u->uiVersion; - mp.version = Version::toLegacyVersion(u->uiVersion); + mp.version2 = u->m_version; + mp.version = Version::toLegacyVersion(u->m_version); mp.release = iceString(u->qsRelease); mp.os = iceString(u->qsOS); mp.osversion = iceString(u->qsOSVersion); diff --git a/src/murmur/Server.cpp b/src/murmur/Server.cpp index cca8a9940..c98972543 100644 --- a/src/murmur/Server.cpp +++ b/src/murmur/Server.cpp @@ -863,7 +863,7 @@ void Server::run() { ServerUser *u = qhPeerUsers.value(key); if (u) { - m_udpDecoder.setProtocolVersion(u->uiVersion); + m_udpDecoder.setProtocolVersion(u->m_version); } else { m_udpDecoder.setProtocolVersion(Version::UNKNOWN); } @@ -1303,10 +1303,10 @@ void Server::processMsg(ServerUser *u, Mumble::Protocol::AudioData audioData, Au // Setup encoder for this range if (isFirstIteration || !Mumble::Protocol::protocolVersionsAreCompatible(encoder.getProtocolVersion(), - currentRange.begin->getReceiver().uiVersion)) { + currentRange.begin->getReceiver().m_version)) { ZoneScopedN(TracyConstants::AUDIO_ENCODE); - encoder.setProtocolVersion(currentRange.begin->getReceiver().uiVersion); + encoder.setProtocolVersion(currentRange.begin->getReceiver().m_version); // We have to re-encode the "fixed" part of the audio message encoder.prepareAudioPacket(audioData); @@ -1711,7 +1711,7 @@ void Server::message(Mumble::Protocol::TCPMessageType type, const QByteArray &qb u->aiUdpFlag = 0; - m_tcpTunnelDecoder.setProtocolVersion(u->uiVersion); + m_tcpTunnelDecoder.setProtocolVersion(u->m_version); if (m_tcpTunnelDecoder.decode(gsl::span< const Mumble::Protocol::byte >( reinterpret_cast< const Mumble::Protocol::byte * >(qbaMsg.constData()), qbaMsg.size()))) { @@ -1830,7 +1830,7 @@ void Server::sendProtoExcept(ServerUser *u, const ::google::protobuf::Message &m const bool isUnknown = version == Version::UNKNOWN; const bool fulfillsVersionRequirement = - mode == Version::CompareMode::AtLeast ? usr->uiVersion >= version : usr->uiVersion < version; + mode == Version::CompareMode::AtLeast ? usr->m_version >= version : usr->m_version < version; if (isUnknown || fulfillsVersionRequirement) { usr->sendMessage(msg, msgType, cache); } diff --git a/src/murmur/ServerUser.cpp b/src/murmur/ServerUser.cpp index 5c508574d..c4fd77ae8 100644 --- a/src/murmur/ServerUser.cpp +++ b/src/murmur/ServerUser.cpp @@ -26,7 +26,7 @@ ServerUser::ServerUser(Server *p, QSslSocket *socket) uiUDPPackets = uiTCPPackets = 0; aiUdpFlag = 1; - uiVersion = Version::UNKNOWN; + m_version = Version::UNKNOWN; bVerified = true; iLastPermissionCheck = -1; diff --git a/src/murmur/ServerUser.h b/src/murmur/ServerUser.h index 125f08e8d..4b9fcef17 100644 --- a/src/murmur/ServerUser.h +++ b/src/murmur/ServerUser.h @@ -114,7 +114,7 @@ public: float dTCPPingAvg, dTCPPingVar; quint32 uiUDPPackets, uiTCPPackets; - Version::full_t uiVersion; + Version::full_t m_version; QString qsRelease; QString qsOS; QString qsOSVersion; |