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 | |
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')
-rw-r--r-- | src/benchmarks/AudioReceiverBuffer/ServerUser.h | 4 | ||||
-rw-r--r-- | src/mumble/ACLEditor.cpp | 6 | ||||
-rw-r--r-- | src/mumble/API_v_1_x_x.cpp | 2 | ||||
-rw-r--r-- | src/mumble/AudioInput.cpp | 2 | ||||
-rw-r--r-- | src/mumble/ConnectDialog.cpp | 10 | ||||
-rw-r--r-- | src/mumble/ConnectDialog.h | 2 | ||||
-rw-r--r-- | src/mumble/MainWindow.cpp | 10 | ||||
-rw-r--r-- | src/mumble/Messages.cpp | 2 | ||||
-rw-r--r-- | src/mumble/ServerHandler.cpp | 10 | ||||
-rw-r--r-- | src/mumble/ServerHandler.h | 2 | ||||
-rw-r--r-- | src/mumble/ServerInformation.cpp | 2 | ||||
-rw-r--r-- | src/mumble/VoiceRecorder.cpp | 4 | ||||
-rw-r--r-- | src/mumble/VoiceRecorderDialog.cpp | 2 | ||||
-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 | ||||
-rw-r--r-- | src/tests/TestAudioReceiverBuffer/ServerUser.h | 4 | ||||
-rw-r--r-- | src/tests/TestAudioReceiverBuffer/TestAudioReceiverBuffer.cpp | 8 |
22 files changed, 59 insertions, 59 deletions
diff --git a/src/benchmarks/AudioReceiverBuffer/ServerUser.h b/src/benchmarks/AudioReceiverBuffer/ServerUser.h index 202895ba3..191aec825 100644 --- a/src/benchmarks/AudioReceiverBuffer/ServerUser.h +++ b/src/benchmarks/AudioReceiverBuffer/ServerUser.h @@ -13,10 +13,10 @@ struct ServerUser { ServerUser(unsigned int uiSession, Version::full_t version, bool deaf = false, bool selfDeaf = false, const std::string context = "") - : uiSession(uiSession), uiVersion(version), bDeaf(deaf), bSelfDeaf(selfDeaf), ssContext(context) {} + : uiSession(uiSession), m_version(version), bDeaf(deaf), bSelfDeaf(selfDeaf), ssContext(context) {} unsigned int uiSession; - Version::full_t uiVersion; + Version::full_t m_version; bool bDeaf; bool bSelfDeaf; std::string ssContext; diff --git a/src/mumble/ACLEditor.cpp b/src/mumble/ACLEditor.cpp index b948929cf..4dcae1237 100644 --- a/src/mumble/ACLEditor.cpp +++ b/src/mumble/ACLEditor.cpp @@ -59,7 +59,7 @@ ACLEditor::ACLEditor(int channelparentid, QWidget *p) : QDialog(p) { qleChannelPassword->hide(); qlChannelPassword->hide(); - if (Global::get().sh->uiVersion >= Version::fromComponents(1, 3, 0)) { + if (Global::get().sh->m_version >= Version::fromComponents(1, 3, 0)) { qsbChannelMaxUsers->setRange(0, INT_MAX); qsbChannelMaxUsers->setValue(0); qsbChannelMaxUsers->setSpecialValueText(tr("Default server value")); @@ -125,7 +125,7 @@ ACLEditor::ACLEditor(int channelid, const MumbleProto::ACL &mea, QWidget *p) : Q qsbChannelPosition->setRange(INT_MIN, INT_MAX); qsbChannelPosition->setValue(pChannel->iPosition); - if (Global::get().sh->uiVersion >= Version::fromComponents(1, 3, 0)) { + if (Global::get().sh->m_version >= Version::fromComponents(1, 3, 0)) { qsbChannelMaxUsers->setRange(0, INT_MAX); qsbChannelMaxUsers->setValue(pChannel->uiMaxUsers); qsbChannelMaxUsers->setSpecialValueText(tr("Default server value")); @@ -149,7 +149,7 @@ ACLEditor::ACLEditor(int channelid, const MumbleProto::ACL &mea, QWidget *p) : Q if (!name.isEmpty()) { // If the server's version is less than 1.4.0 then it won't support the new permissions. // Skipping this iteration of the loop prevents checkboxes for it being added to the UI. - if (Global::get().sh->uiVersion < Version::fromComponents(1, 4, 0) + if (Global::get().sh->m_version < Version::fromComponents(1, 4, 0) && (perm == ChanACL::ResetUserContent || perm == ChanACL::Listen)) { continue; } diff --git a/src/mumble/API_v_1_x_x.cpp b/src/mumble/API_v_1_x_x.cpp index 3bc6b287f..fa8e6242f 100644 --- a/src/mumble/API_v_1_x_x.cpp +++ b/src/mumble/API_v_1_x_x.cpp @@ -1561,7 +1561,7 @@ void MumbleAPI::sendData_v_1_0_x(mumble_plugin_id_t callerID, mumble_connection_ mpdt.set_dataid(dataID); if (Global::get().sh) { - if (Global::get().sh->uiVersion < Version::fromComponents(1, 4, 0)) { + if (Global::get().sh->m_version < Version::fromComponents(1, 4, 0)) { // The sendMessage call relies on the server relaying the message to the respective receiver. This // functionality was added to the server protocol in version 1.4.0, so an older server will not know what to // do with the received message. diff --git a/src/mumble/AudioInput.cpp b/src/mumble/AudioInput.cpp index 727f8584e..3b212f1c6 100644 --- a/src/mumble/AudioInput.cpp +++ b/src/mumble/AudioInput.cpp @@ -1317,7 +1317,7 @@ void AudioInput::flushCheck(const QByteArray &frame, bool terminator, int voiceT recorder->getRecordUser().addFrame(audioData); } - m_udpEncoder.setProtocolVersion(sh->uiVersion); + m_udpEncoder.setProtocolVersion(sh->m_version); } } diff --git a/src/mumble/ConnectDialog.cpp b/src/mumble/ConnectDialog.cpp index dea625e87..eb93c9ee1 100644 --- a/src/mumble/ConnectDialog.cpp +++ b/src/mumble/ConnectDialog.cpp @@ -73,7 +73,7 @@ void PingStats::init() { uiBandwidth = 0; uiSent = 0; uiRecv = 0; - uiVersion = Version::UNKNOWN; + m_version = Version::UNKNOWN; } void PingStats::reset() { @@ -322,7 +322,7 @@ ServerItem::ServerItem(const ServerItem *si) { qlAddresses = si->qlAddresses; bCA = si->bCA; - uiVersion = si->uiVersion; + m_version = si->m_version; uiPing = si->uiPing; uiPingSort = si->uiPing; uiUsers = si->uiUsers; @@ -543,7 +543,7 @@ QVariant ServerItem::data(int column, int role) const { QString::fromLatin1("%1/%2").arg(uiUsers).arg(uiMaxUsers)) + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") .arg(ConnectDialog::tr("Version")) - .arg(Version::toString(uiVersion)); + .arg(Version::toString(m_version)); } } qs += QLatin1String("</table>"); @@ -1578,7 +1578,7 @@ void ConnectDialog::timeTick() { tHover.restart(); for (const ServerAddress &addr : si->qlAddresses) { - sendPing(addr.host.toAddress(), addr.port, si->uiVersion); + sendPing(addr.host.toAddress(), addr.port, si->m_version); } } @@ -1832,7 +1832,7 @@ void ConnectDialog::udpReply() { quint64 elapsed = tPing.elapsed() - (pingData.timestamp ^ qhPingRand.value(address)); for (ServerItem *si : qhPings.value(address)) { - si->uiVersion = pingData.serverVersion; + si->m_version = pingData.serverVersion; quint32 users = pingData.userCount; quint32 maxusers = pingData.maxUserCount; si->uiBandwidth = pingData.maxBandwidthPerUser; diff --git a/src/mumble/ConnectDialog.h b/src/mumble/ConnectDialog.h index dd4165363..b8021569e 100644 --- a/src/mumble/ConnectDialog.h +++ b/src/mumble/ConnectDialog.h @@ -54,7 +54,7 @@ protected: void init(); public: - Version::full_t uiVersion; + Version::full_t m_version; quint32 uiPing; quint32 uiPingSort; quint32 uiUsers; diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp index f949104a5..1cb3618e9 100644 --- a/src/mumble/MainWindow.cpp +++ b/src/mumble/MainWindow.cpp @@ -1422,7 +1422,7 @@ void MainWindow::on_qmSelf_aboutToShow() { qaSelfRegister->setEnabled(user && (user->iId < 0) && !user->qsHash.isEmpty() && (Global::get().pPermissions & (ChanACL::SelfRegister | ChanACL::Write))); - if (Global::get().sh && Global::get().sh->uiVersion >= Version::fromComponents(1, 2, 3)) { + if (Global::get().sh && Global::get().sh->m_version >= Version::fromComponents(1, 2, 3)) { qaSelfPrioritySpeaker->setEnabled(user && Global::get().pPermissions & (ChanACL::Write | ChanACL::MuteDeafen)); qaSelfPrioritySpeaker->setChecked(user && user->bPrioritySpeaker); } else { @@ -1618,7 +1618,7 @@ void MainWindow::qmUser_aboutToShow() { qmUser->addAction(qaUserBan); qmUser->addAction(qaUserMute); qmUser->addAction(qaUserDeaf); - if (Global::get().sh && Global::get().sh->uiVersion >= Version::fromComponents(1, 2, 3)) + if (Global::get().sh && Global::get().sh->m_version >= Version::fromComponents(1, 2, 3)) qmUser->addAction(qaUserPrioritySpeaker); qmUser->addAction(qaUserLocalMute); qmUser->addAction(qaUserLocalIgnore); @@ -1644,7 +1644,7 @@ void MainWindow::qmUser_aboutToShow() { } qmUser->addAction(qaUserTextMessage); - if (Global::get().sh && Global::get().sh->uiVersion >= Version::fromComponents(1, 2, 2)) + if (Global::get().sh && Global::get().sh->m_version >= Version::fromComponents(1, 2, 2)) qmUser->addAction(qaUserInformation); if (p && (p->iId < 0) && !p->qsHash.isEmpty() @@ -1707,7 +1707,7 @@ void MainWindow::qmUser_aboutToShow() { qaUserLocalIgnoreTTS->setEnabled(!isSelf); // If the server's version is less than 1.4.0 it won't support the new permission to reset a comment/avatar, so // fall back to the old method - if (Global::get().sh->uiVersion < Version::fromComponents(1, 4, 0)) { + if (Global::get().sh->m_version < Version::fromComponents(1, 4, 0)) { qaUserCommentReset->setEnabled(!p->qbaCommentHash.isEmpty() && (Global::get().pPermissions & (ChanACL::Move | ChanACL::Write))); qaUserTextureReset->setEnabled(!p->qbaTextureHash.isEmpty() @@ -2181,7 +2181,7 @@ void MainWindow::qmChannel_aboutToShow() { qmChannel->addSeparator(); } - if (c && Global::get().sh && Global::get().sh->uiVersion >= Version::fromComponents(1, 4, 0)) { + if (c && Global::get().sh && Global::get().sh->m_version >= Version::fromComponents(1, 4, 0)) { // If the server's version is less than 1.4, the listening feature is not supported yet // and thus it doesn't make sense to show the action for it qmChannel->addAction(qaChannelListen); diff --git a/src/mumble/Messages.cpp b/src/mumble/Messages.cpp index 2d5e4d4b8..631c11896 100644 --- a/src/mumble/Messages.cpp +++ b/src/mumble/Messages.cpp @@ -1234,7 +1234,7 @@ void MainWindow::msgCodecVersion(const MumbleProto::CodecVersion &msg) { } // Workaround for broken 1.2.2 servers - if (Global::get().sh && Global::get().sh->uiVersion == Version::fromComponents(1, 2, 2) && alpha != -1 + if (Global::get().sh && Global::get().sh->m_version == Version::fromComponents(1, 2, 2) && alpha != -1 && alpha == beta) { if (pref) beta = Global::get().iCodecBeta; diff --git a/src/mumble/ServerHandler.cpp b/src/mumble/ServerHandler.cpp index 8242ea017..e4048e400 100644 --- a/src/mumble/ServerHandler.cpp +++ b/src/mumble/ServerHandler.cpp @@ -115,7 +115,7 @@ ServerHandler::ServerHandler() : database(new Database(QLatin1String("ServerHand usPort = 0; bUdp = true; tConnectionTimeoutTimer = nullptr; - uiVersion = Version::UNKNOWN; + m_version = Version::UNKNOWN; iInFlightTCPPings = 0; // assign connection ID @@ -198,7 +198,7 @@ int ServerHandler::getConnectionID() const { } void ServerHandler::setProtocolVersion(Version::full_t version) { - uiVersion = version; + m_version = version; m_udpPingEncoder.setProtocolVersion(version); m_udpDecoder.setProtocolVersion(version); @@ -455,7 +455,7 @@ void ServerHandler::run() { accUDP = accTCP = accClean; - uiVersion = Version::UNKNOWN; + m_version = Version::UNKNOWN; qsRelease = QString(); qsOS = QString(); qsOSVersion = QString(); @@ -580,7 +580,7 @@ void ServerHandler::sendPingInternal() { pingData.timestamp = t; pingData.requestAdditionalInformation = false; - m_udpPingEncoder.setProtocolVersion(uiVersion); + m_udpPingEncoder.setProtocolVersion(m_version); gsl::span< const Mumble::Protocol::byte > encodedPacket = m_udpPingEncoder.encodePingPacket(pingData); sendMessage(encodedPacket.data(), encodedPacket.size(), true); @@ -1026,7 +1026,7 @@ void ServerHandler::setUserComment(unsigned int uiSession, const QString &commen void ServerHandler::setUserTexture(unsigned int uiSession, const QByteArray &qba) { QByteArray texture; - if ((uiVersion >= Version::fromComponents(1, 2, 2)) || qba.isEmpty()) { + if ((m_version >= Version::fromComponents(1, 2, 2)) || qba.isEmpty()) { texture = qba; } else { QByteArray raw = qba; diff --git a/src/mumble/ServerHandler.h b/src/mumble/ServerHandler.h index 74608be64..a66971eff 100644 --- a/src/mumble/ServerHandler.h +++ b/src/mumble/ServerHandler.h @@ -108,7 +108,7 @@ public: QHash< ServerAddress, QString > qhHostnames; ServerAddress saTargetServer; - Version::full_t uiVersion; + Version::full_t m_version; QString qsRelease; QString qsOS; QString qsOSVersion; diff --git a/src/mumble/ServerInformation.cpp b/src/mumble/ServerInformation.cpp index b47924f9c..bef224c8a 100644 --- a/src/mumble/ServerInformation.cpp +++ b/src/mumble/ServerInformation.cpp @@ -71,7 +71,7 @@ void ServerInformation::updateServerInformation() { serverInfo_host->setText(host); serverInfo_port->setText(QString::number(port)); serverInfo_users->setText(QString::fromLatin1("%1 / %2").arg(userCount).arg(maxUserCount)); - serverInfo_protocol->setText(Version::toString(Global::get().sh->uiVersion)); + serverInfo_protocol->setText(Version::toString(Global::get().sh->m_version)); serverInfo_release->setText(release); serverInfo_os->setText(os); } diff --git a/src/mumble/VoiceRecorder.cpp b/src/mumble/VoiceRecorder.cpp index e2d25e7f0..02349e6d9 100644 --- a/src/mumble/VoiceRecorder.cpp +++ b/src/mumble/VoiceRecorder.cpp @@ -292,7 +292,7 @@ bool VoiceRecorder::ensureFileIsOpenedFor(SF_INFO &soundFileInfo, boost::shared_ void VoiceRecorder::run() { Q_ASSERT(!m_recording); - if (Global::get().sh && Global::get().sh->uiVersion < Version::fromComponents(1, 2, 3)) + if (Global::get().sh && Global::get().sh->m_version < Version::fromComponents(1, 2, 3)) return; SF_INFO soundFileInfo = createSoundFileInfo(); @@ -306,7 +306,7 @@ void VoiceRecorder::run() { m_sleepCondition.wait(&m_sleepLock); if (!m_recording || m_abort - || (Global::get().sh && Global::get().sh->uiVersion < Version::fromComponents(1, 2, 3))) { + || (Global::get().sh && Global::get().sh->m_version < Version::fromComponents(1, 2, 3))) { m_sleepLock.unlock(); break; } diff --git a/src/mumble/VoiceRecorderDialog.cpp b/src/mumble/VoiceRecorderDialog.cpp index 856318aad..222db2747 100644 --- a/src/mumble/VoiceRecorderDialog.cpp +++ b/src/mumble/VoiceRecorderDialog.cpp @@ -113,7 +113,7 @@ void VoiceRecorderDialog::on_qpbStart_clicked() { return; } - if (Global::get().sh->uiVersion < Version::fromComponents(1, 2, 3)) { + if (Global::get().sh->m_version < Version::fromComponents(1, 2, 3)) { QMessageBox::critical(this, tr("Recorder"), tr("The server you are currently connected to is version 1.2.2 or older. " "For privacy reasons, recording on servers of versions older than 1.2.3 " 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; diff --git a/src/tests/TestAudioReceiverBuffer/ServerUser.h b/src/tests/TestAudioReceiverBuffer/ServerUser.h index 202895ba3..191aec825 100644 --- a/src/tests/TestAudioReceiverBuffer/ServerUser.h +++ b/src/tests/TestAudioReceiverBuffer/ServerUser.h @@ -13,10 +13,10 @@ struct ServerUser { ServerUser(unsigned int uiSession, Version::full_t version, bool deaf = false, bool selfDeaf = false, const std::string context = "") - : uiSession(uiSession), uiVersion(version), bDeaf(deaf), bSelfDeaf(selfDeaf), ssContext(context) {} + : uiSession(uiSession), m_version(version), bDeaf(deaf), bSelfDeaf(selfDeaf), ssContext(context) {} unsigned int uiSession; - Version::full_t uiVersion; + Version::full_t m_version; bool bDeaf; bool bSelfDeaf; std::string ssContext; diff --git a/src/tests/TestAudioReceiverBuffer/TestAudioReceiverBuffer.cpp b/src/tests/TestAudioReceiverBuffer/TestAudioReceiverBuffer.cpp index 857216b72..78feafd52 100644 --- a/src/tests/TestAudioReceiverBuffer/TestAudioReceiverBuffer.cpp +++ b/src/tests/TestAudioReceiverBuffer/TestAudioReceiverBuffer.cpp @@ -17,7 +17,7 @@ QDebug &operator<<(QDebug &stream, const ServerUser &user) { return stream.nospace() << "ServerUser{ session: " << user.uiSession - << ", version: " << Version::toString(user.uiVersion) << ", deaf: " << user.bDeaf + << ", version: " << Version::toString(user.m_version) << ", deaf: " << user.bDeaf << ", selfDeaf: " << user.bSelfDeaf << ", ssContext: " << QString::fromStdString(user.ssContext) << " }"; } @@ -233,14 +233,14 @@ private slots: qWarning() << "Start:" << *receiverRange.begin; qWarning() << "End:" << *(receiverRange.end - 1); - QVERIFY2(encoder.checkRequiresEncoding(receiverRange.begin->getReceiver().uiVersion, + QVERIFY2(encoder.checkRequiresEncoding(receiverRange.begin->getReceiver().m_version, receiverRange.begin->getContext(), receiverRange.begin->getVolumeAdjustment().factor), "Starting a new range, but no re-encoding is required"); for (auto it = receiverRange.begin; it != receiverRange.end; ++it) { qWarning() << "Processing" << *it; - QVERIFY2(!encoder.checkRequiresEncoding(it->getReceiver().uiVersion, it->getContext(), + QVERIFY2(!encoder.checkRequiresEncoding(it->getReceiver().m_version, it->getContext(), it->getVolumeAdjustment().factor), "Mid-range re-encoding required"); processedReceiver++; @@ -259,7 +259,7 @@ private slots: encoder.reset(); for (const AudioReceiver ¤t : receivers) { - encoder.checkRequiresEncoding(current.getReceiver().uiVersion, current.getContext(), + encoder.checkRequiresEncoding(current.getReceiver().m_version, current.getContext(), current.getVolumeAdjustment().factor); } |