From 55121d55012de5303a209402df4b26a81afe6387 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Thu, 10 Jun 2010 17:47:36 +0200 Subject: feature: have clothing layer protection on and don't broadcast client name --- linden/indra/llprimitive/llprimitive.cpp | 9 ++++++--- linden/indra/llprimitive/llprimitive.h | 2 +- linden/indra/newview/app_settings/settings.xml | 16 ++++++++++++++-- linden/indra/newview/llagent.cpp | 12 ++++++++---- linden/indra/newview/llprefsadvanced.cpp | 14 +++++++++++--- 5 files changed, 40 insertions(+), 13 deletions(-) (limited to 'linden') diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp index c67c7d9..f1b7522 100644 --- a/linden/indra/llprimitive/llprimitive.cpp +++ b/linden/indra/llprimitive/llprimitive.cpp @@ -1134,7 +1134,7 @@ S32 LLPrimitive::unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 dat // Pack information about all texture entries into container: // { TextureEntry Variable 2 } // Includes information about image ID, color, scale S,T, offset S,T and rotation -BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, bool shield) const +BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, int shield) const { const U32 MAX_TES = 32; @@ -1154,7 +1154,10 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, bool shield) const U8 *cur_ptr = packed_buffer; S32 last_face_index = getNumTEs() - 1; - + + LLUUID client_tag = LLUUID("cc7a030f-282f-c165-44d2-b5ee572e72bf");//Imprudence + if (shield == 2)client_tag = LLUUID("c228d1cf-4b5d-4ba8-84f4-899a0796aa97");//IMG_DEFAULT_AVATAR + if (last_face_index > -1) { // ...if we hit the front, send one image id @@ -1171,7 +1174,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, bool shield) const if(face_index == 6)f_f_i = 10; if(face_index == 3)f_f_i = 11; if(f_f_i == face_index)memcpy(&image_ids[face_index*16],LLUUID("c228d1cf-4b5d-4ba8-84f4-899a0796aa97").mData,16); - else if(f_f_i == 64)memcpy(&image_ids[face_index*16],LLUUID("cc7a030f-282f-c165-44d2-b5ee572e72bf").mData,16); + else if(f_f_i == 64)memcpy(&image_ids[face_index*16],client_tag.mData,16); else memcpy(&image_ids[face_index*16],LLUUID("4934f1bf-3b1f-cf4f-dbdf-a72550d05bc6").mData,16);//grey block }else memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); /* Flawfinder: ignore */ diff --git a/linden/indra/llprimitive/llprimitive.h b/linden/indra/llprimitive/llprimitive.h index 27484e5..efabb82 100644 --- a/linden/indra/llprimitive/llprimitive.h +++ b/linden/indra/llprimitive/llprimitive.h @@ -338,7 +338,7 @@ public: void copyTEs(const LLPrimitive *primitive); S32 packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_face_index, EMsgVariableType type) const; S32 unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 data_size, U8 face_count, EMsgVariableType type); - BOOL packTEMessage(LLMessageSystem *mesgsys, bool shield = false) const; + BOOL packTEMessage(LLMessageSystem *mesgsys, int shield = 0) const; BOOL packTEMessage(LLDataPacker &dp) const; S32 unpackTEMessage(LLMessageSystem *mesgsys, char *block_name); S32 unpackTEMessage(LLMessageSystem *mesgsys, char *block_name, const S32 block_num); // Variable num of blocks diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 8a48016..c1ed2b4 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -922,7 +922,7 @@ ShowClientNameTag Comment - Show others clients in name tag + Show *others* clients in the name tag Persist 1 Type @@ -930,7 +930,19 @@ Value 1 - + + ShowMyClientTagToOthers + + Comment + Show my client name to other viewers capable seeing it (e.g. Emerald, Imprudence, Meerkat) + Persist + 1 + Type + Boolean + Value + 1 + + DownloadClientTags Comment diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index e2be0d0..e8ee2a1 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -7404,10 +7404,14 @@ void LLAgent::sendAgentSetAppearance() msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); } msg->nextBlockFast(_PREHASH_ObjectData); - mAvatarObject->packTEMessage ( - gMessageSystem, - gSavedSettings.getBOOL("ClothingLayerProtection") - ); + + int shield = 0; + if(gSavedSettings.getBOOL("ClothingLayerProtection")) + { + if(gSavedSettings.getBOOL("ShowMyClientTagToOthers")) shield = 1; + else shield = 2; + } + mAvatarObject->packTEMessage ( gMessageSystem, shield ); } else { diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index 22dcbf1..6fb8998 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp @@ -57,7 +57,7 @@ BOOL LLPrefsAdvanced::postBuild() childSetValue("disable_tp_screen_check", gSavedSettings.getBOOL("DisableTeleportScreens")); childSetValue("client_name_tag_check", gSavedSettings.getBOOL("ShowClientNameTag")); childSetValue("windlight_check", gSavedSettings.getBOOL("UseServersideWindlightSettings")); - childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ClothingLayerProtection")); + childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ShowMyClientTagToOthers")); childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP")); childSetValue("speed_rez_check", gSavedSettings.getBOOL("SpeedRez")); childSetValue("speed_rez_interval_spinner", (F32)gSavedSettings.getU32("SpeedRezInterval")); @@ -81,8 +81,16 @@ void LLPrefsAdvanced::apply() gSavedSettings.setBOOL("UseServersideWindlightSettings", childGetValue("windlight_check")); // Need to force a rebake when ClothingLayerProtection toggled for it take effect -- MC - if (gSavedSettings.getBOOL("ClothingLayerProtection") != (BOOL)childGetValue("client_name_tag_broadcast_check")) + if (gSavedSettings.getBOOL("ShowMyClientTagToOthers") != (BOOL)childGetValue("client_name_tag_broadcast_check")) { + if(gSavedSettings.getBOOL("ShowMyClientTagToOthers")) + { + //ShowMyClientTagToOthers works only with ClothingLayerProtection true, + //while not showing also works with ClothingLayerProtection false. + //since ClothingLayerProtection true is preferrable only switch ON + gSavedSettings.setBOOL("ClothingLayerProtection", TRUE); + } + LLVOAvatar* avatar = gAgent.getAvatarObject(); if (avatar) { @@ -91,7 +99,7 @@ void LLPrefsAdvanced::apply() avatar->forceBakeAllTextures(slam_for_debug); } } - gSavedSettings.setBOOL("ClothingLayerProtection", childGetValue("client_name_tag_broadcast_check")); + gSavedSettings.setBOOL("ShowMyClientTagToOthers", childGetValue("client_name_tag_broadcast_check")); // This is bad bad BAD UI from Emerald, I know. // If anyone wants to do this better, please do -- MC -- cgit v1.1