From 4c85c86de1e75a7f20aee1e2de80e35e755060d0 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Thu, 19 Dec 2024 10:35:29 +0100 Subject: [PATCH 01/44] Post-merge translations cleanup, various langauges --- indra/newview/skins/default/xui/az/language_settings.xml | 1 + indra/newview/skins/default/xui/az/notifications.xml | 5 ----- indra/newview/skins/default/xui/de/notifications.xml | 5 ----- .../skins/default/xui/fr/floater_gltf_asset_editor.xml | 8 ++++---- indra/newview/skins/default/xui/fr/notifications.xml | 5 ----- .../skins/default/xui/it/floater_gltf_asset_editor.xml | 8 ++++---- indra/newview/skins/default/xui/ja/notifications.xml | 6 ------ indra/newview/skins/default/xui/ru/language_settings.xml | 1 + indra/newview/skins/default/xui/ru/notifications.xml | 5 ----- .../skins/default/xui/zh/floater_gltf_asset_editor.xml | 8 ++++---- .../skins/default/xui/zh/floater_material_editor.xml | 3 --- indra/newview/skins/default/xui/zh/language_settings.xml | 1 + indra/newview/skins/default/xui/zh/notifications.xml | 5 ----- indra/newview/skins/default/xui/zh/strings.xml | 9 +++++++++ 14 files changed, 24 insertions(+), 46 deletions(-) diff --git a/indra/newview/skins/default/xui/az/language_settings.xml b/indra/newview/skins/default/xui/az/language_settings.xml index 17eecca9cd..858146ff65 100644 --- a/indra/newview/skins/default/xui/az/language_settings.xml +++ b/indra/newview/skins/default/xui/az/language_settings.xml @@ -5,6 +5,7 @@ az-Latn-AZ az-Latn.UTF-8 + az-Latn.UTF-8 az_AZ.UTF-8 az_AZ.UTF-8 diff --git a/indra/newview/skins/default/xui/az/notifications.xml b/indra/newview/skins/default/xui/az/notifications.xml index 2dcc63277d..1b69af4ecf 100644 --- a/indra/newview/skins/default/xui/az/notifications.xml +++ b/indra/newview/skins/default/xui/az/notifications.xml @@ -3947,11 +3947,6 @@ Davam edilsin? Seçilmiş obyekt navigasiya şəbəkəsinə təsir edir. Onu Çevik Yola dəyişdirmək onu navigasiya şəbəkəsindən siləcək. - -[GPUNAME] üçün quraşdırılmış Intel qrafik drayveri, versiya [VERSION] əhəmiyyətli dərəcədə köhnəlib və proqramın həddindən artıq çökməsinə səbəb olduğu bilinir. Sizə cari Intel drayverini yeniləməyiniz tövsiyə olunur. - -Intel drayver veb-saytını yoxlamaq istəyirsiniz? - - Qrafik kartınız minimum tələblərə cavab vermir. diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 1c07d8e3a6..2f2b2035b1 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -4175,11 +4175,6 @@ Sollte das Problem fortbestehen, finden Sie weitere Hilfestellung unter [SUPPORT Ihr Computer entspricht nicht den Hardwareanforderungen von [APP_NAME]. [APP_NAME] setzt eine OpenGL-Grafikkarte mit Multitextur-Unterstützung voraus. Falls Ihre Grafikkarte diese Funktion unterstützt, installieren Sie die neuesten Treiber sowie die aktuellen Service Packs und Patches für Ihr Betriebssystem. Sollte das Problem fortbestehen, finden Sie weitere Hilfestellung unter [SUPPORT_SITE]. - - - Der installierte Intel-Grafikkartentreiber für [GPUNAME], Version [VERSION], ist erheblich veraltet und dafür bekannt, eine Vielzahl von Programmabstürzen zu verursachen. Es wird dringend geraten, auf eine aktuelle Treiberversion zu aktualisieren. - -Möchten Sie die Treiber-Webseite von Intel besuchen? 796 diff --git a/indra/newview/skins/default/xui/fr/floater_gltf_asset_editor.xml b/indra/newview/skins/default/xui/fr/floater_gltf_asset_editor.xml index 74b1d7e318..af83384d68 100644 --- a/indra/newview/skins/default/xui/fr/floater_gltf_asset_editor.xml +++ b/indra/newview/skins/default/xui/fr/floater_gltf_asset_editor.xml @@ -1,10 +1,10 @@ - - - - + + + + diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index e4a5a1b489..3c9db39568 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -4168,11 +4168,6 @@ Si vous continuez à rencontrer des problèmes, veuillez consulter le [SUPPORT_S Vous semblez ne pas avoir le matériel requis pour utiliser [APP_NAME]. [APP_NAME] requiert une carte graphique OpenGL avec une prise en charge du multitexturing. Si vous avez une telle carte, assurez-vous que vous avez aussi les pilotes les plus récents pour la carte, ainsi que les service packs et les patchs pour votre système d'exploitation. Si vous avez toujours des problèmes, veuillez consulter la page [SUPPORT_SITE]. - - - Le pilote graphique Intel installé pour [GPUNAME], version [VERSION], est obsolète et connu pour provoquer un nombre excessif de plantages du programme. Il est conseillé de mettre à jour le pilote Intel. - -Voulez-vous consulter le site web des pilotes Intel ? - Votre carte graphique ne remplit pas les conditions minimum requises. diff --git a/indra/newview/skins/default/xui/it/floater_gltf_asset_editor.xml b/indra/newview/skins/default/xui/it/floater_gltf_asset_editor.xml index 53fa776633..52f4351561 100644 --- a/indra/newview/skins/default/xui/it/floater_gltf_asset_editor.xml +++ b/indra/newview/skins/default/xui/it/floater_gltf_asset_editor.xml @@ -1,10 +1,10 @@ - - - - + + + + diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml index c78d79e313..83c4364ab5 100644 --- a/indra/newview/skins/default/xui/ja/notifications.xml +++ b/indra/newview/skins/default/xui/ja/notifications.xml @@ -4154,12 +4154,6 @@ https://wiki.firestormviewer.org/fs_voice この問題が何度も起きる場合は、[SUPPORT_SITE] をご確認ください。 - -インストールされている [GPUNAME] のインテル製グラフィックドライバのバージョン [VERSION] は極めて古いものとなっており、プログラムのクラッシュを高い頻度で引き起こすことが知られています。最新のインテル製ドライバにアップグレードすることを強くお勧めします。 - -インテルドライバのウェブサイトを確認しますか? - - 796 diff --git a/indra/newview/skins/default/xui/ru/language_settings.xml b/indra/newview/skins/default/xui/ru/language_settings.xml index c246b13474..252e3ec618 100644 --- a/indra/newview/skins/default/xui/ru/language_settings.xml +++ b/indra/newview/skins/default/xui/ru/language_settings.xml @@ -5,6 +5,7 @@ russian ru_RU.UTF-8 + ru_RU.UTF-8 ru_RU.UTF-8 ru_RU.UTF-8 diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml index 1727b97641..cc38c4c698 100644 --- a/indra/newview/skins/default/xui/ru/notifications.xml +++ b/indra/newview/skins/default/xui/ru/notifications.xml @@ -4139,11 +4139,6 @@ https://wiki.firestormviewer.org/fs_voice Выбранный объект влияет на навигационную сетку. Если заменить его на гибкий путь, он будет удален из навигационной сетки. - -Установленный графический драйвер Intel для [GPUNAME], версия [VERSION], значительно устарел и, как известно, вызывает чрезмерно частые сбои программы. Настоятельно рекомендуется установить последнюю версию драйвера Intel. - -Хотите посетить сайт драйверов Intel? - - Графическая карта вашего компьютера не удовлетворяет минимальным требованиям. diff --git a/indra/newview/skins/default/xui/zh/floater_gltf_asset_editor.xml b/indra/newview/skins/default/xui/zh/floater_gltf_asset_editor.xml index 7a13f39131..1924f69ffc 100644 --- a/indra/newview/skins/default/xui/zh/floater_gltf_asset_editor.xml +++ b/indra/newview/skins/default/xui/zh/floater_gltf_asset_editor.xml @@ -1,10 +1,10 @@ - - - - + + + + diff --git a/indra/newview/skins/default/xui/zh/floater_material_editor.xml b/indra/newview/skins/default/xui/zh/floater_material_editor.xml index 4f7dde1672..ded79df6b6 100644 --- a/indra/newview/skins/default/xui/zh/floater_material_editor.xml +++ b/indra/newview/skins/default/xui/zh/floater_material_editor.xml @@ -2,9 +2,6 @@ 無上傳費用 上傳費用[FEE]L$ - 材質選擇 - 選擇材質: - --- 批次上傳全部 --- 編輯材質 diff --git a/indra/newview/skins/default/xui/zh/language_settings.xml b/indra/newview/skins/default/xui/zh/language_settings.xml index fa08861639..07be6dabed 100644 --- a/indra/newview/skins/default/xui/zh/language_settings.xml +++ b/indra/newview/skins/default/xui/zh/language_settings.xml @@ -4,6 +4,7 @@ chinese zh_CN.UTF-8 + zh_CN.UTF-8 zh_CN.UTF-8 zh_CN.UTF-8 聊天未被記錄。要開始儲存記錄,請在「偏好設定」>「隱私」下選擇「儲存:僅記錄」或「儲存:記錄和聊天內容」。 From 8b6ec0994022e6b5ecde4e21f304100101c601ee Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Thu, 19 Dec 2024 10:44:05 +0100 Subject: [PATCH 02/44] Remove " - beta" from language dropdown labels that have active maintainers and are more or less up-to-date --- .../skins/default/xui/az/panel_preferences_general.xml | 6 +++--- .../skins/default/xui/da/panel_preferences_general.xml | 2 +- .../skins/default/xui/de/panel_preferences_general.xml | 8 ++++---- .../skins/default/xui/en/panel_preferences_general.xml | 8 ++++---- .../skins/default/xui/es/panel_preferences_general.xml | 6 +++--- .../skins/default/xui/fr/panel_preferences_general.xml | 6 +++--- .../skins/default/xui/it/panel_preferences_general.xml | 8 ++++---- .../skins/default/xui/ja/panel_preferences_general.xml | 8 ++++---- .../skins/default/xui/pl/panel_preferences_general.xml | 8 ++++---- .../skins/default/xui/pt/panel_preferences_general.xml | 8 ++++---- .../skins/default/xui/ru/panel_preferences_general.xml | 6 +++--- .../skins/default/xui/tr/panel_preferences_general.xml | 8 ++++---- .../skins/default/xui/zh/panel_preferences_general.xml | 8 ++++---- 13 files changed, 45 insertions(+), 45 deletions(-) diff --git a/indra/newview/skins/default/xui/az/panel_preferences_general.xml b/indra/newview/skins/default/xui/az/panel_preferences_general.xml index cb9be52b42..6e8ceb0cd7 100644 --- a/indra/newview/skins/default/xui/az/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/az/panel_preferences_general.xml @@ -9,14 +9,14 @@ - - + + - + (yenidən başlatma tələb olunur) diff --git a/indra/newview/skins/default/xui/da/panel_preferences_general.xml b/indra/newview/skins/default/xui/da/panel_preferences_general.xml index dc013053c2..980fd4aed3 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_general.xml @@ -8,7 +8,7 @@ - + diff --git a/indra/newview/skins/default/xui/de/panel_preferences_general.xml b/indra/newview/skins/default/xui/de/panel_preferences_general.xml index b7d45b03aa..20c7289847 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_general.xml @@ -8,14 +8,14 @@ - - + + - + - + (Erfordert Neustart) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 57b2d42836..c5c7782d94 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -60,12 +60,12 @@ value="es" /> - - + + - + (Redémarrage requis) diff --git a/indra/newview/skins/default/xui/it/panel_preferences_general.xml b/indra/newview/skins/default/xui/it/panel_preferences_general.xml index 66706fd1bb..8b9743f62d 100644 --- a/indra/newview/skins/default/xui/it/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_general.xml @@ -8,14 +8,14 @@ - - + + - + - + (richiede riavvio) diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml index d873baa1fb..1237038e34 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml @@ -8,14 +8,14 @@ - - + + - + - + (再起動後に反映) diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_general.xml b/indra/newview/skins/default/xui/pl/panel_preferences_general.xml index 636b5643df..e4c05f35c1 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_general.xml @@ -9,14 +9,14 @@ - - + + - + - + (Restart wymagany) diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml index 5891b3a8af..6ed188d96d 100644 --- a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml @@ -8,14 +8,14 @@ - - + + - + - + (Reinicie para trocar de idioma) diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml index d49d03935f..d0fe63a251 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml @@ -8,14 +8,14 @@ - - + + - + (Необходим перезапуск) diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_general.xml b/indra/newview/skins/default/xui/tr/panel_preferences_general.xml index 8833f66394..89c70cc654 100644 --- a/indra/newview/skins/default/xui/tr/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_general.xml @@ -8,14 +8,14 @@ - - + + - + - + (Yeniden başlatma gerekir) diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_general.xml b/indra/newview/skins/default/xui/zh/panel_preferences_general.xml index 93d9ff87b7..888f4723f4 100644 --- a/indra/newview/skins/default/xui/zh/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/zh/panel_preferences_general.xml @@ -9,14 +9,14 @@ - - + + - + - + (須重新啟動) From 619f326f9bef61088688b44aa8b60659c44ff336 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 19 Dec 2024 18:21:05 +0100 Subject: [PATCH 03/44] Update Havok TPV lib --- autobuild.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 7ad3b24dc6..34ec81ae09 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1817,9 +1817,9 @@ archive hash - 9f70048bed4c3fc487bee9e9f4276037 + 9520266bd701bddeaa1982c40f11220c url - file:///opt/firestorm/llphysicsextensions_tpv-1.0.11371371972-darwin64-11371371972.tar.bz2 + file:///opt/firestorm/llphysicsextensions_tpv-1.0.12401597145-darwin64-12401597145.tar.bz2 name darwin64 @@ -1841,9 +1841,9 @@ archive hash - 31daa8f133168cc9ab500aa3a235b63c + ab4b9d3ff7b6b53f1ab6d9d3bef012da url - file:///c:/cygwin/opt/firestorm/llphysicsextensions_tpv-1.0.11371371972-windows64-11371371972.tar.bz2 + file:///c:/cygwin/opt/firestorm/llphysicsextensions_tpv-1.0.12401597145-windows64-12401597145.tar.bz2 name windows From d75439985f1ba761ce627c1d145c4d59f7e3b47d Mon Sep 17 00:00:00 2001 From: Beq Date: Tue, 10 Dec 2024 12:19:08 +0000 Subject: [PATCH 04/44] Add non-default settings filter and indicator to debug settings --- indra/newview/llfloatersettingsdebug.cpp | 34 +++++++++++++++---- .../default/xui/en/floater_settings_debug.xml | 24 ++++++++++++- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index ab9b000c49..76df094e0d 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -80,15 +80,17 @@ LLFloaterSettingsDebug::~LLFloaterSettingsDebug() void LLFloaterSettingsDebug::onUpdateFilter() { - std::string searchTerm = mSearchSettingsInput->getValue(); + static LLCachedControl hide_default(gSavedSettings, "DebugSettingsHideDefault", false); + static bool previous_hide_default{hide_default}; + std::string searchTerm = mSearchSettingsInput->getValue(); // make sure not to reselect the first item in the list on focus restore - if (searchTerm == mOldSearchTerm) + if (searchTerm == mOldSearchTerm && previous_hide_default == hide_default) { return; } mOldSearchTerm = searchTerm; - + previous_hide_default = hide_default; mSettingsScrollList->deleteAllItems(); settings_map_t::iterator it; @@ -125,7 +127,25 @@ void LLFloaterSettingsDebug::onUpdateFilter() if (addItem) { LLSD item; - item["columns"][0]["value"] = it->second->getName(); + // indicate non-default settings in debug view + // item["columns"][0]["value"] = it->second->getName(); + // Skip default settings if hide_default is enabled + const auto& setting_name = it->second->getName(); + bool current_setting_is_default = it->second->isDefault(); + + if (hide_default && current_setting_is_default) + { + continue; + } + + item["columns"][1]["column"] = "setting"; + item["columns"][1]["value"] = setting_name; + if (!current_setting_is_default) + { + item["columns"][0]["column"] = "changed_setting"; + item["columns"][0]["value"] = LLSD::String( "*"); // Indicate non-default settings + } + // mSettingsScrollList->addElement(item, ADD_BOTTOM, it->second); } } @@ -134,7 +154,7 @@ void LLFloaterSettingsDebug::onUpdateFilter() // but only if actually a search term was given if (mSettingsScrollList->getItemCount() && !searchTerm.empty()) { - mSettingsScrollList->sortByColumnIndex(0, true); + mSettingsScrollList->sortByColumnIndex(1, true); mSettingsScrollList->selectFirstItem(); } @@ -186,8 +206,10 @@ bool LLFloaterSettingsDebug::postBuild() gSavedPerAccountSettings.applyToAll(&func); } + gSavedSettings.getControl("DebugSettingsHideDefault")->getCommitSignal()->connect(boost::bind(&LLFloaterSettingsDebug::onUpdateFilter, this)); // bind the show changed settings toggle + onUpdateFilter(); - mSettingsScrollList->sortByColumnIndex(0,true); + mSettingsScrollList->sortByColumnIndex(1,true); // Sort by name (column 1) LLNotificationsUtil::add("DebugSettingsWarning"); diff --git a/indra/newview/skins/default/xui/en/floater_settings_debug.xml b/indra/newview/skins/default/xui/en/floater_settings_debug.xml index f490bdb20d..2e18ca4820 100644 --- a/indra/newview/skins/default/xui/en/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/en/floater_settings_debug.xml @@ -53,7 +53,9 @@ + + + + Date: Wed, 11 Dec 2024 01:58:54 +0000 Subject: [PATCH 05/44] Add searchable/filterable attributes to BugSplat New metadata file method. Like the previous method that only aplied to windows this is so far only available on PC and XBox BugSplat APIS. Unmlike the deprecated version, it is expected to be added to MacOS and crashpad "soon". --- indra/newview/CMakeLists.txt | 9 ++ indra/newview/bugsplatattributes.cpp | 132 +++++++++++++++++++++++++++ indra/newview/bugsplatattributes.h | 71 ++++++++++++++ indra/newview/llappviewer.cpp | 35 +++++-- indra/newview/llappviewer.h | 1 + indra/newview/llappviewerwin32.cpp | 101 ++++++++++++++++++-- indra/newview/llappviewerwin32.h | 2 +- 7 files changed, 337 insertions(+), 14 deletions(-) create mode 100644 indra/newview/bugsplatattributes.cpp create mode 100644 indra/newview/bugsplatattributes.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 04cf9f7140..0256c7c78d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1691,6 +1691,15 @@ set(viewer_HEADER_FILES list(APPEND viewer_SOURCE_FILES llperfstats.cpp) list(APPEND viewer_HEADER_FILES llperfstats.h) +if (USE_BUGSPLAT) + list(APPEND viewer_SOURCE_FILES + bugsplatattributes.cpp + ) + list(APPEND viewer_HEADER_FILES + bugsplatattributes.h + ) +endif (USE_BUGSPLAT) + # Flickr / Discord keys and fsversionvalues headers are generated in here include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/indra/newview/bugsplatattributes.cpp b/indra/newview/bugsplatattributes.cpp new file mode 100644 index 0000000000..46febab638 --- /dev/null +++ b/indra/newview/bugsplatattributes.cpp @@ -0,0 +1,132 @@ +#include "bugsplatattributes.h" +#include +#include + +std::wstring BugSplatAttributes::mCrashContextFileName; + +BugSplatAttributes& BugSplatAttributes::instance() +{ + static BugSplatAttributes sInstance; + return sInstance; +} + + +#include +#include + +std::wstring BugSplatAttributes::to_xml_token(const std::wstring& input) +{ + // Example usage: + // std::wstring token = to_xml_token(L"Bandwidth (kbit/s)"); + // The result should be: L"Bandwidth_kbit_per_s" + std::wstring result; + result.reserve(input.size() * 2); // Reserve some space, since we might insert more chars for "/" + + for (wchar_t ch : input) + { + if (ch == L'/') + { + // Replace '/' with "_per_" + result.append(L"_per_"); + } + else if (std::iswalnum(ch) || ch == L'_' || ch == L'-') + { + // Letters, digits, underscore, and hyphen are okay + result.push_back(ch); + } + else if (ch == L' ' || ch == L'(' || ch == L')') + { + // Replace spaces and parentheses with underscore + result.push_back(L'_'); + } + else + { + // Other characters map to underscore + result.push_back(L'_'); + } + } + + // Ensure the first character is a letter or underscore: + // If not, prepend underscore. + if (result.empty() || !(std::iswalpha(result.front()) || result.front() == L'_')) + { + result.insert(result.begin(), L'_'); + } + // trim trailing underscores + while (!result.empty() && result.back() == L'_') + { + result.pop_back(); + } + return result; +} + + + +bool BugSplatAttributes::writeToFile(const std::wstring& file_path) +{ + std::lock_guard lock(mMutex); + + // Write to a temporary file first + std::wstring tmp_file = file_path + L".tmp"; + + { + std::wofstream ofs(tmp_file, std::ios::out | std::ios::trunc); + if (!ofs.good()) + { + return false; + } + + ofs << L"\n"; + ofs << L"\n"; + + // First, write out attributes that have an empty category (top-level) + auto empty_category_it = mAttributes.find(L""); + if (empty_category_it != mAttributes.end()) + { + for (const auto& kv : empty_category_it->second) + { + const std::wstring& key = kv.first; + const std::wstring& val = kv.second; + ofs << L" <" << key << L">" << val << L"\n"; + } + } + + // Write out all other categories + for (const auto& cat_pair : mAttributes) + { + const std::wstring& category = cat_pair.first; + + // Skip empty category since we already handled it above + if (category.empty()) + { + continue; + } + + ofs << L" <" << category << L">\n"; + for (const auto& kv : cat_pair.second) + { + const std::wstring& key = kv.first; + const std::wstring& val = kv.second; + ofs << L" <" << key << L">" << val << L"\n"; + } + ofs << L" \n"; + } + + ofs << L"\n"; + + // Close the file before renaming + ofs.close(); + } + + // Rename the temp file to the final file. If rename fails, leave the old file intact. + std::error_code ec; + std::filesystem::rename(tmp_file, file_path, ec); + if (ec) + { + // Rename failed, remove the temp file and return false + std::filesystem::remove(tmp_file, ec); + return false; + } + + return true; +} diff --git a/indra/newview/bugsplatattributes.h b/indra/newview/bugsplatattributes.h new file mode 100644 index 0000000000..8155225ac3 --- /dev/null +++ b/indra/newview/bugsplatattributes.h @@ -0,0 +1,71 @@ +#ifndef BUGSPLATATTRIBUTES_INCLUDED +#define BUGSPLATATTRIBUTES_INCLUDED +#ifdef LL_BUGSPLAT +// Currently on Windows BugSplat supports the new attributes file, but it is expected to be added to Mac and Linux soon. + +#include +#include +#include + +class BugSplatAttributes +{ +public: + // Obtain the singleton instance + static BugSplatAttributes& instance(); + + template + void setAttribute(const std::wstring& key, const T& value, const std::wstring& category = L"FS") + { + std::lock_guard lock(mMutex); + const auto& xml_key = to_xml_token(key); + if constexpr (std::is_same_v) + { + // Already wide string + mAttributes[category][xml_key] = value; + } + else if constexpr (std::is_same_v || std::is_array_v) + { + // Handle wide string literals and arrays (which includes string literals) + mAttributes[category][xml_key] = std::wstring(value); + } + else if constexpr (std::is_same_v) + { + // Convert narrow to wide + std::wstring wide_value(value.begin(), value.end()); + mAttributes[category][xml_key] = wide_value; + } + else if constexpr (std::is_same_v) + { + // Convert boolean to "true"/"false" + mAttributes[category][xml_key] = value ? L"true" : L"false"; + } + else if constexpr (std::is_arithmetic_v) + { + // Convert arithmetic types (int, float, double, etc.) to wstring + mAttributes[category][xml_key] = std::to_wstring(value); + } + else + { + static_assert(!sizeof(T*), "No known conversion for this type to std::wstring."); + } + } + // Returns true on success, false on failure. + bool writeToFile(const std::wstring& file_path); + const static std::wstring& getCrashContextFileName() { return mCrashContextFileName; } + static void setCrashContextFileName(const std::wstring& file_name) { mCrashContextFileName = file_name; } +private: + BugSplatAttributes() = default; + ~BugSplatAttributes() = default; + BugSplatAttributes(const BugSplatAttributes&) = delete; + BugSplatAttributes& operator=(const BugSplatAttributes&) = delete; + std::wstring to_xml_token(const std::wstring& input); + // Internal structure to hold attributes by category + // For example: + // attributes_["RuntimeProperties"]["CrashGUID"] = L"649F57B7EE6E92A0_0000" + std::unordered_map> mAttributes; + std::mutex mMutex; + static std::wstring mCrashContextFileName; +}; + +#endif // LL_BUGSPLAT +#endif // BUGSPLATATTRIBUTES_INCLUDED \ No newline at end of file diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2b9d642aa7..522ae59736 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -289,7 +289,7 @@ using namespace LL; #include "fsradar.h" #include "fsassetblacklist.h" - +#include "bugsplatattributes.h" // #include "fstelemetry.h" // Tracy profiler support #if LL_LINUX && LL_GTK @@ -767,6 +767,10 @@ LLAppViewer::LLAppViewer() // MAINT-8917: don't create a dump directory just for the // static_debug_info.log file std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + // Improve Bugsplat tracking by using attribu + std::wstring wlogdir(logdir.begin(), logdir.end()); + BugSplatAttributes::setCrashContextFileName(wlogdir + L"crash-context.xml"); + // # else // ! LL_BUGSPLAT // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); @@ -3762,6 +3766,10 @@ bool LLAppViewer::waitForUpdater() void LLAppViewer::writeDebugInfo(bool isStatic) { #if LL_WINDOWS && LL_BUGSPLAT + // Improve Bugsplat tracking by using attributes for certain static data items. + const LLSD& info = getViewerInfo(); + bugsplatAddStaticAttributes(info); + // // bugsplat does not create dump folder and debug logs are written directly // to logs folder, so it conflicts with main instance if (mSecondInstance) @@ -3970,10 +3978,17 @@ LLSD LLAppViewer::getViewerInfo() const info["OPENGL_VERSION"] = ll_safe_string((const char*)(glGetString(GL_VERSION))); info["LIBCURL_VERSION"] = LLCore::LLHttp::getCURLVersion(); // Settings - - LLRect window_rect = gViewerWindow->getWindowRectRaw(); - info["WINDOW_WIDTH"] = window_rect.getWidth(); - info["WINDOW_HEIGHT"] = window_rect.getHeight(); + // gViewerWindow can be null on shutdown. Crashes if bugsplatt uses the info + // LLRect window_rect = gViewerWindow->getWindowRectRaw(); + // info["WINDOW_WIDTH"] = window_rect.getWidth(); + // info["WINDOW_HEIGHT"] = window_rect.getHeight(); + if(gViewerWindow) + { + LLRect window_rect = gViewerWindow->getWindowRectRaw(); + info["WINDOW_WIDTH"] = window_rect.getWidth(); + info["WINDOW_HEIGHT"] = window_rect.getHeight(); + } + // // Custom sysinfo //info["FONT_SIZE_ADJUSTMENT"] = gSavedSettings.getF32("FontScreenDPI"); @@ -3994,7 +4009,7 @@ LLSD LLAppViewer::getViewerInfo() const info["J2C_VERSION"] = LLImageJ2C::getEngineInfo(); bool want_fullname = true; info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : "Undefined"; - if(LLVoiceClient::getInstance()->voiceEnabled()) + if(LLStartUp::getStartupState() == STATE_STARTED && LLVoiceClient::getInstance()->voiceEnabled()) // Calling this too earli leads to a nasty crash loop { LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); const std::string build_version = version.mBuildVersion; @@ -4086,7 +4101,13 @@ LLSD LLAppViewer::getViewerInfo() const } // populate field for new local disk cache with some details - info["DISK_CACHE_INFO"] = LLDiskCache::getInstance()->getCacheInfo(); + // only populate if the cache is available + // info["DISK_CACHE_INFO"] = LLDiskCache::getInstance()->getCacheInfo(); + if (auto cache = LLDiskCache::getInstance(); cache) + { + info["DISK_CACHE_INFO"] = cache->getCacheInfo(); + } + // // FIRE-4785: Current render quality setting in sysinfo / about floater switch (gSavedSettings.getU32("RenderQualityPerformance")) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 1183ab7f6c..40b686c094 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -253,6 +253,7 @@ protected: virtual void overrideDetectedHardware(); // Override VRAM (and others in future?) consistently. virtual bool initSLURLHandler(); virtual bool sendURLToOtherInstance(const std::string& url); + virtual void bugsplatAddStaticAttributes(const LLSD& info) {/*empty*/}; // create a NOOP base impl virtual bool initParseCommandLine(LLCommandLineParser& clp) { return true; } // Allow platforms to specify the command line args. diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 4361107589..643b1ab321 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -75,6 +75,7 @@ // Bugsplat (http://bugsplat.com) crash reporting tool #ifdef LL_BUGSPLAT +#include "bugsplatattributes.h" #include "BugSplat.h" #include "boost/json.hpp" // Boost.Json #include "llagent.h" // for agent location @@ -164,6 +165,7 @@ namespace flavor = "oss"; #endif sBugSplatSender->setDefaultUserEmail( WCSTR(STRINGIZE(LLOSInfo::instance().getOSStringSimple() << " (" << ADDRESS_SIZE << "-bit, flavor " << flavor <<")"))); + // BugSplatAttributes::instance().setAttribute(L"Flavor", flavor); // // Clear out username first, as we get some crashes that has the OS set as username, let's see if this fixes it. Use Crash.Linden as a usr can never have a "Linden" @@ -195,7 +197,6 @@ namespace // LL_ERRS message, when there is one sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); - sBugSplatSender->setAttribute(WCSTR(L"OS"), WCSTR(LLOSInfo::instance().getOSStringSimple())); // In case we ever stop using email for this sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString())); sBugSplatSender->setAttribute(WCSTR(L"GL Vendor"), WCSTR(gGLManager.mGLVendor)); @@ -203,18 +204,41 @@ namespace sBugSplatSender->setAttribute(WCSTR(L"GPU Version"), WCSTR(gGLManager.mDriverVersionVendorString)); sBugSplatSender->setAttribute(WCSTR(L"GL Renderer"), WCSTR(gGLManager.mGLRenderer)); sBugSplatSender->setAttribute(WCSTR(L"VRAM"), WCSTR(STRINGIZE(gGLManager.mVRAM))); - sBugSplatSender->setAttribute(WCSTR(L"RAM"), WCSTR(STRINGIZE(gSysMemory.getPhysicalMemoryKB().value()))); + // sBugSplatSender->setAttribute(WCSTR(L"RAM"), WCSTR(STRINGIZE(gSysMemory.getPhysicalMemoryKB().value()))); + // Improve bugsplpat reporting with attributes + // sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); + // sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString())); + auto fatal_message = LLError::getFatalMessage(); + sBugSplatSender->setDefaultUserDescription(WCSTR(fatal_message)); + BugSplatAttributes::instance().setAttribute(L"FatalMessage", fatal_message); // Store this additionally as an attribute in case user overwrites. + // App state + BugSplatAttributes::instance().setAttribute(L"AppState", LLStartUp::getStartupStateString()); + // Location + // if (gAgent.getRegion()) { // region location, when we have it - LLVector3 loc = gAgent.getPositionAgent(); - sBugSplatSender->resetAppIdentifier( - WCSTR(STRINGIZE(gAgent.getRegion()->getName() + // Improve bugsplat reporting with attributes + // LLVector3 loc = gAgent.getPositionAgent(); + // sBugSplatSender->resetAppIdentifier( + // WCSTR(STRINGIZE(gAgent.getRegion()->getName() + // << '/' << loc.mV[0] + // << '/' << loc.mV[1] + // << '/' << loc.mV[2]))); + const LLVector3 loc = gAgent.getPositionAgent(); + const auto & fullLocation = STRINGIZE(gAgent.getRegion()->getName() << '/' << loc.mV[0] << '/' << loc.mV[1] - << '/' << loc.mV[2]))); + << '/' << loc.mV[2]); + sBugSplatSender->resetAppIdentifier(WCSTR(fullLocation)); + BugSplatAttributes::instance().setAttribute(L"Location", std::string(fullLocation)); + // } + // Improve bugsplat reporting with attributes + LLAppViewer::instance()->writeDebugInfo(); + sBugSplatSender->sendAdditionalFile(WCSTR(BugSplatAttributes::getCrashContextFileName())); // Add the new attributes file + // } // MDSCB_EXCEPTIONCODE return false; @@ -619,6 +643,71 @@ int APIENTRY wWinMain(HINSTANCE hInstance, } } #endif +// Use the Attributes API on Windows to enhance crash metadata +void LLAppViewerWin32::bugsplatAddStaticAttributes(const LLSD& info) +{ +#ifdef LL_BUGSPLAT + static bool write_statics = true; + + auto& bugSplatMap = BugSplatAttributes::instance(); + + if (write_statics) + { + write_statics = false; + auto multipleInstances = gDebugInfo["FoundOtherInstanceAtStartup"].asBoolean(); + bugSplatMap.setAttribute(L"MultipleInstance", multipleInstances); + + bugSplatMap.setAttribute(L"GPU", info["GRAPHICS_CARD"].asString()); + bugSplatMap.setAttribute(L"GPU VRAM (MB)", info["GRAPHICS_CARD_MEMORY"].asInteger()); + bugSplatMap.setAttribute(L"GPU VRAM Detected (MB)", info["GRAPHICS_CARD_MEMORY_DETECTED"].asInteger()); + bugSplatMap.setAttribute(L"GPU VRAM (Budget)", info["VRAM_BUDGET_ENGLISH"].asInteger()); + + bugSplatMap.setAttribute(L"CPU", info["CPU"].asString()); + bugSplatMap.setAttribute(L"Graphics Driver", info["GRAPHICS_DRIVER_VERSION"].asString()); + bugSplatMap.setAttribute(L"CPU MHz", (S32)gSysCPU.getMHz()); // +#ifdef USE_AVX2_OPTIMIZATION + bugSplatMap.setAttribute(L"SIMD", L"AVX2"); +#elif USE_AVX_OPTIMIZATION + bugSplatMap.setAttribute(L"SIMD", L"AVX"); +#else + bugSplatMap.setAttribute(L"SIMD", L"SSE2"); +#endif + // set physical ram integer as a string attribute + bugSplatMap.setAttribute(L"Physical RAM (KB)", LLMemory::getMaxMemKB().value()); + bugSplatMap.setAttribute(L"OpenGL Version", info["OPENGL_VERSION"].asString()); + bugSplatMap.setAttribute(L"libcurl Version", info["LIBCURL_VERSION"].asString()); + bugSplatMap.setAttribute(L"J2C Decoder Version", info["J2C_VERSION"].asString()); + bugSplatMap.setAttribute(L"Audio Driver Version", info["AUDIO_DRIVER_VERSION"].asString()); + // bugSplatMap.setAttribute(L"CEF Info", info["LIBCEF_VERSION"].asString()); + bugSplatMap.setAttribute(L"LibVLC Version", info["LIBVLC_VERSION"].asString()); + bugSplatMap.setAttribute(L"Vivox Version", info["VOICE_VERSION"].asString()); + bugSplatMap.setAttribute(L"RLVa", info["RLV_VERSION"].asString()); + bugSplatMap.setAttribute(L"Mode", info["MODE"].asString()); + bugSplatMap.setAttribute(L"Skin", llformat("%s (%s)", info["SKIN"].asString().c_str(), info["THEME"].asString().c_str())); + #if LL_DARWIN + bugSplatMap.setAttribute(L"HiDPI", info["HIDPI"].asBoolean() ? L"Enabled" : L"Disabled"); + #endif + } + // These attributes are potentially dynamic + bugSplatMap.setAttribute(L"Packets Lost", llformat("%.0f/%.0f (%.1f%%)", info["PACKETS_LOST"].asReal(), info["PACKETS_IN"].asReal(), info["PACKETS_PCT"].asReal())); + bugSplatMap.setAttribute(L"Window Size", llformat("%sx%s px", info["WINDOW_WIDTH"].asString().c_str(), info["WINDOW_HEIGHT"].asString().c_str())); + bugSplatMap.setAttribute(L"Draw Distance (m)", info["DRAW_DISTANCE"].asInteger()); + bugSplatMap.setAttribute(L"Bandwidth (kbit/s)", info["BANDWIDTH"].asInteger()); + bugSplatMap.setAttribute(L"LOD Factor", info["LOD"].asReal()); + bugSplatMap.setAttribute(L"Render quality", info["RENDERQUALITY_FSDATA_ENGLISH"].asString()); + bugSplatMap.setAttribute(L"Disk Cache", info["DISK_CACHE_INFO"].asString()); + + bugSplatMap.setAttribute(L"GridName", gDebugInfo["GridName"].asString()); + bugSplatMap.setAttribute(L"Available RAM (KB)", LLMemory::getAvailableMemKB().value()); + bugSplatMap.setAttribute(L"Allocated RAM (KB)", LLMemory::getAllocatedMemKB().value()); + + if (bugSplatMap.writeToFile(BugSplatAttributes::getCrashContextFileName())) + { + LL_INFOS() << "Crash context saved to " << WCSTR(BugSplatAttributes::getCrashContextFileName()) << LL_ENDL; + } +#endif +} +// void LLAppViewerWin32::disableWinErrorReporting() { diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h index 1be4c62ee5..90ed468bc1 100644 --- a/indra/newview/llappviewerwin32.h +++ b/indra/newview/llappviewerwin32.h @@ -62,7 +62,7 @@ protected: private: void disableWinErrorReporting(); - + void bugsplatAddStaticAttributes(const LLSD& info) override; // override for windows attributes std::string mCmdLine; bool mIsConsoleAllocated; From efb249b6d468f58e26d5a0ee9898d038e69b3aaf Mon Sep 17 00:00:00 2001 From: Beq Date: Wed, 11 Dec 2024 20:41:52 +0000 Subject: [PATCH 06/44] make this build on Linux. --- indra/newview/bugsplatattributes.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/bugsplatattributes.cpp b/indra/newview/bugsplatattributes.cpp index 46febab638..f721687f72 100644 --- a/indra/newview/bugsplatattributes.cpp +++ b/indra/newview/bugsplatattributes.cpp @@ -1,4 +1,5 @@ #include "bugsplatattributes.h" +#include "llstring.h" #include #include @@ -67,10 +68,18 @@ bool BugSplatAttributes::writeToFile(const std::wstring& file_path) std::lock_guard lock(mMutex); // Write to a temporary file first + #ifdef LL_WINDOWS std::wstring tmp_file = file_path + L".tmp"; + #else // use non-wide characters for Linux and Mac + std::string tmp_file = ll_convert_wide_to_string(file_path) + ".tmp"; + #endif { + #ifdef LL_WINDOWS std::wofstream ofs(tmp_file, std::ios::out | std::ios::trunc); + #else // use non-wide characters for Linux and Mac + std::ofstream ofs(tmp_file, std::ios::out | std::ios::trunc); + #endif if (!ofs.good()) { return false; From 267512126dc5d4702da8ca4ed06a9e2782666b58 Mon Sep 17 00:00:00 2001 From: Beq Date: Fri, 13 Dec 2024 12:25:13 +0000 Subject: [PATCH 07/44] Remove wide-strings as they are more trouble than they are worth these were only ever wide strings because the BS API for windows had that. This is now written to XML. --- indra/newview/bugsplatattributes.cpp | 62 ++++++++++------------- indra/newview/bugsplatattributes.h | 38 +++++++------- indra/newview/llappviewer.cpp | 5 +- indra/newview/llappviewerwin32.cpp | 74 ++++++++++++++-------------- 4 files changed, 83 insertions(+), 96 deletions(-) diff --git a/indra/newview/bugsplatattributes.cpp b/indra/newview/bugsplatattributes.cpp index f721687f72..f2004be34a 100644 --- a/indra/newview/bugsplatattributes.cpp +++ b/indra/newview/bugsplatattributes.cpp @@ -1,9 +1,8 @@ #include "bugsplatattributes.h" -#include "llstring.h" #include #include -std::wstring BugSplatAttributes::mCrashContextFileName; +std::string BugSplatAttributes::mCrashContextFileName; BugSplatAttributes& BugSplatAttributes::instance() { @@ -15,46 +14,46 @@ BugSplatAttributes& BugSplatAttributes::instance() #include #include -std::wstring BugSplatAttributes::to_xml_token(const std::wstring& input) +std::string BugSplatAttributes::to_xml_token(const std::string& input) { // Example usage: // std::wstring token = to_xml_token(L"Bandwidth (kbit/s)"); // The result should be: L"Bandwidth_kbit_per_s" - std::wstring result; + std::string result; result.reserve(input.size() * 2); // Reserve some space, since we might insert more chars for "/" - for (wchar_t ch : input) + for (char ch : input) { - if (ch == L'/') + if (ch == '/') { // Replace '/' with "_per_" - result.append(L"_per_"); + result.append("_per_"); } - else if (std::iswalnum(ch) || ch == L'_' || ch == L'-') + else if (std::isalnum(ch) || ch == '_' || ch == '-') { // Letters, digits, underscore, and hyphen are okay result.push_back(ch); } - else if (ch == L' ' || ch == L'(' || ch == L')') + else if (ch == ' ' || ch == '(' || ch == ')') { // Replace spaces and parentheses with underscore - result.push_back(L'_'); + result.push_back('_'); } else { // Other characters map to underscore - result.push_back(L'_'); + result.push_back('_'); } } // Ensure the first character is a letter or underscore: // If not, prepend underscore. - if (result.empty() || !(std::iswalpha(result.front()) || result.front() == L'_')) + if (result.empty() || !(std::isalpha(result.front()) || result.front() == '_')) { - result.insert(result.begin(), L'_'); + result.insert(result.begin(), '_'); } // trim trailing underscores - while (!result.empty() && result.back() == L'_') + while (!result.empty() && result.back() == '_') { result.pop_back(); } @@ -63,23 +62,14 @@ std::wstring BugSplatAttributes::to_xml_token(const std::wstring& input) -bool BugSplatAttributes::writeToFile(const std::wstring& file_path) +bool BugSplatAttributes::writeToFile(const std::string& file_path) { std::lock_guard lock(mMutex); // Write to a temporary file first - #ifdef LL_WINDOWS - std::wstring tmp_file = file_path + L".tmp"; - #else // use non-wide characters for Linux and Mac - std::string tmp_file = ll_convert_wide_to_string(file_path) + ".tmp"; - #endif - + std::string tmp_file = file_path + ".tmp"; { - #ifdef LL_WINDOWS - std::wofstream ofs(tmp_file, std::ios::out | std::ios::trunc); - #else // use non-wide characters for Linux and Mac std::ofstream ofs(tmp_file, std::ios::out | std::ios::trunc); - #endif if (!ofs.good()) { return false; @@ -89,21 +79,21 @@ bool BugSplatAttributes::writeToFile(const std::wstring& file_path) ofs << L"\n"; // First, write out attributes that have an empty category (top-level) - auto empty_category_it = mAttributes.find(L""); + auto empty_category_it = mAttributes.find(""); if (empty_category_it != mAttributes.end()) { for (const auto& kv : empty_category_it->second) { - const std::wstring& key = kv.first; - const std::wstring& val = kv.second; - ofs << L" <" << key << L">" << val << L"\n"; + const std::string& key = kv.first; + const std::string& val = kv.second; + ofs << " <" << key << ">" << val << "\n"; } } // Write out all other categories for (const auto& cat_pair : mAttributes) { - const std::wstring& category = cat_pair.first; + const std::string& category = cat_pair.first; // Skip empty category since we already handled it above if (category.empty()) @@ -111,17 +101,17 @@ bool BugSplatAttributes::writeToFile(const std::wstring& file_path) continue; } - ofs << L" <" << category << L">\n"; + ofs << " <" << category << ">\n"; for (const auto& kv : cat_pair.second) { - const std::wstring& key = kv.first; - const std::wstring& val = kv.second; - ofs << L" <" << key << L">" << val << L"\n"; + const std::string& key = kv.first; + const std::string& val = kv.second; + ofs << " <" << key << ">" << val << "\n"; } - ofs << L" \n"; + ofs << " \n"; } - ofs << L"\n"; + ofs << "\n"; // Close the file before renaming ofs.close(); diff --git a/indra/newview/bugsplatattributes.h b/indra/newview/bugsplatattributes.h index 8155225ac3..44c9069fe0 100644 --- a/indra/newview/bugsplatattributes.h +++ b/indra/newview/bugsplatattributes.h @@ -14,57 +14,55 @@ public: static BugSplatAttributes& instance(); template - void setAttribute(const std::wstring& key, const T& value, const std::wstring& category = L"FS") + void setAttribute(const std::string& key, const T& value, const std::string& category = "FS") { std::lock_guard lock(mMutex); const auto& xml_key = to_xml_token(key); - if constexpr (std::is_same_v) + if constexpr (std::is_same_v) { - // Already wide string mAttributes[category][xml_key] = value; } - else if constexpr (std::is_same_v || std::is_array_v) + else if constexpr (std::is_same_v) { - // Handle wide string literals and arrays (which includes string literals) - mAttributes[category][xml_key] = std::wstring(value); + // Wide to narrow + mAttributes[category][xml_key] = ll_convert_wide_to_string(value); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v || std::is_array_v) { - // Convert narrow to wide - std::wstring wide_value(value.begin(), value.end()); - mAttributes[category][xml_key] = wide_value; + // Handle string literals and arrays (which includes string literals) + mAttributes[category][xml_key] = std::string(value); } else if constexpr (std::is_same_v) { // Convert boolean to "true"/"false" - mAttributes[category][xml_key] = value ? L"true" : L"false"; + mAttributes[category][xml_key] = value ? "true" : "false"; } else if constexpr (std::is_arithmetic_v) { // Convert arithmetic types (int, float, double, etc.) to wstring - mAttributes[category][xml_key] = std::to_wstring(value); + mAttributes[category][xml_key] = std::to_string(value); } else { - static_assert(!sizeof(T*), "No known conversion for this type to std::wstring."); + static_assert(!sizeof(T*), "No known conversion for this type to std::string."); } } // Returns true on success, false on failure. - bool writeToFile(const std::wstring& file_path); - const static std::wstring& getCrashContextFileName() { return mCrashContextFileName; } - static void setCrashContextFileName(const std::wstring& file_name) { mCrashContextFileName = file_name; } + bool writeToFile(const std::string& file_path); + const static std::string& getCrashContextFileName() { return mCrashContextFileName; } + static void setCrashContextFileName(const std::string& file_name) { mCrashContextFileName = file_name; } private: BugSplatAttributes() = default; ~BugSplatAttributes() = default; BugSplatAttributes(const BugSplatAttributes&) = delete; BugSplatAttributes& operator=(const BugSplatAttributes&) = delete; - std::wstring to_xml_token(const std::wstring& input); + std::string to_xml_token(const std::string& input); // Internal structure to hold attributes by category // For example: - // attributes_["RuntimeProperties"]["CrashGUID"] = L"649F57B7EE6E92A0_0000" - std::unordered_map> mAttributes; + // mAttributes["RuntimeProperties"]["CrashGUID"] = "649F57B7EE6E92A0_0000" + std::unordered_map> mAttributes; std::mutex mMutex; - static std::wstring mCrashContextFileName; + static std::string mCrashContextFileName; }; #endif // LL_BUGSPLAT diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 522ae59736..e55c345018 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -767,9 +767,8 @@ LLAppViewer::LLAppViewer() // MAINT-8917: don't create a dump directory just for the // static_debug_info.log file std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); - // Improve Bugsplat tracking by using attribu - std::wstring wlogdir(logdir.begin(), logdir.end()); - BugSplatAttributes::setCrashContextFileName(wlogdir + L"crash-context.xml"); + // Improve Bugsplat tracking by using attributes + BugSplatAttributes::setCrashContextFileName(logdir + "crash-context.xml"); // # else // ! LL_BUGSPLAT // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 643b1ab321..30c9cfb183 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -165,7 +165,7 @@ namespace flavor = "oss"; #endif sBugSplatSender->setDefaultUserEmail( WCSTR(STRINGIZE(LLOSInfo::instance().getOSStringSimple() << " (" << ADDRESS_SIZE << "-bit, flavor " << flavor <<")"))); - // BugSplatAttributes::instance().setAttribute(L"Flavor", flavor); + BugSplatAttributes::instance().setAttribute("Flavor", flavor); // // Clear out username first, as we get some crashes that has the OS set as username, let's see if this fixes it. Use Crash.Linden as a usr can never have a "Linden" @@ -211,9 +211,9 @@ namespace auto fatal_message = LLError::getFatalMessage(); sBugSplatSender->setDefaultUserDescription(WCSTR(fatal_message)); - BugSplatAttributes::instance().setAttribute(L"FatalMessage", fatal_message); // Store this additionally as an attribute in case user overwrites. + BugSplatAttributes::instance().setAttribute("FatalMessage", fatal_message); // Store this additionally as an attribute in case user overwrites. // App state - BugSplatAttributes::instance().setAttribute(L"AppState", LLStartUp::getStartupStateString()); + BugSplatAttributes::instance().setAttribute("AppState", LLStartUp::getStartupStateString()); // Location // if (gAgent.getRegion()) @@ -232,7 +232,7 @@ namespace << '/' << loc.mV[1] << '/' << loc.mV[2]); sBugSplatSender->resetAppIdentifier(WCSTR(fullLocation)); - BugSplatAttributes::instance().setAttribute(L"Location", std::string(fullLocation)); + BugSplatAttributes::instance().setAttribute("Location", std::string(fullLocation)); // } // Improve bugsplat reporting with attributes @@ -655,51 +655,51 @@ void LLAppViewerWin32::bugsplatAddStaticAttributes(const LLSD& info) { write_statics = false; auto multipleInstances = gDebugInfo["FoundOtherInstanceAtStartup"].asBoolean(); - bugSplatMap.setAttribute(L"MultipleInstance", multipleInstances); + bugSplatMap.setAttribute("MultipleInstance", multipleInstances); - bugSplatMap.setAttribute(L"GPU", info["GRAPHICS_CARD"].asString()); - bugSplatMap.setAttribute(L"GPU VRAM (MB)", info["GRAPHICS_CARD_MEMORY"].asInteger()); - bugSplatMap.setAttribute(L"GPU VRAM Detected (MB)", info["GRAPHICS_CARD_MEMORY_DETECTED"].asInteger()); - bugSplatMap.setAttribute(L"GPU VRAM (Budget)", info["VRAM_BUDGET_ENGLISH"].asInteger()); + bugSplatMap.setAttribute("GPU", info["GRAPHICS_CARD"].asString()); + bugSplatMap.setAttribute("GPU VRAM (MB)", info["GRAPHICS_CARD_MEMORY"].asInteger()); + bugSplatMap.setAttribute("GPU VRAM Detected (MB)", info["GRAPHICS_CARD_MEMORY_DETECTED"].asInteger()); + bugSplatMap.setAttribute("GPU VRAM (Budget)", info["VRAM_BUDGET_ENGLISH"].asInteger()); - bugSplatMap.setAttribute(L"CPU", info["CPU"].asString()); - bugSplatMap.setAttribute(L"Graphics Driver", info["GRAPHICS_DRIVER_VERSION"].asString()); - bugSplatMap.setAttribute(L"CPU MHz", (S32)gSysCPU.getMHz()); // + bugSplatMap.setAttribute("CPU", info["CPU"].asString()); + bugSplatMap.setAttribute("Graphics Driver", info["GRAPHICS_DRIVER_VERSION"].asString()); + bugSplatMap.setAttribute("CPU MHz", (S32)gSysCPU.getMHz()); // #ifdef USE_AVX2_OPTIMIZATION - bugSplatMap.setAttribute(L"SIMD", L"AVX2"); + bugSplatMap.setAttribute("SIMD", "AVX2"); #elif USE_AVX_OPTIMIZATION - bugSplatMap.setAttribute(L"SIMD", L"AVX"); + bugSplatMap.setAttribute("SIMD", "AVX"); #else - bugSplatMap.setAttribute(L"SIMD", L"SSE2"); + bugSplatMap.setAttribute("SIMD", "SSE2"); #endif // set physical ram integer as a string attribute - bugSplatMap.setAttribute(L"Physical RAM (KB)", LLMemory::getMaxMemKB().value()); - bugSplatMap.setAttribute(L"OpenGL Version", info["OPENGL_VERSION"].asString()); - bugSplatMap.setAttribute(L"libcurl Version", info["LIBCURL_VERSION"].asString()); - bugSplatMap.setAttribute(L"J2C Decoder Version", info["J2C_VERSION"].asString()); - bugSplatMap.setAttribute(L"Audio Driver Version", info["AUDIO_DRIVER_VERSION"].asString()); - // bugSplatMap.setAttribute(L"CEF Info", info["LIBCEF_VERSION"].asString()); - bugSplatMap.setAttribute(L"LibVLC Version", info["LIBVLC_VERSION"].asString()); - bugSplatMap.setAttribute(L"Vivox Version", info["VOICE_VERSION"].asString()); - bugSplatMap.setAttribute(L"RLVa", info["RLV_VERSION"].asString()); - bugSplatMap.setAttribute(L"Mode", info["MODE"].asString()); - bugSplatMap.setAttribute(L"Skin", llformat("%s (%s)", info["SKIN"].asString().c_str(), info["THEME"].asString().c_str())); + bugSplatMap.setAttribute("Physical RAM (KB)", LLMemory::getMaxMemKB().value()); + bugSplatMap.setAttribute("OpenGL Version", info["OPENGL_VERSION"].asString()); + bugSplatMap.setAttribute("libcurl Version", info["LIBCURL_VERSION"].asString()); + bugSplatMap.setAttribute("J2C Decoder Version", info["J2C_VERSION"].asString()); + bugSplatMap.setAttribute("Audio Driver Version", info["AUDIO_DRIVER_VERSION"].asString()); + // bugSplatMap.setAttribute("CEF Info", info["LIBCEF_VERSION"].asString()); + bugSplatMap.setAttribute("LibVLC Version", info["LIBVLC_VERSION"].asString()); + bugSplatMap.setAttribute("Vivox Version", info["VOICE_VERSION"].asString()); + bugSplatMap.setAttribute("RLVa", info["RLV_VERSION"].asString()); + bugSplatMap.setAttribute("Mode", info["MODE"].asString()); + bugSplatMap.setAttribute("Skin", llformat("%s (%s)", info["SKIN"].asString().c_str(), info["THEME"].asString().c_str())); #if LL_DARWIN - bugSplatMap.setAttribute(L"HiDPI", info["HIDPI"].asBoolean() ? L"Enabled" : L"Disabled"); + bugSplatMap.setAttribute("HiDPI", info["HIDPI"].asBoolean() ? "Enabled" : "Disabled"); #endif } // These attributes are potentially dynamic - bugSplatMap.setAttribute(L"Packets Lost", llformat("%.0f/%.0f (%.1f%%)", info["PACKETS_LOST"].asReal(), info["PACKETS_IN"].asReal(), info["PACKETS_PCT"].asReal())); - bugSplatMap.setAttribute(L"Window Size", llformat("%sx%s px", info["WINDOW_WIDTH"].asString().c_str(), info["WINDOW_HEIGHT"].asString().c_str())); - bugSplatMap.setAttribute(L"Draw Distance (m)", info["DRAW_DISTANCE"].asInteger()); - bugSplatMap.setAttribute(L"Bandwidth (kbit/s)", info["BANDWIDTH"].asInteger()); - bugSplatMap.setAttribute(L"LOD Factor", info["LOD"].asReal()); - bugSplatMap.setAttribute(L"Render quality", info["RENDERQUALITY_FSDATA_ENGLISH"].asString()); - bugSplatMap.setAttribute(L"Disk Cache", info["DISK_CACHE_INFO"].asString()); + bugSplatMap.setAttribute("Packets Lost", llformat("%.0f/%.0f (%.1f%%)", info["PACKETS_LOST"].asReal(), info["PACKETS_IN"].asReal(), info["PACKETS_PCT"].asReal())); + bugSplatMap.setAttribute("Window Size", llformat("%sx%s px", info["WINDOW_WIDTH"].asString().c_str(), info["WINDOW_HEIGHT"].asString().c_str())); + bugSplatMap.setAttribute("Draw Distance (m)", info["DRAW_DISTANCE"].asInteger()); + bugSplatMap.setAttribute("Bandwidth (kbit/s)", info["BANDWIDTH"].asInteger()); + bugSplatMap.setAttribute("LOD Factor", info["LOD"].asReal()); + bugSplatMap.setAttribute("Render quality", info["RENDERQUALITY_FSDATA_ENGLISH"].asString()); + bugSplatMap.setAttribute("Disk Cache", info["DISK_CACHE_INFO"].asString()); - bugSplatMap.setAttribute(L"GridName", gDebugInfo["GridName"].asString()); - bugSplatMap.setAttribute(L"Available RAM (KB)", LLMemory::getAvailableMemKB().value()); - bugSplatMap.setAttribute(L"Allocated RAM (KB)", LLMemory::getAllocatedMemKB().value()); + bugSplatMap.setAttribute("GridName", gDebugInfo["GridName"].asString()); + bugSplatMap.setAttribute("Available RAM (KB)", LLMemory::getAvailableMemKB().value()); + bugSplatMap.setAttribute("Allocated RAM (KB)", LLMemory::getAllocatedMemKB().value()); if (bugSplatMap.writeToFile(BugSplatAttributes::getCrashContextFileName())) { From 4e581f0b0b196a56a16b2f13b498c5716170e99c Mon Sep 17 00:00:00 2001 From: Beq Date: Thu, 19 Dec 2024 16:47:29 +0000 Subject: [PATCH 08/44] remove deprecated bugsplat attribute handling. --- indra/newview/llappviewerwin32.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 30c9cfb183..8db9a391a8 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -196,14 +196,14 @@ namespace } // LL_ERRS message, when there is one - sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); - sBugSplatSender->setAttribute(WCSTR(L"OS"), WCSTR(LLOSInfo::instance().getOSStringSimple())); // In case we ever stop using email for this - sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString())); - sBugSplatSender->setAttribute(WCSTR(L"GL Vendor"), WCSTR(gGLManager.mGLVendor)); - sBugSplatSender->setAttribute(WCSTR(L"GL Version"), WCSTR(gGLManager.mGLVersionString)); - sBugSplatSender->setAttribute(WCSTR(L"GPU Version"), WCSTR(gGLManager.mDriverVersionVendorString)); - sBugSplatSender->setAttribute(WCSTR(L"GL Renderer"), WCSTR(gGLManager.mGLRenderer)); - sBugSplatSender->setAttribute(WCSTR(L"VRAM"), WCSTR(STRINGIZE(gGLManager.mVRAM))); + // sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); + // sBugSplatSender->setAttribute(WCSTR(L"OS"), WCSTR(LLOSInfo::instance().getOSStringSimple())); // In case we ever stop using email for this + // sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString())); + // sBugSplatSender->setAttribute(WCSTR(L"GL Vendor"), WCSTR(gGLManager.mGLVendor)); + // sBugSplatSender->setAttribute(WCSTR(L"GL Version"), WCSTR(gGLManager.mGLVersionString)); + // sBugSplatSender->setAttribute(WCSTR(L"GPU Version"), WCSTR(gGLManager.mDriverVersionVendorString)); + // sBugSplatSender->setAttribute(WCSTR(L"GL Renderer"), WCSTR(gGLManager.mGLRenderer)); + // sBugSplatSender->setAttribute(WCSTR(L"VRAM"), WCSTR(STRINGIZE(gGLManager.mVRAM))); // sBugSplatSender->setAttribute(WCSTR(L"RAM"), WCSTR(STRINGIZE(gSysMemory.getPhysicalMemoryKB().value()))); // Improve bugsplpat reporting with attributes // sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); From 36e454787bb2a8286a7e853a4fd12b05ae89f040 Mon Sep 17 00:00:00 2001 From: Beq Date: Thu, 19 Dec 2024 18:17:28 +0000 Subject: [PATCH 09/44] Fixup the FS tagging here. --- indra/newview/llappviewerwin32.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 8db9a391a8..525a4ce872 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -196,7 +196,8 @@ namespace } // LL_ERRS message, when there is one - // sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); + // Improve bugsplpat reporting with attributes + // sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); // sBugSplatSender->setAttribute(WCSTR(L"OS"), WCSTR(LLOSInfo::instance().getOSStringSimple())); // In case we ever stop using email for this // sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString())); // sBugSplatSender->setAttribute(WCSTR(L"GL Vendor"), WCSTR(gGLManager.mGLVendor)); @@ -205,9 +206,6 @@ namespace // sBugSplatSender->setAttribute(WCSTR(L"GL Renderer"), WCSTR(gGLManager.mGLRenderer)); // sBugSplatSender->setAttribute(WCSTR(L"VRAM"), WCSTR(STRINGIZE(gGLManager.mVRAM))); // sBugSplatSender->setAttribute(WCSTR(L"RAM"), WCSTR(STRINGIZE(gSysMemory.getPhysicalMemoryKB().value()))); - // Improve bugsplpat reporting with attributes - // sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); - // sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString())); auto fatal_message = LLError::getFatalMessage(); sBugSplatSender->setDefaultUserDescription(WCSTR(fatal_message)); From 1dd8860d82fb86ed6d5e7b96fab546dfecc059de Mon Sep 17 00:00:00 2001 From: Beq Date: Thu, 19 Dec 2024 19:00:57 +0000 Subject: [PATCH 10/44] just use llofstream for now and clean up a few missed wides. --- indra/newview/bugsplatattributes.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/bugsplatattributes.cpp b/indra/newview/bugsplatattributes.cpp index f2004be34a..0bdf739e67 100644 --- a/indra/newview/bugsplatattributes.cpp +++ b/indra/newview/bugsplatattributes.cpp @@ -1,5 +1,5 @@ +#include "linden_common.h" #include "bugsplatattributes.h" -#include #include std::string BugSplatAttributes::mCrashContextFileName; @@ -17,8 +17,8 @@ BugSplatAttributes& BugSplatAttributes::instance() std::string BugSplatAttributes::to_xml_token(const std::string& input) { // Example usage: - // std::wstring token = to_xml_token(L"Bandwidth (kbit/s)"); - // The result should be: L"Bandwidth_kbit_per_s" + // std::string token = to_xml_token("Bandwidth (kbit/s)"); + // The result should be: "Bandwidth_kbit_per_s" std::string result; result.reserve(input.size() * 2); // Reserve some space, since we might insert more chars for "/" @@ -69,14 +69,14 @@ bool BugSplatAttributes::writeToFile(const std::string& file_path) // Write to a temporary file first std::string tmp_file = file_path + ".tmp"; { - std::ofstream ofs(tmp_file, std::ios::out | std::ios::trunc); + llofstream ofs(tmp_file, std::ios::out | std::ios::trunc); if (!ofs.good()) { return false; } - ofs << L"\n"; - ofs << L"\n"; + ofs << "\n"; + ofs << "\n"; // First, write out attributes that have an empty category (top-level) auto empty_category_it = mAttributes.find(""); From 11a501f33f0d6d196579475163592f95d2625baa Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Thu, 19 Dec 2024 21:05:11 +0100 Subject: [PATCH 11/44] Updated Polish translation --- .../xui/pl/floater_gltf_asset_editor.xml | 8 ++-- .../floater_preferences_graphics_advanced.xml | 15 +++++++ .../default/xui/pl/floater_settings_debug.xml | 4 ++ .../skins/default/xui/pl/floater_tools.xml | 1 + .../skins/default/xui/pl/menu_viewer.xml | 1 + .../skins/default/xui/pl/notifications.xml | 1 + .../xui/pl/panel_preferences_graphics1.xml | 43 ++++++++++++++++--- 7 files changed, 63 insertions(+), 10 deletions(-) diff --git a/indra/newview/skins/default/xui/pl/floater_gltf_asset_editor.xml b/indra/newview/skins/default/xui/pl/floater_gltf_asset_editor.xml index 28f4d0b52a..344d01c573 100644 --- a/indra/newview/skins/default/xui/pl/floater_gltf_asset_editor.xml +++ b/indra/newview/skins/default/xui/pl/floater_gltf_asset_editor.xml @@ -1,10 +1,10 @@ - - - - + + + + diff --git a/indra/newview/skins/default/xui/pl/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/pl/floater_preferences_graphics_advanced.xml index d6db077330..6ccd6f520c 100644 --- a/indra/newview/skins/default/xui/pl/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/pl/floater_preferences_graphics_advanced.xml @@ -44,6 +44,15 @@ + + Jakość antyaliasingu: + + + + + + + Mesz @@ -76,6 +85,7 @@ + Cienie: @@ -115,6 +125,11 @@ + + + Tone mapping: + +