Ansariel 2022-06-28 08:57:07 +02:00
commit de2679705a
9 changed files with 127 additions and 37 deletions

View File

@ -81,6 +81,13 @@ const F32 MIN_DISTANCE_MOVED = 1.0f;
// timeout to resend object properties request again
const F32 REQUEST_TIMEOUT = 30.0f;
std::string RLVa_hideNameIfRestricted(std::string const &name)
{
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
return name;
else
return RlvStrings::getAnonym(name);
}
F32 calculateObjectDistance(LLVector3d agent_pos, LLViewerObject* object)
{
@ -907,10 +914,13 @@ void FSAreaSearch::matchObject(FSObjectProperties& details, LLViewerObject* obje
std::string object_description = details.description;
details.name_requested = false;
getNameFromUUID(details.ownership_id, true, owner_name, details.group_owned, details.name_requested);
getNameFromUUID(details.creator_id, false, creator_name, false, details.name_requested);
getNameFromUUID(details.last_owner_id, false, last_owner_name, false, details.name_requested);
getNameFromUUID(details.group_id, false, group_name, true, details.name_requested);
getNameFromUUID(details.ownership_id, owner_name, details.group_owned, details.name_requested);
getNameFromUUID(details.creator_id, creator_name, false, details.name_requested);
getNameFromUUID(details.last_owner_id, last_owner_name, false, details.name_requested);
getNameFromUUID(details.group_id, group_name, true, details.name_requested);
owner_name = RLVa_hideNameIfRestricted(owner_name);
last_owner_name = RLVa_hideNameIfRestricted(last_owner_name);
if (mRegexSearch)
{
@ -1042,7 +1052,7 @@ void FSAreaSearch::matchObject(FSObjectProperties& details, LLViewerObject* obje
cell_params.column = "owner";
cell_params.value = owner_name;
row_params.columns.add(cell_params);
row_params.columns.add(cell_params);
cell_params.column = "group";
cell_params.value = group_name;
@ -1105,7 +1115,7 @@ void FSAreaSearch::updateObjectCosts(const LLUUID& object_id, F32 object_cost, F
}
}
void FSAreaSearch::getNameFromUUID(const LLUUID& id, bool needs_rlva_check, std::string& name, bool group, bool& name_requested)
void FSAreaSearch::getNameFromUUID(const LLUUID& id, std::string& name, bool group, bool& name_requested)
{
static const std::string unknown_name = LLTrans::getString("AvatarNameWaiting");
@ -1127,46 +1137,28 @@ void FSAreaSearch::getNameFromUUID(const LLUUID& id, bool needs_rlva_check, std:
else
{
LLAvatarName av_name;
if (LLAvatarNameCache::get(id, &av_name))
{
if (!needs_rlva_check || !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
name = av_name.getCompleteName();
}
else
{
name = RlvStrings::getAnonym(av_name);
}
}
else
if (!LLAvatarNameCache::get(id, &av_name))
{
name = unknown_name;
if (std::find(mNamesRequested.begin(), mNamesRequested.end(), id) == mNamesRequested.end())
{
mNamesRequested.push_back(id);
boost::signals2::connection cb_connection = LLAvatarNameCache::get(id, boost::bind(&FSAreaSearch::avatarNameCacheCallback, this, _1, _2, needs_rlva_check));
boost::signals2::connection cb_connection = LLAvatarNameCache::get(id, boost::bind(&FSAreaSearch::avatarNameCacheCallback, this, _1, _2));
mNameCacheConnections.insert(std::make_pair(id, cb_connection)); // mNamesRequested will do the dupe check
}
name_requested = true;
}
else
name = av_name.getCompleteName();
}
}
void FSAreaSearch::avatarNameCacheCallback(const LLUUID& id, const LLAvatarName& av_name, bool needs_rlva_check)
void FSAreaSearch::avatarNameCacheCallback(const LLUUID& id, const LLAvatarName& av_name)
{
std::string name;
if (!needs_rlva_check || !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
name = av_name.getCompleteName();
}
else
{
name = RlvStrings::getAnonym(av_name);
}
callbackLoadFullName(id, name);
callbackLoadFullName(id, av_name.getCompleteName());
}
void FSAreaSearch::callbackLoadFullName(const LLUUID& id, const std::string& full_name)
void FSAreaSearch::callbackLoadFullName(const LLUUID& id, const std::string& full_name )
{
auto iter = mNameCacheConnections.find(id);
if (iter != mNameCacheConnections.end())
@ -1193,7 +1185,7 @@ void FSAreaSearch::callbackLoadFullName(const LLUUID& id, const std::string& ful
}
}
mPanelList->updateName(id, full_name);
mPanelList->updateName(id, full_name);
}
void FSAreaSearch::updateCounterText()
@ -1613,7 +1605,7 @@ void FSPanelAreaSearchList::updateName(const LLUUID& id, const std::string& name
if (owner_column && (id == details.owner_id))
{
LLScrollListText* owner_text = (LLScrollListText*)item->getColumn(owner_column->mIndex);
owner_text->setText(name);
owner_text->setText(RLVa_hideNameIfRestricted(name));
mResultList->setNeedsSort();
}
@ -1627,7 +1619,7 @@ void FSPanelAreaSearchList::updateName(const LLUUID& id, const std::string& name
if (last_owner_column && (id == details.last_owner_id))
{
LLScrollListText* last_owner_text = (LLScrollListText*)item->getColumn(last_owner_column->mIndex);
last_owner_text->setText(name);
last_owner_text->setText(RLVa_hideNameIfRestricted(name));
mResultList->setNeedsSort();
}
}

View File

@ -114,7 +114,7 @@ public:
virtual void draw();
virtual void onOpen(const LLSD& key);
void avatarNameCacheCallback(const LLUUID& id, const LLAvatarName& av_name, bool needs_rlva_check);
void avatarNameCacheCallback(const LLUUID& id, const LLAvatarName& av_name);
void callbackLoadFullName(const LLUUID& id, const std::string& full_name);
void processObjectProperties(LLMessageSystem* msg);
void updateObjectCosts(const LLUUID& object_id, F32 object_cost, F32 link_cost, F32 physics_cost, F32 link_physics_cost);
@ -172,7 +172,7 @@ public:
private:
void requestObjectProperties(const std::vector< U32 >& request_list, bool select, LLViewerRegion* regionp);
void matchObject(FSObjectProperties& details, LLViewerObject* objectp);
void getNameFromUUID(const LLUUID& id, bool needs_rvla_check, std::string& name, bool group, bool& name_requested);
void getNameFromUUID(const LLUUID& id, std::string& name, bool group, bool& name_requested);
void updateCounterText();
bool regexTest(std::string text);

View File

@ -1540,6 +1540,22 @@ void FSLSLPreprocessor::start_process()
}
}
}
else
{
// FIRE-31718: Preprocessor crashes viewer on recursive #include
// Truncate the resulting preprocessed script to something the text field can handle without
// freezing for so long the viewer disconnects. The usual script source code limit is 64kB so
// let's play it safe and allow twice as much here. The script is most likely already unusable
// at this point due to the preprocessor bailing out with an error earlier, so a truncated
// version doesn't hurt more than it already did.
if (output.size() > 128 * 1024)
{
output.resize(128 * 1024);
display_error(LLTrans::getString("fs_preprocessor_truncated"));
}
}
if (!errored)
{
if (preprocessor_enabled && use_compression)

View File

@ -12097,7 +12097,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
// place in the code. For now, this is a good spot as the complexity calculation
// gets updated when rigging data arrives, so we can reliably identify rigged
// attachments where the skinning information took a while to load.
if (attached_object->isHUDAttachment() && attached_object->mCheckRigOnHUD)
if (attached_object->isHUDAttachment() && attached_object->mCheckRigOnHUD && !attached_object->isTempAttachment())
{
// check if the root object is rigged
bool is_rigged = attached_object->isRiggedMesh();

View File

@ -7038,6 +7038,9 @@ Ihre aktuelle Position: [AVATAR_POS]
<string name="fs_preprocessor_caching_err">
Fehler beim Cachen der eingebundenen Datei „[FILENAME]“.
</string>
<string name="fs_preprocessor_truncated">
Achtung: Präprozessor-Ausgabe wurde aufgrund exzessiver Textlänge gekürzt. Das Skript wird wahrscheinlich nicht funktionieren.
</string>
<string name="animation_explorer_seconds_ago">
Vor [SECONDS] Sekunden

View File

@ -3153,6 +3153,7 @@ Your current position: [AVATAR_POS]
<string name="fs_preprocessor_cache_completed">Caching completed for '[FILENAME]'</string>
<string name="fs_preprocessor_cache_unsafe">Error: script named '[FILENAME]' isn't safe to copy to the filesystem. This include will fail.</string>
<string name="fs_preprocessor_caching_err">Error caching included file '[FILENAME]'</string>
<string name="fs_preprocessor_truncated">Warning: Preprocessor output truncated due to excessive script text size. This script will most likely not work.</string>
<!-- </FS:Cron> -->
<!-- Animation Explorer -->

View File

@ -6824,6 +6824,78 @@ Votre position actuelle : [AVATAR_POS]
<string name="fs_preprocessor_mono_directive_override">
Détection de la directive compile-as-Mono outrepassant les préférences.
</string>
<!-- LSL Optimizer -->
<string name="fs_preprocessor_optimizer_start">
Optimisation des fonctions définies par l'utilisateur et des variables globales non référencées.
</string>
<string name="fs_preprocessor_optimizer_regex_err">
Expression régulière non valide : '[WHAT]' ; optimisation LSL ignorée.
</string>
<string name="fs_preprocessor_optimizer_exception">
Exception détectée : '[WHAT]' ; optimisation LSL sautée.
</string>
<string name="fs_preprocessor_optimizer_unexpected_exception">
Exception inattendue dans l'optimiseur LSL ; non appliquée.
</string>
<!-- LSL Compressor -->
<string name="fs_preprocessor_compress_start">
Compression du texte du script en supprimant les espaces inutiles.
</string>
<string name="fs_preprocessor_compress_regex_err">
Expression régulière non valide : '[WHAT]' ; la compression LSL est ignorée.
</string>
<string name="fs_preprocessor_compress_exception">
Exception interceptée : '[WHAT]' ; la compression LSL est ignorée.
</string>
<string name="fs_preprocessor_compress_unexpected_exception">
Exception inattendue dans le compresseur LSL ; non appliquée.
</string>
<!-- LSL Lazy lists -->
<string name="fs_preprocessor_lazylist_start">
Appliquer la conversion de liste paresseuse.
</string>
<string name="fs_preprocessor_lazylist_regex_err">
Pas une expression régulière valide : '[WHAT]' ; Le convertisseur de liste paresseux a été ignoré.
</string>
<string name="fs_preprocessor_lazylist_exception">
Exception interceptée : '[WHAT]' ; le convertisseur de liste paresseux a été ignoré.
</string>
<string name="fs_preprocessor_lazylist_unexpected_exception">
Exception inattendue dans le convertisseur de liste paresseux ; non appliquée.
</string>
<!-- LSL switch statement -->
<string name="fs_preprocessor_switchstatement_start">
Application de la conversion des instructions de commutation.
</string>
<string name="fs_preprocessor_switchstatement_regex_err">
Expression régulière non valide : '[WHAT]' ; Le convertisseur d'instruction de commutation a été ignoré.
</string>
<string name="fs_preprocessor_switchstatement_exception">
Exception interceptée : '[WHAT]' ; Le convertisseur d'instruction de commutation a été ignoré.
</string>
<string name="fs_preprocessor_switchstatement_unexpected_exception">
Exception inattendue dans le convertisseur d'instruction de commutation ; non appliquée.
</string>
<!-- LSL Cache -->
<string name="fs_preprocessor_cache_miss">
Mise en cache du fichier inclus : '[FILENAME]'.
</string>
<string name="fs_preprocessor_cache_invalidated">
Le fichier inclus '[FILENAME]' a changé, remise en cache.
</string>
<string name="fs_preprocessor_cache_completed">
La mise en cache est terminée pour '[FILENAME]'.
</string>
<string name="fs_preprocessor_cache_unsafe">
Erreur : le script nommé '[FILENAME]' n'est pas fiable pour être copié dans le système de fichiers. Cet include échouera.
</string>
<string name="fs_preprocessor_caching_err">
Erreur de mise en cache du fichier inclus '[FILENAME]'.
</string>
<string name="fs_preprocessor_truncated">
Avertissement : La sortie du préprocesseur a été tronquée en raison de la taille excessive du texte du script. Ce script ne fonctionnera probablement pas.
</string>
<!-- </FS:Cron> -->
<!-- Animation Explorer -->
<string name="animation_explorer_seconds_ago">

View File

@ -6329,6 +6329,9 @@ Twoja aktualna pozycja: [AVATAR_POS]
<string name="fs_preprocessor_caching_err">
Błąd podczas buforowania pliku '[FILENAME]'
</string>
<string name="fs_preprocessor_truncated">
Uwaga: Dane wyjściowe preprocesora zostały skrócone z powodu zbyt dużego rozmiaru tekstu skryptu - prawdopodobnie nie zadziała.
</string>
<string name="animation_explorer_seconds_ago">
[SECONDS] sekund temu
</string>

View File

@ -6626,6 +6626,9 @@ ID объекта: [INSPECTING_KEY]
<string name="fs_preprocessor_caching_err">
Ошибка кэширования подключенного файла '[FILENAME]'
</string>
<string name="fs_preprocessor_truncated">
Предупреждение: Выходные данные препроцессора усечены из-за чрезмерного размера текста скрипта. Этот скрипт, скорее всего, не будет работать.
</string>
<string name="animation_explorer_seconds_ago">
[SECONDS] секунд назад
</string>