From 1c2e66e12d8659424a01670f641fe4f814b9b4b9 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 22 Dec 2021 09:06:34 -0800 Subject: Create LLLicenseInfo and use it in LLAppViewer::getViewerInfo and LLFloaterAbout::postBuild. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewer.cpp | 6 ++- indra/newview/llfloaterabout.cpp | 36 ++++++++--------- indra/newview/lllicenseinfo.cpp | 84 ++++++++++++++++++++++++++++++++++++++++ indra/newview/lllicenseinfo.h | 67 ++++++++++++++++++++++++++++++++ 5 files changed, 173 insertions(+), 22 deletions(-) create mode 100644 indra/newview/lllicenseinfo.cpp create mode 100644 indra/newview/lllicenseinfo.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5a06106de3..67ada9cc2e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -385,6 +385,7 @@ set(viewer_SOURCE_FILES lllandmarkactions.cpp lllandmarklist.cpp lllegacyatmospherics.cpp + lllicenseinfo.cpp lllistbrowser.cpp lllistcontextmenu.cpp lllistview.cpp @@ -1025,6 +1026,7 @@ set(viewer_HEADER_FILES llkeyconflict.h lllandmarkactions.h lllandmarklist.h + lllicenseinfo.h lllightconstants.h lllistbrowser.h lllistcontextmenu.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c9d852686e..4cc5ae7630 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -30,6 +30,7 @@ // Viewer includes #include "llversioninfo.h" +#include "lllicenseinfo.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -3207,9 +3208,10 @@ LLSD LLAppViewer::getViewerInfo() const info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : "Undefined"; if(LLVoiceClient::getInstance()->voiceEnabled()) { - LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); + auto& licenseInfo(LLLicenseInfo::instance()); + LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); std::ostringstream version_string; - version_string << version.serverType << " " << version.serverVersion << std::endl; + version_string << version.serverType << " " << version.serverVersion << " SLVoice " << licenseInfo.getVersion("slvoice") << std::endl; info["VOICE_VERSION"] = version_string.str(); } else diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 1fbd198019..60c7a737b2 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -44,6 +44,7 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "llversioninfo.h" +#include "lllicenseinfo.h" #include "llweb.h" // Linden library includes @@ -178,26 +179,21 @@ BOOL LLFloaterAbout::postBuild() contrib_names_widget->setEnabled(FALSE); contrib_names_widget->startOfDoc(); - // Get the Versions and Copyrights, created at build time - std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt"); - llifstream licenses_file; - licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ - if (licenses_file.is_open()) - { - std::string license_line; - licenses_widget->clear(); - while ( std::getline(licenses_file, license_line) ) - { - licenses_widget->appendText(license_line+"\n", FALSE, - LLStyle::Params() .color(about_color)); - } - licenses_file.close(); - } - else - { - // this case will use the (out of date) hard coded value from the XUI - LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL; - } + auto& license_info(LLLicenseInfo::instance()); + if (!license_info.empty()) + { + // Although the iteration is fine if empty(), we only want to clear if not empty(). + // That then uses the (out of date) hard coded value from the XUI. + licenses_widget->clear(); + for (const auto& library : license_info) + { + const std::string& name = library.first; + const LLLicenseInfo::LibraryData& data = library.second; + std::string license_line = name + ": " + data.version + "\n" + data.copyrights + "\n\n"; + licenses_widget->appendText(license_line, FALSE, + LLStyle::Params() .color(about_color)); + } + } licenses_widget->setEnabled(FALSE); licenses_widget->startOfDoc(); diff --git a/indra/newview/lllicenseinfo.cpp b/indra/newview/lllicenseinfo.cpp new file mode 100644 index 0000000000..e68b661763 --- /dev/null +++ b/indra/newview/lllicenseinfo.cpp @@ -0,0 +1,84 @@ +/** + * @file lllicenseinfo.cpp + * @brief Routines to access library version and license information + * @author Aech Linden + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "lllicenseinfo.h" +#include +#include "lldir.h" + +LLLicenseInfo::LLLicenseInfo() +{ + LL_DEBUGS("LicenseInfo") << "instantiating license info" << LL_ENDL; +} + +void LLLicenseInfo::initSingleton() +{ + // Get the the map with name => {version, cpyrights}, from file created at build time + std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "packages-info.txt"); + llifstream licenses_file; + licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ + if (!licenses_file.is_open()) { + LL_INFOS("LicenseInfo") << "Could not read licenses file at " << licenses_path << LL_ENDL; + return; + } + + LL_DEBUGS("LicenseInfo") << "Reading licenses file at " << licenses_path << LL_ENDL; + std::string license_line; + std::string name{}, version{}, copyright{}; + while ( std::getline(licenses_file, license_line) ) + { + if (license_line.empty()) // blank line starts a new library/version/copyright + { + if (!name.empty()) { // Add what we have accumulated. + mLibraries.insert({name, {version, copyright}}); + } + else + { + LL_WARNS("LicenseInfo") << "new line with no current data" << LL_ENDL; + } + name.clear(); + version.clear(); + copyright.clear(); + } + else + { + if (name.empty()) { // No name yet. Parse this line into name and version. + auto name_termination_index = license_line.find(':'); + if (name_termination_index == std::string::npos) // First line has no colon. + { + name_termination_index = license_line.find_last_of(' '); + } + name = license_line.substr(0, name_termination_index); + version = license_line.substr(name_termination_index + 1); + boost::algorithm::trim(version); + } else { + copyright += license_line; + } + } + } + licenses_file.close(); +} diff --git a/indra/newview/lllicenseinfo.h b/indra/newview/lllicenseinfo.h new file mode 100644 index 0000000000..ff889285b8 --- /dev/null +++ b/indra/newview/lllicenseinfo.h @@ -0,0 +1,67 @@ +/** + * @file llicenseinfo.h + * @brief Routines to access library versions and license information + * @author Aech Linden + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLLICENSEINFO_H +#define LL_LLLICENSEINFO_H + +#include "stdtypes.h" +#include "llsingleton.h" +#include + +/// +/// This API provides license information for the viewer. +/// The singleton is initialized once (from package-info.txt), after which +/// it acts like a map of name => {version, copyrights} for each library. +/// +class LLLicenseInfo: public LLSingleton +{ + LLSINGLETON(LLLicenseInfo); + +public: + struct LibraryData + { + std::string version; + std::string copyrights; + }; + typedef std::map LibraryMap; + + /// return the version as a string of the requested library, like "2.0.0.200030" + const std::string& getVersion(const std::string& library_name) const { return mLibraries.at(library_name).version; } + + /// return an indication of whether any library data was found (e.g., false if packages-info.txt is missing) + bool empty() const noexcept { return mLibraries.empty(); }; + + LibraryMap::const_iterator begin() const noexcept { return mLibraries.begin(); }; + LibraryMap::const_iterator end() const noexcept { return mLibraries.end(); }; + +protected: + virtual void initSingleton();; +private: + LibraryMap mLibraries{}; +}; + +#endif -- cgit v1.2.3 From 96e0c823412cc0419a730714992b4fc25316deb0 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 22 Dec 2021 15:10:50 -0800 Subject: Show both server/voice versions only if mismatched. Otherwise show the longer one. --- indra/newview/llappviewer.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4cc5ae7630..58a164f1d0 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3209,9 +3209,18 @@ LLSD LLAppViewer::getViewerInfo() const if(LLVoiceClient::getInstance()->voiceEnabled()) { auto& licenseInfo(LLLicenseInfo::instance()); + std::string detailed_version = licenseInfo.getVersion("slvoice"); LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); std::ostringstream version_string; - version_string << version.serverType << " " << version.serverVersion << " SLVoice " << licenseInfo.getVersion("slvoice") << std::endl; + if (std::equal(detailed_version.begin(), detailed_version.begin() + version.serverVersion.size(), + version.serverVersion.begin())) + { // Normal case: Show type and detailed version. + version_string << version.serverType << " " << detailed_version << std::endl; + } + else + { // Mismatch: Show both versions. + version_string << version.serverVersion << "/" << detailed_version << std::endl; + } info["VOICE_VERSION"] = version_string.str(); } else -- cgit v1.2.3 From b2d4238ab5d4903a27428f4669cf78822c60b984 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Thu, 30 Dec 2021 09:45:47 -0800 Subject: Get rid of new lllicenseinfo. We do not need it. --- indra/newview/CMakeLists.txt | 2 - indra/newview/llfloaterabout.cpp | 36 +++++++++-------- indra/newview/lllicenseinfo.cpp | 84 ---------------------------------------- indra/newview/lllicenseinfo.h | 67 -------------------------------- 4 files changed, 20 insertions(+), 169 deletions(-) delete mode 100644 indra/newview/lllicenseinfo.cpp delete mode 100644 indra/newview/lllicenseinfo.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 67ada9cc2e..5a06106de3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -385,7 +385,6 @@ set(viewer_SOURCE_FILES lllandmarkactions.cpp lllandmarklist.cpp lllegacyatmospherics.cpp - lllicenseinfo.cpp lllistbrowser.cpp lllistcontextmenu.cpp lllistview.cpp @@ -1026,7 +1025,6 @@ set(viewer_HEADER_FILES llkeyconflict.h lllandmarkactions.h lllandmarklist.h - lllicenseinfo.h lllightconstants.h lllistbrowser.h lllistcontextmenu.h diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 60c7a737b2..1fbd198019 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -44,7 +44,6 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "llversioninfo.h" -#include "lllicenseinfo.h" #include "llweb.h" // Linden library includes @@ -179,21 +178,26 @@ BOOL LLFloaterAbout::postBuild() contrib_names_widget->setEnabled(FALSE); contrib_names_widget->startOfDoc(); - auto& license_info(LLLicenseInfo::instance()); - if (!license_info.empty()) - { - // Although the iteration is fine if empty(), we only want to clear if not empty(). - // That then uses the (out of date) hard coded value from the XUI. - licenses_widget->clear(); - for (const auto& library : license_info) - { - const std::string& name = library.first; - const LLLicenseInfo::LibraryData& data = library.second; - std::string license_line = name + ": " + data.version + "\n" + data.copyrights + "\n\n"; - licenses_widget->appendText(license_line, FALSE, - LLStyle::Params() .color(about_color)); - } - } + // Get the Versions and Copyrights, created at build time + std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt"); + llifstream licenses_file; + licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ + if (licenses_file.is_open()) + { + std::string license_line; + licenses_widget->clear(); + while ( std::getline(licenses_file, license_line) ) + { + licenses_widget->appendText(license_line+"\n", FALSE, + LLStyle::Params() .color(about_color)); + } + licenses_file.close(); + } + else + { + // this case will use the (out of date) hard coded value from the XUI + LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL; + } licenses_widget->setEnabled(FALSE); licenses_widget->startOfDoc(); diff --git a/indra/newview/lllicenseinfo.cpp b/indra/newview/lllicenseinfo.cpp deleted file mode 100644 index e68b661763..0000000000 --- a/indra/newview/lllicenseinfo.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file lllicenseinfo.cpp - * @brief Routines to access library version and license information - * @author Aech Linden - * - * $LicenseInfo:firstyear=2021&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2021, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "lllicenseinfo.h" -#include -#include "lldir.h" - -LLLicenseInfo::LLLicenseInfo() -{ - LL_DEBUGS("LicenseInfo") << "instantiating license info" << LL_ENDL; -} - -void LLLicenseInfo::initSingleton() -{ - // Get the the map with name => {version, cpyrights}, from file created at build time - std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "packages-info.txt"); - llifstream licenses_file; - licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ - if (!licenses_file.is_open()) { - LL_INFOS("LicenseInfo") << "Could not read licenses file at " << licenses_path << LL_ENDL; - return; - } - - LL_DEBUGS("LicenseInfo") << "Reading licenses file at " << licenses_path << LL_ENDL; - std::string license_line; - std::string name{}, version{}, copyright{}; - while ( std::getline(licenses_file, license_line) ) - { - if (license_line.empty()) // blank line starts a new library/version/copyright - { - if (!name.empty()) { // Add what we have accumulated. - mLibraries.insert({name, {version, copyright}}); - } - else - { - LL_WARNS("LicenseInfo") << "new line with no current data" << LL_ENDL; - } - name.clear(); - version.clear(); - copyright.clear(); - } - else - { - if (name.empty()) { // No name yet. Parse this line into name and version. - auto name_termination_index = license_line.find(':'); - if (name_termination_index == std::string::npos) // First line has no colon. - { - name_termination_index = license_line.find_last_of(' '); - } - name = license_line.substr(0, name_termination_index); - version = license_line.substr(name_termination_index + 1); - boost::algorithm::trim(version); - } else { - copyright += license_line; - } - } - } - licenses_file.close(); -} diff --git a/indra/newview/lllicenseinfo.h b/indra/newview/lllicenseinfo.h deleted file mode 100644 index ff889285b8..0000000000 --- a/indra/newview/lllicenseinfo.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file llicenseinfo.h - * @brief Routines to access library versions and license information - * @author Aech Linden - * - * $LicenseInfo:firstyear=2021&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2021, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLLICENSEINFO_H -#define LL_LLLICENSEINFO_H - -#include "stdtypes.h" -#include "llsingleton.h" -#include - -/// -/// This API provides license information for the viewer. -/// The singleton is initialized once (from package-info.txt), after which -/// it acts like a map of name => {version, copyrights} for each library. -/// -class LLLicenseInfo: public LLSingleton -{ - LLSINGLETON(LLLicenseInfo); - -public: - struct LibraryData - { - std::string version; - std::string copyrights; - }; - typedef std::map LibraryMap; - - /// return the version as a string of the requested library, like "2.0.0.200030" - const std::string& getVersion(const std::string& library_name) const { return mLibraries.at(library_name).version; } - - /// return an indication of whether any library data was found (e.g., false if packages-info.txt is missing) - bool empty() const noexcept { return mLibraries.empty(); }; - - LibraryMap::const_iterator begin() const noexcept { return mLibraries.begin(); }; - LibraryMap::const_iterator end() const noexcept { return mLibraries.end(); }; - -protected: - virtual void initSingleton();; -private: - LibraryMap mLibraries{}; -}; - -#endif -- cgit v1.2.3 From 1b339fa685bcb18496a2ab6efe964171b5201eed Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Thu, 30 Dec 2021 10:05:52 -0800 Subject: Record and use build version reported by SLVoice --- indra/newview/llappviewer.cpp | 12 +++++------- indra/newview/llvoiceclient.cpp | 1 + indra/newview/llvoiceclient.h | 1 + indra/newview/llvoicevivox.cpp | 22 +++++++++++++++++++++- indra/newview/llvoicevivox.h | 2 ++ 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 58a164f1d0..cebba9158c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -30,7 +30,6 @@ // Viewer includes #include "llversioninfo.h" -#include "lllicenseinfo.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -3208,18 +3207,17 @@ LLSD LLAppViewer::getViewerInfo() const info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : "Undefined"; if(LLVoiceClient::getInstance()->voiceEnabled()) { - auto& licenseInfo(LLLicenseInfo::instance()); - std::string detailed_version = licenseInfo.getVersion("slvoice"); LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); + std::string buildVersion = version.buildVersion; std::ostringstream version_string; - if (std::equal(detailed_version.begin(), detailed_version.begin() + version.serverVersion.size(), + if (std::equal(buildVersion.begin(), buildVersion.begin() + version.serverVersion.size(), version.serverVersion.begin())) - { // Normal case: Show type and detailed version. - version_string << version.serverType << " " << detailed_version << std::endl; + { // Normal case: Show type and build version. + version_string << version.serverType << " " << buildVersion << std::endl; } else { // Mismatch: Show both versions. - version_string << version.serverVersion << "/" << detailed_version << std::endl; + version_string << version.serverVersion << "/" << buildVersion << std::endl; } info["VOICE_VERSION"] = version_string.str(); } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index e2bd1a39c7..dac609140a 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -200,6 +200,7 @@ const LLVoiceVersionInfo LLVoiceClient::getVersion() LLVoiceVersionInfo result; result.serverVersion = std::string(); result.serverType = std::string(); + result.buildVersion = std::string(); return result; } } diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index cf527a4464..cf6e308fc0 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -95,6 +95,7 @@ struct LLVoiceVersionInfo { std::string serverType; std::string serverVersion; + std::string buildVersion; }; ////////////////////////////////// diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index c7a544f8eb..437633da98 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4548,6 +4548,23 @@ void LLVivoxVoiceClient::sessionNotificationEvent(std::string &sessionHandle, st } } +void LLVivoxVoiceClient::voiceServiceConnectionStateChangedEvent(int statusCode, std::string &statusString, std::string &buildID) +{ + // We don't generally need to process this. However, one occurence is when we first connect, and so it is the + // earliest opportunity to learn what we're connected to. + if (statusCode) + { + LL_WARNS("Voice") << "VoiceServiceConnectionStateChangedEvent statusCode: " << statusCode << + "statusString: " << statusString << LL_ENDL; + return; + } + if (buildID.empty()) + { + return; + } + mVoiceVersion.buildVersion = buildID; +} + void LLVivoxVoiceClient::auxAudioPropertiesEvent(F32 energy) { LL_DEBUGS("VoiceEnergy") << "got energy " << energy << LL_ENDL; @@ -7528,6 +7545,8 @@ void LLVivoxProtocolParser::EndTag(const char *tag) connectorHandle = string; else if (!stricmp("VersionID", tag)) versionID = string; + else if (!stricmp("Version", tag)) + buildID = string; else if (!stricmp("AccountHandle", tag)) accountHandle = string; else if (!stricmp("State", tag)) @@ -7830,7 +7849,8 @@ void LLVivoxProtocolParser::processResponse(std::string tag) // We don't need to process this, but we also shouldn't warn on it, since that confuses people. } else if (!stricmp(eventTypeCstr, "VoiceServiceConnectionStateChangedEvent")) - { // Yet another ignored event + { + LLVivoxVoiceClient::getInstance()->voiceServiceConnectionStateChangedEvent(statusCode, statusString, buildID); } else if (!stricmp(eventTypeCstr, "AudioDeviceHotSwapEvent")) { diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index cf30a4e86a..7e9859d347 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -465,6 +465,7 @@ protected: void participantAddedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString, std::string &displayNameString, int participantType); void participantRemovedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString); void participantUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, bool isModeratorMuted, bool isSpeaking, int volume, F32 energy); + void voiceServiceConnectionStateChangedEvent(int statusCode, std::string &statusString, std::string &buildID); void auxAudioPropertiesEvent(F32 energy); void messageEvent(std::string &sessionHandle, std::string &uriString, std::string &alias, std::string &messageHeader, std::string &messageBody, std::string &applicationString); void sessionNotificationEvent(std::string &sessionHandle, std::string &uriString, std::string ¬ificationType); @@ -969,6 +970,7 @@ protected: std::string actionString; std::string connectorHandle; std::string versionID; + std::string buildID; std::string accountHandle; std::string sessionHandle; std::string sessionGroupHandle; -- cgit v1.2.3 From 18e42d6b537df85384612fc4f4a441d90cc32a24 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 5 Jan 2022 15:30:54 -0800 Subject: Use new teamcity slvoice. --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index bb7cc27233..21f6393381 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3022,9 +3022,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 6ce3cbaed968a69fb7a2cca80220874d + 4d7ac4c41153aca41cc6ff67e69c272a url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80380/758537/slvoice-4.10.0000.32327.5fc3fe7c.558436-darwin64-558436.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92735/837103/slvoice-4.10.0000.32327.5fc3fe7c.567159-darwin64-567159.tar.bz2 name darwin64 @@ -3058,9 +3058,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 2eb38c5eff4d0f18fbb89d0c30c4f0a4 + 8a362efd833acb9bce21123c8442bdea url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80382/758550/slvoice-4.10.0000.32327.5fc3fe7c.558436-windows-558436.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92828/837538/slvoice-4.10.0000.32327.5fc3fe7c.567232-windows-567232.tar.bz2 name windows @@ -3070,16 +3070,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 9ee8f3cbc5369c598a998c61961ed16d + 1868d578f07c32f17e57563d7d8f5e01 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80381/758551/slvoice-4.10.0000.32327.5fc3fe7c.558436-windows64-558436.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92827/837530/slvoice-4.10.0000.32327.5fc3fe7c.567232-windows64-567232.tar.bz2 name windows64 version - 4.10.0000.32327.5fc3fe7c.558436 + 4.10.0000.32327.5fc3fe7c.567159 threejs -- cgit v1.2.3 From 874740b1ad53ec47367c7ca39139bd11e709e831 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 5 Jan 2022 16:41:03 -0800 Subject: bad copypasta --- autobuild.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 21f6393381..413f966c09 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3022,9 +3022,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 4d7ac4c41153aca41cc6ff67e69c272a + 82dd58a6a2b2f5c7ea75ed3ea0831abc url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92735/837103/slvoice-4.10.0000.32327.5fc3fe7c.567159-darwin64-567159.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92831/837552/slvoice-4.10.0000.32327.5fc3fe7c.567232-darwin64-567232.tar.bz2 name darwin64 @@ -3079,7 +3079,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors version - 4.10.0000.32327.5fc3fe7c.567159 + 4.10.0000.32327.5fc3fe7c.567232 threejs -- cgit v1.2.3 From cac54c8760789a7b806c67c35e27037546f75181 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 22 Dec 2021 09:06:34 -0800 Subject: SL-13297 - Create LLLicenseInfo and use it in LLAppViewer::getViewerInfo and LLFloaterAbout::postBuild. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewer.cpp | 6 ++- indra/newview/llfloaterabout.cpp | 36 ++++++++--------- indra/newview/lllicenseinfo.cpp | 84 ++++++++++++++++++++++++++++++++++++++++ indra/newview/lllicenseinfo.h | 67 ++++++++++++++++++++++++++++++++ 5 files changed, 173 insertions(+), 22 deletions(-) create mode 100644 indra/newview/lllicenseinfo.cpp create mode 100644 indra/newview/lllicenseinfo.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5a06106de3..67ada9cc2e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -385,6 +385,7 @@ set(viewer_SOURCE_FILES lllandmarkactions.cpp lllandmarklist.cpp lllegacyatmospherics.cpp + lllicenseinfo.cpp lllistbrowser.cpp lllistcontextmenu.cpp lllistview.cpp @@ -1025,6 +1026,7 @@ set(viewer_HEADER_FILES llkeyconflict.h lllandmarkactions.h lllandmarklist.h + lllicenseinfo.h lllightconstants.h lllistbrowser.h lllistcontextmenu.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c9d852686e..4cc5ae7630 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -30,6 +30,7 @@ // Viewer includes #include "llversioninfo.h" +#include "lllicenseinfo.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -3207,9 +3208,10 @@ LLSD LLAppViewer::getViewerInfo() const info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : "Undefined"; if(LLVoiceClient::getInstance()->voiceEnabled()) { - LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); + auto& licenseInfo(LLLicenseInfo::instance()); + LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); std::ostringstream version_string; - version_string << version.serverType << " " << version.serverVersion << std::endl; + version_string << version.serverType << " " << version.serverVersion << " SLVoice " << licenseInfo.getVersion("slvoice") << std::endl; info["VOICE_VERSION"] = version_string.str(); } else diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 1fbd198019..60c7a737b2 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -44,6 +44,7 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "llversioninfo.h" +#include "lllicenseinfo.h" #include "llweb.h" // Linden library includes @@ -178,26 +179,21 @@ BOOL LLFloaterAbout::postBuild() contrib_names_widget->setEnabled(FALSE); contrib_names_widget->startOfDoc(); - // Get the Versions and Copyrights, created at build time - std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt"); - llifstream licenses_file; - licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ - if (licenses_file.is_open()) - { - std::string license_line; - licenses_widget->clear(); - while ( std::getline(licenses_file, license_line) ) - { - licenses_widget->appendText(license_line+"\n", FALSE, - LLStyle::Params() .color(about_color)); - } - licenses_file.close(); - } - else - { - // this case will use the (out of date) hard coded value from the XUI - LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL; - } + auto& license_info(LLLicenseInfo::instance()); + if (!license_info.empty()) + { + // Although the iteration is fine if empty(), we only want to clear if not empty(). + // That then uses the (out of date) hard coded value from the XUI. + licenses_widget->clear(); + for (const auto& library : license_info) + { + const std::string& name = library.first; + const LLLicenseInfo::LibraryData& data = library.second; + std::string license_line = name + ": " + data.version + "\n" + data.copyrights + "\n\n"; + licenses_widget->appendText(license_line, FALSE, + LLStyle::Params() .color(about_color)); + } + } licenses_widget->setEnabled(FALSE); licenses_widget->startOfDoc(); diff --git a/indra/newview/lllicenseinfo.cpp b/indra/newview/lllicenseinfo.cpp new file mode 100644 index 0000000000..e68b661763 --- /dev/null +++ b/indra/newview/lllicenseinfo.cpp @@ -0,0 +1,84 @@ +/** + * @file lllicenseinfo.cpp + * @brief Routines to access library version and license information + * @author Aech Linden + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "lllicenseinfo.h" +#include +#include "lldir.h" + +LLLicenseInfo::LLLicenseInfo() +{ + LL_DEBUGS("LicenseInfo") << "instantiating license info" << LL_ENDL; +} + +void LLLicenseInfo::initSingleton() +{ + // Get the the map with name => {version, cpyrights}, from file created at build time + std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "packages-info.txt"); + llifstream licenses_file; + licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ + if (!licenses_file.is_open()) { + LL_INFOS("LicenseInfo") << "Could not read licenses file at " << licenses_path << LL_ENDL; + return; + } + + LL_DEBUGS("LicenseInfo") << "Reading licenses file at " << licenses_path << LL_ENDL; + std::string license_line; + std::string name{}, version{}, copyright{}; + while ( std::getline(licenses_file, license_line) ) + { + if (license_line.empty()) // blank line starts a new library/version/copyright + { + if (!name.empty()) { // Add what we have accumulated. + mLibraries.insert({name, {version, copyright}}); + } + else + { + LL_WARNS("LicenseInfo") << "new line with no current data" << LL_ENDL; + } + name.clear(); + version.clear(); + copyright.clear(); + } + else + { + if (name.empty()) { // No name yet. Parse this line into name and version. + auto name_termination_index = license_line.find(':'); + if (name_termination_index == std::string::npos) // First line has no colon. + { + name_termination_index = license_line.find_last_of(' '); + } + name = license_line.substr(0, name_termination_index); + version = license_line.substr(name_termination_index + 1); + boost::algorithm::trim(version); + } else { + copyright += license_line; + } + } + } + licenses_file.close(); +} diff --git a/indra/newview/lllicenseinfo.h b/indra/newview/lllicenseinfo.h new file mode 100644 index 0000000000..ff889285b8 --- /dev/null +++ b/indra/newview/lllicenseinfo.h @@ -0,0 +1,67 @@ +/** + * @file llicenseinfo.h + * @brief Routines to access library versions and license information + * @author Aech Linden + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLLICENSEINFO_H +#define LL_LLLICENSEINFO_H + +#include "stdtypes.h" +#include "llsingleton.h" +#include + +/// +/// This API provides license information for the viewer. +/// The singleton is initialized once (from package-info.txt), after which +/// it acts like a map of name => {version, copyrights} for each library. +/// +class LLLicenseInfo: public LLSingleton +{ + LLSINGLETON(LLLicenseInfo); + +public: + struct LibraryData + { + std::string version; + std::string copyrights; + }; + typedef std::map LibraryMap; + + /// return the version as a string of the requested library, like "2.0.0.200030" + const std::string& getVersion(const std::string& library_name) const { return mLibraries.at(library_name).version; } + + /// return an indication of whether any library data was found (e.g., false if packages-info.txt is missing) + bool empty() const noexcept { return mLibraries.empty(); }; + + LibraryMap::const_iterator begin() const noexcept { return mLibraries.begin(); }; + LibraryMap::const_iterator end() const noexcept { return mLibraries.end(); }; + +protected: + virtual void initSingleton();; +private: + LibraryMap mLibraries{}; +}; + +#endif -- cgit v1.2.3 From b829efe759c4669cfaad681f22bd7b4b19c02b37 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 22 Dec 2021 15:10:50 -0800 Subject: SL-13297 - Show both server/voice versions only if mismatched. Otherwise show the longer one. --- indra/newview/llappviewer.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4cc5ae7630..58a164f1d0 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3209,9 +3209,18 @@ LLSD LLAppViewer::getViewerInfo() const if(LLVoiceClient::getInstance()->voiceEnabled()) { auto& licenseInfo(LLLicenseInfo::instance()); + std::string detailed_version = licenseInfo.getVersion("slvoice"); LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); std::ostringstream version_string; - version_string << version.serverType << " " << version.serverVersion << " SLVoice " << licenseInfo.getVersion("slvoice") << std::endl; + if (std::equal(detailed_version.begin(), detailed_version.begin() + version.serverVersion.size(), + version.serverVersion.begin())) + { // Normal case: Show type and detailed version. + version_string << version.serverType << " " << detailed_version << std::endl; + } + else + { // Mismatch: Show both versions. + version_string << version.serverVersion << "/" << detailed_version << std::endl; + } info["VOICE_VERSION"] = version_string.str(); } else -- cgit v1.2.3 From 0e94fe645bb7d62ecd2477a7287608a7e5159913 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Thu, 30 Dec 2021 09:45:47 -0800 Subject: SL-13297 - Get rid of new lllicenseinfo. We do not need it. --- indra/newview/CMakeLists.txt | 2 - indra/newview/llfloaterabout.cpp | 36 +++++++++-------- indra/newview/lllicenseinfo.cpp | 84 ---------------------------------------- indra/newview/lllicenseinfo.h | 67 -------------------------------- 4 files changed, 20 insertions(+), 169 deletions(-) delete mode 100644 indra/newview/lllicenseinfo.cpp delete mode 100644 indra/newview/lllicenseinfo.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 67ada9cc2e..5a06106de3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -385,7 +385,6 @@ set(viewer_SOURCE_FILES lllandmarkactions.cpp lllandmarklist.cpp lllegacyatmospherics.cpp - lllicenseinfo.cpp lllistbrowser.cpp lllistcontextmenu.cpp lllistview.cpp @@ -1026,7 +1025,6 @@ set(viewer_HEADER_FILES llkeyconflict.h lllandmarkactions.h lllandmarklist.h - lllicenseinfo.h lllightconstants.h lllistbrowser.h lllistcontextmenu.h diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 60c7a737b2..1fbd198019 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -44,7 +44,6 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "llversioninfo.h" -#include "lllicenseinfo.h" #include "llweb.h" // Linden library includes @@ -179,21 +178,26 @@ BOOL LLFloaterAbout::postBuild() contrib_names_widget->setEnabled(FALSE); contrib_names_widget->startOfDoc(); - auto& license_info(LLLicenseInfo::instance()); - if (!license_info.empty()) - { - // Although the iteration is fine if empty(), we only want to clear if not empty(). - // That then uses the (out of date) hard coded value from the XUI. - licenses_widget->clear(); - for (const auto& library : license_info) - { - const std::string& name = library.first; - const LLLicenseInfo::LibraryData& data = library.second; - std::string license_line = name + ": " + data.version + "\n" + data.copyrights + "\n\n"; - licenses_widget->appendText(license_line, FALSE, - LLStyle::Params() .color(about_color)); - } - } + // Get the Versions and Copyrights, created at build time + std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt"); + llifstream licenses_file; + licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ + if (licenses_file.is_open()) + { + std::string license_line; + licenses_widget->clear(); + while ( std::getline(licenses_file, license_line) ) + { + licenses_widget->appendText(license_line+"\n", FALSE, + LLStyle::Params() .color(about_color)); + } + licenses_file.close(); + } + else + { + // this case will use the (out of date) hard coded value from the XUI + LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL; + } licenses_widget->setEnabled(FALSE); licenses_widget->startOfDoc(); diff --git a/indra/newview/lllicenseinfo.cpp b/indra/newview/lllicenseinfo.cpp deleted file mode 100644 index e68b661763..0000000000 --- a/indra/newview/lllicenseinfo.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file lllicenseinfo.cpp - * @brief Routines to access library version and license information - * @author Aech Linden - * - * $LicenseInfo:firstyear=2021&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2021, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "lllicenseinfo.h" -#include -#include "lldir.h" - -LLLicenseInfo::LLLicenseInfo() -{ - LL_DEBUGS("LicenseInfo") << "instantiating license info" << LL_ENDL; -} - -void LLLicenseInfo::initSingleton() -{ - // Get the the map with name => {version, cpyrights}, from file created at build time - std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "packages-info.txt"); - llifstream licenses_file; - licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ - if (!licenses_file.is_open()) { - LL_INFOS("LicenseInfo") << "Could not read licenses file at " << licenses_path << LL_ENDL; - return; - } - - LL_DEBUGS("LicenseInfo") << "Reading licenses file at " << licenses_path << LL_ENDL; - std::string license_line; - std::string name{}, version{}, copyright{}; - while ( std::getline(licenses_file, license_line) ) - { - if (license_line.empty()) // blank line starts a new library/version/copyright - { - if (!name.empty()) { // Add what we have accumulated. - mLibraries.insert({name, {version, copyright}}); - } - else - { - LL_WARNS("LicenseInfo") << "new line with no current data" << LL_ENDL; - } - name.clear(); - version.clear(); - copyright.clear(); - } - else - { - if (name.empty()) { // No name yet. Parse this line into name and version. - auto name_termination_index = license_line.find(':'); - if (name_termination_index == std::string::npos) // First line has no colon. - { - name_termination_index = license_line.find_last_of(' '); - } - name = license_line.substr(0, name_termination_index); - version = license_line.substr(name_termination_index + 1); - boost::algorithm::trim(version); - } else { - copyright += license_line; - } - } - } - licenses_file.close(); -} diff --git a/indra/newview/lllicenseinfo.h b/indra/newview/lllicenseinfo.h deleted file mode 100644 index ff889285b8..0000000000 --- a/indra/newview/lllicenseinfo.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file llicenseinfo.h - * @brief Routines to access library versions and license information - * @author Aech Linden - * - * $LicenseInfo:firstyear=2021&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2021, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLLICENSEINFO_H -#define LL_LLLICENSEINFO_H - -#include "stdtypes.h" -#include "llsingleton.h" -#include - -/// -/// This API provides license information for the viewer. -/// The singleton is initialized once (from package-info.txt), after which -/// it acts like a map of name => {version, copyrights} for each library. -/// -class LLLicenseInfo: public LLSingleton -{ - LLSINGLETON(LLLicenseInfo); - -public: - struct LibraryData - { - std::string version; - std::string copyrights; - }; - typedef std::map LibraryMap; - - /// return the version as a string of the requested library, like "2.0.0.200030" - const std::string& getVersion(const std::string& library_name) const { return mLibraries.at(library_name).version; } - - /// return an indication of whether any library data was found (e.g., false if packages-info.txt is missing) - bool empty() const noexcept { return mLibraries.empty(); }; - - LibraryMap::const_iterator begin() const noexcept { return mLibraries.begin(); }; - LibraryMap::const_iterator end() const noexcept { return mLibraries.end(); }; - -protected: - virtual void initSingleton();; -private: - LibraryMap mLibraries{}; -}; - -#endif -- cgit v1.2.3 From bdd8a52dfef293e19da260804f6156a66f05c236 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Thu, 30 Dec 2021 10:05:52 -0800 Subject: SL-13297 - Record and use build version reported by SLVoice --- indra/newview/llappviewer.cpp | 12 +++++------- indra/newview/llvoiceclient.cpp | 1 + indra/newview/llvoiceclient.h | 1 + indra/newview/llvoicevivox.cpp | 22 +++++++++++++++++++++- indra/newview/llvoicevivox.h | 2 ++ 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 58a164f1d0..cebba9158c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -30,7 +30,6 @@ // Viewer includes #include "llversioninfo.h" -#include "lllicenseinfo.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -3208,18 +3207,17 @@ LLSD LLAppViewer::getViewerInfo() const info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : "Undefined"; if(LLVoiceClient::getInstance()->voiceEnabled()) { - auto& licenseInfo(LLLicenseInfo::instance()); - std::string detailed_version = licenseInfo.getVersion("slvoice"); LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); + std::string buildVersion = version.buildVersion; std::ostringstream version_string; - if (std::equal(detailed_version.begin(), detailed_version.begin() + version.serverVersion.size(), + if (std::equal(buildVersion.begin(), buildVersion.begin() + version.serverVersion.size(), version.serverVersion.begin())) - { // Normal case: Show type and detailed version. - version_string << version.serverType << " " << detailed_version << std::endl; + { // Normal case: Show type and build version. + version_string << version.serverType << " " << buildVersion << std::endl; } else { // Mismatch: Show both versions. - version_string << version.serverVersion << "/" << detailed_version << std::endl; + version_string << version.serverVersion << "/" << buildVersion << std::endl; } info["VOICE_VERSION"] = version_string.str(); } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index e2bd1a39c7..dac609140a 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -200,6 +200,7 @@ const LLVoiceVersionInfo LLVoiceClient::getVersion() LLVoiceVersionInfo result; result.serverVersion = std::string(); result.serverType = std::string(); + result.buildVersion = std::string(); return result; } } diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index cf527a4464..cf6e308fc0 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -95,6 +95,7 @@ struct LLVoiceVersionInfo { std::string serverType; std::string serverVersion; + std::string buildVersion; }; ////////////////////////////////// diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index c7a544f8eb..437633da98 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4548,6 +4548,23 @@ void LLVivoxVoiceClient::sessionNotificationEvent(std::string &sessionHandle, st } } +void LLVivoxVoiceClient::voiceServiceConnectionStateChangedEvent(int statusCode, std::string &statusString, std::string &buildID) +{ + // We don't generally need to process this. However, one occurence is when we first connect, and so it is the + // earliest opportunity to learn what we're connected to. + if (statusCode) + { + LL_WARNS("Voice") << "VoiceServiceConnectionStateChangedEvent statusCode: " << statusCode << + "statusString: " << statusString << LL_ENDL; + return; + } + if (buildID.empty()) + { + return; + } + mVoiceVersion.buildVersion = buildID; +} + void LLVivoxVoiceClient::auxAudioPropertiesEvent(F32 energy) { LL_DEBUGS("VoiceEnergy") << "got energy " << energy << LL_ENDL; @@ -7528,6 +7545,8 @@ void LLVivoxProtocolParser::EndTag(const char *tag) connectorHandle = string; else if (!stricmp("VersionID", tag)) versionID = string; + else if (!stricmp("Version", tag)) + buildID = string; else if (!stricmp("AccountHandle", tag)) accountHandle = string; else if (!stricmp("State", tag)) @@ -7830,7 +7849,8 @@ void LLVivoxProtocolParser::processResponse(std::string tag) // We don't need to process this, but we also shouldn't warn on it, since that confuses people. } else if (!stricmp(eventTypeCstr, "VoiceServiceConnectionStateChangedEvent")) - { // Yet another ignored event + { + LLVivoxVoiceClient::getInstance()->voiceServiceConnectionStateChangedEvent(statusCode, statusString, buildID); } else if (!stricmp(eventTypeCstr, "AudioDeviceHotSwapEvent")) { diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index cf30a4e86a..7e9859d347 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -465,6 +465,7 @@ protected: void participantAddedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString, std::string &displayNameString, int participantType); void participantRemovedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString); void participantUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, bool isModeratorMuted, bool isSpeaking, int volume, F32 energy); + void voiceServiceConnectionStateChangedEvent(int statusCode, std::string &statusString, std::string &buildID); void auxAudioPropertiesEvent(F32 energy); void messageEvent(std::string &sessionHandle, std::string &uriString, std::string &alias, std::string &messageHeader, std::string &messageBody, std::string &applicationString); void sessionNotificationEvent(std::string &sessionHandle, std::string &uriString, std::string ¬ificationType); @@ -969,6 +970,7 @@ protected: std::string actionString; std::string connectorHandle; std::string versionID; + std::string buildID; std::string accountHandle; std::string sessionHandle; std::string sessionGroupHandle; -- cgit v1.2.3 From 183261bc646fa77047ff48c228d491a755ab8f4c Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 5 Jan 2022 15:30:54 -0800 Subject: SL-13297 - Use new teamcity slvoice. --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index bb7cc27233..21f6393381 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3022,9 +3022,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 6ce3cbaed968a69fb7a2cca80220874d + 4d7ac4c41153aca41cc6ff67e69c272a url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80380/758537/slvoice-4.10.0000.32327.5fc3fe7c.558436-darwin64-558436.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92735/837103/slvoice-4.10.0000.32327.5fc3fe7c.567159-darwin64-567159.tar.bz2 name darwin64 @@ -3058,9 +3058,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 2eb38c5eff4d0f18fbb89d0c30c4f0a4 + 8a362efd833acb9bce21123c8442bdea url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80382/758550/slvoice-4.10.0000.32327.5fc3fe7c.558436-windows-558436.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92828/837538/slvoice-4.10.0000.32327.5fc3fe7c.567232-windows-567232.tar.bz2 name windows @@ -3070,16 +3070,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 9ee8f3cbc5369c598a998c61961ed16d + 1868d578f07c32f17e57563d7d8f5e01 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80381/758551/slvoice-4.10.0000.32327.5fc3fe7c.558436-windows64-558436.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92827/837530/slvoice-4.10.0000.32327.5fc3fe7c.567232-windows64-567232.tar.bz2 name windows64 version - 4.10.0000.32327.5fc3fe7c.558436 + 4.10.0000.32327.5fc3fe7c.567159 threejs -- cgit v1.2.3 From 9e30beb5340edcb58af9993bc42d0bbb6786054e Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 5 Jan 2022 16:41:03 -0800 Subject: SL-13297 - bad copypasta --- autobuild.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 21f6393381..413f966c09 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3022,9 +3022,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 4d7ac4c41153aca41cc6ff67e69c272a + 82dd58a6a2b2f5c7ea75ed3ea0831abc url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92735/837103/slvoice-4.10.0000.32327.5fc3fe7c.567159-darwin64-567159.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92831/837552/slvoice-4.10.0000.32327.5fc3fe7c.567232-darwin64-567232.tar.bz2 name darwin64 @@ -3079,7 +3079,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors version - 4.10.0000.32327.5fc3fe7c.567159 + 4.10.0000.32327.5fc3fe7c.567232 threejs -- cgit v1.2.3 From 9ee93d36ba60ddff857e269b2edee67c141e3589 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Thu, 6 Jan 2022 15:50:25 -0800 Subject: SL-13297 - Update autobuild.xml for new 3p-slvoice dependency following commit message changes there. --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 413f966c09..fe1fe0e866 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3022,9 +3022,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 82dd58a6a2b2f5c7ea75ed3ea0831abc + 1d4929e624f848ea7c3a1795306803ac url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92831/837552/slvoice-4.10.0000.32327.5fc3fe7c.567232-darwin64-567232.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92887/837906/slvoice-4.10.0000.32327.5fc3fe7c.567273-darwin64-567273.tar.bz2 name darwin64 @@ -3058,9 +3058,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 8a362efd833acb9bce21123c8442bdea + 70b4c2cab3224d832d1bf04eecfc044a url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92828/837538/slvoice-4.10.0000.32327.5fc3fe7c.567232-windows-567232.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92890/837929/slvoice-4.10.0000.32327.5fc3fe7c.567273-windows-567273.tar.bz2 name windows @@ -3070,16 +3070,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 1868d578f07c32f17e57563d7d8f5e01 + 798290b0986b86913a5914946d8b24af url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92827/837530/slvoice-4.10.0000.32327.5fc3fe7c.567232-windows64-567232.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/92889/837928/slvoice-4.10.0000.32327.5fc3fe7c.567273-windows64-567273.tar.bz2 name windows64 version - 4.10.0000.32327.5fc3fe7c.567232 + 4.10.0000.32327.5fc3fe7c.567273 threejs -- cgit v1.2.3 From 4dfecb6e1a56ac9bff81c27a46f7b4c4eda0a40f Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Thu, 6 Jan 2022 16:33:38 -0800 Subject: SL-13297 - Change names to match coding standard. --- indra/newview/llappviewer.cpp | 8 ++++---- indra/newview/llvoiceclient.cpp | 2 +- indra/newview/llvoiceclient.h | 2 +- indra/newview/llvoicevivox.cpp | 10 +++++----- indra/newview/llvoicevivox.h | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index cebba9158c..c3c9708dc6 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3208,16 +3208,16 @@ LLSD LLAppViewer::getViewerInfo() const if(LLVoiceClient::getInstance()->voiceEnabled()) { LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); - std::string buildVersion = version.buildVersion; + const std::string build_version = version.mBuildVersion; std::ostringstream version_string; - if (std::equal(buildVersion.begin(), buildVersion.begin() + version.serverVersion.size(), + if (std::equal(build_version.begin(), build_version.begin() + version.serverVersion.size(), version.serverVersion.begin())) { // Normal case: Show type and build version. - version_string << version.serverType << " " << buildVersion << std::endl; + version_string << version.serverType << " " << build_version << std::endl; } else { // Mismatch: Show both versions. - version_string << version.serverVersion << "/" << buildVersion << std::endl; + version_string << version.serverVersion << "/" << build_version << std::endl; } info["VOICE_VERSION"] = version_string.str(); } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index dac609140a..d8b8b8749f 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -200,7 +200,7 @@ const LLVoiceVersionInfo LLVoiceClient::getVersion() LLVoiceVersionInfo result; result.serverVersion = std::string(); result.serverType = std::string(); - result.buildVersion = std::string(); + result.mBuildVersion = std::string(); return result; } } diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index cf6e308fc0..246883b611 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -95,7 +95,7 @@ struct LLVoiceVersionInfo { std::string serverType; std::string serverVersion; - std::string buildVersion; + std::string mBuildVersion; }; ////////////////////////////////// diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 437633da98..456537de28 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4548,7 +4548,7 @@ void LLVivoxVoiceClient::sessionNotificationEvent(std::string &sessionHandle, st } } -void LLVivoxVoiceClient::voiceServiceConnectionStateChangedEvent(int statusCode, std::string &statusString, std::string &buildID) +void LLVivoxVoiceClient::voiceServiceConnectionStateChangedEvent(int statusCode, std::string &statusString, std::string &build_id) { // We don't generally need to process this. However, one occurence is when we first connect, and so it is the // earliest opportunity to learn what we're connected to. @@ -4558,11 +4558,11 @@ void LLVivoxVoiceClient::voiceServiceConnectionStateChangedEvent(int statusCode, "statusString: " << statusString << LL_ENDL; return; } - if (buildID.empty()) + if (build_id.empty()) { return; } - mVoiceVersion.buildVersion = buildID; + mVoiceVersion.mBuildVersion = build_id; } void LLVivoxVoiceClient::auxAudioPropertiesEvent(F32 energy) @@ -7546,7 +7546,7 @@ void LLVivoxProtocolParser::EndTag(const char *tag) else if (!stricmp("VersionID", tag)) versionID = string; else if (!stricmp("Version", tag)) - buildID = string; + mBuildID = string; else if (!stricmp("AccountHandle", tag)) accountHandle = string; else if (!stricmp("State", tag)) @@ -7850,7 +7850,7 @@ void LLVivoxProtocolParser::processResponse(std::string tag) } else if (!stricmp(eventTypeCstr, "VoiceServiceConnectionStateChangedEvent")) { - LLVivoxVoiceClient::getInstance()->voiceServiceConnectionStateChangedEvent(statusCode, statusString, buildID); + LLVivoxVoiceClient::getInstance()->voiceServiceConnectionStateChangedEvent(statusCode, statusString, mBuildID); } else if (!stricmp(eventTypeCstr, "AudioDeviceHotSwapEvent")) { diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 7e9859d347..ebc3a62c35 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -465,7 +465,7 @@ protected: void participantAddedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString, std::string &displayNameString, int participantType); void participantRemovedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString); void participantUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, bool isModeratorMuted, bool isSpeaking, int volume, F32 energy); - void voiceServiceConnectionStateChangedEvent(int statusCode, std::string &statusString, std::string &buildID); + void voiceServiceConnectionStateChangedEvent(int statusCode, std::string &statusString, std::string &build_id); void auxAudioPropertiesEvent(F32 energy); void messageEvent(std::string &sessionHandle, std::string &uriString, std::string &alias, std::string &messageHeader, std::string &messageBody, std::string &applicationString); void sessionNotificationEvent(std::string &sessionHandle, std::string &uriString, std::string ¬ificationType); @@ -970,7 +970,7 @@ protected: std::string actionString; std::string connectorHandle; std::string versionID; - std::string buildID; + std::string mBuildID; std::string accountHandle; std::string sessionHandle; std::string sessionGroupHandle; -- cgit v1.2.3