From 3a84d8017df08447b14161cee3c24382f8f96013 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 27 Nov 2009 14:04:22 +0100 Subject: don't let the voice client spam about ParcelVoiceInfoRequest capability (SNOW-66 fix by me + SNOW-250 fix by Pixel Gausman and Aleric Inglewood ) modified: linden/indra/newview/llvoiceclient.cpp --- linden/indra/newview/llvoiceclient.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp index 94407ed..7a41510 100644 --- a/linden/indra/newview/llvoiceclient.cpp +++ b/linden/indra/newview/llvoiceclient.cpp @@ -1560,6 +1560,7 @@ void LLVoiceClient::stateMachine() } // Check for parcel boundary crossing + if(mVoiceEnabled) { LLViewerRegion *region = gAgent.getRegion(); LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); @@ -1590,7 +1591,19 @@ void LLVoiceClient::stateMachine() } else { - LL_WARNS("Voice") << "region doesn't have ParcelVoiceInfoRequest capability. This is normal for a short time after teleporting, but bad if it persists for very long." << LL_ENDL; + static int count = 0; + static int count2 = 0; + static int num = 1; + ++count; + if (count % num == 0) + { + LL_DEBUGS("Voice") << "region doesn't have ParcelVoiceInfoRequest capability. This is normal for a short time after teleporting, but bad if it persists for very long (" << count << ")." << LL_ENDL; + if (num < 1000 && ++count2 == 10) + { + num *= 10; + count2 = 0; + } + } } } } -- cgit v1.1 From f708b9c456c93748f4d644b73444105fca74f8ca Mon Sep 17 00:00:00 2001 From: Patrick Sapinski Date: Sat, 28 Nov 2009 15:42:23 -0500 Subject: commented out some cmake code that completely breaks distributed builds on Windows, doesn't affect other builds, seems to do nothing, and was commented out on MK years ago :) Signed-off-by: Jacek Antonelli --- linden/indra/newview/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 8d19bab..197857b 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -958,13 +958,13 @@ if (WINDOWS) PROPERTIES COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h" ) - foreach( src_file ${viewer_SOURCE_FILES} ) - set_source_files_properties( - ${src_file} - PROPERTIES - COMPILE_FLAGS "/Yullviewerprecompiledheaders.h" - ) - endforeach( src_file ${viewer_SOURCE_FILES} ) + #foreach( src_file ${viewer_SOURCE_FILES} ) + # set_source_files_properties( + # ${src_file} + # PROPERTIES + # COMPILE_FLAGS "/Yullviewerprecompiledheaders.h" + # ) + #endforeach( src_file ${viewer_SOURCE_FILES} ) list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp) # Add resource files to the project. -- cgit v1.1 From beb95e449d384e5674823b5e4d785bb6dc2b1737 Mon Sep 17 00:00:00 2001 From: Patrick Sapinski Date: Sat, 28 Nov 2009 15:46:25 -0500 Subject: dynamically linked libpng for windows added to install.xml (from snowglobe) which is required to build 1.23 and up. Signed-off-by: Jacek Antonelli --- linden/install.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linden/install.xml b/linden/install.xml index e157b18..4f13d84 100644 --- a/linden/install.xml +++ b/linden/install.xml @@ -788,9 +788,9 @@ Portions copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura windows md5sum - 200bdf3c5a5489210fcee965f639a3f9 + c781cd9846cf20afb90ac40ad1a0ce9d url - http://imprudenceviewer.org/download/libs/libpng-1.2.34-1-windows-04172009.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.2.35-windows-20090917.tar.bz2 -- cgit v1.1 From 686b994f11a5e7ec2c11e40dc3ca8178c47decdf Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 29 Nov 2009 00:14:02 -0600 Subject: Fixed a little mistake in .gitignore. --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 95f943d..a1c13cc 100644 --- a/.gitignore +++ b/.gitignore @@ -37,8 +37,8 @@ linden/indra/newview/mozilla-theme/ # COMPILED STUFF -linden/indra/viewer-* # Linux build directories -linden/indra/build-* # Mac and Windows build directories +linden/indra/viewer-* +linden/indra/build-* linden/installed.xml *.pyc -- cgit v1.1 From 738192c930d8857d11ccbebaf62bffb7c48a8e2e Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Mon, 30 Nov 2009 23:38:38 +0100 Subject: Emeralds client name tag and clothing layer protection. Needs decision about a few things - find "Imprudence FIXME" (woq) in llprimitive.cpp and llvoavatar.cpp, its commented there. modified: linden/indra/llprimitive/llprimitive.cpp modified: linden/indra/llprimitive/llprimitive.h modified: linden/indra/newview/app_settings/settings.xml modified: linden/indra/newview/llagent.cpp modified: linden/indra/newview/llappviewer.cpp modified: linden/indra/newview/llfirstuse.cpp modified: linden/indra/newview/llfirstuse.h modified: linden/indra/newview/llstartup.cpp modified: linden/indra/newview/llvoavatar.cpp modified: linden/indra/newview/llvoavatar.h modified: linden/indra/newview/skins/default/xui/en-us/notifications.xml --- linden/indra/llprimitive/llprimitive.cpp | 219 ++++++++++++++++- linden/indra/llprimitive/llprimitive.h | 2 +- linden/indra/newview/app_settings/settings.xml | 50 ++++ linden/indra/newview/llagent.cpp | 5 +- linden/indra/newview/llappviewer.cpp | 9 + linden/indra/newview/llfirstuse.cpp | 34 +++ linden/indra/newview/llfirstuse.h | 2 + linden/indra/newview/llstartup.cpp | 2 + linden/indra/newview/llvoavatar.cpp | 262 ++++++++++++++++++++- linden/indra/newview/llvoavatar.h | 11 +- .../skins/default/xui/en-us/notifications.xml | 18 ++ 11 files changed, 602 insertions(+), 12 deletions(-) diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp index 6fc0a55..c2d1d1e 100644 --- a/linden/indra/llprimitive/llprimitive.cpp +++ b/linden/indra/llprimitive/llprimitive.cpp @@ -958,16 +958,213 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai U32 old_face_mask = mVolumep->mFaceMask; + S32 face_bit = 0; + S32 cur_mask = 0; + + // grab copies of the old faces so we can determine the TE mappings... + std::vector old_faces; // list of old faces for remapping texture entries + LLTextureEntry old_tes[9]; + + for (S32 face = 0; face < mVolumep->getNumFaces(); face++) + { + old_faces.push_back(mVolumep->getProfile().mFaces[face]); + } + + for (face_bit = 0; face_bit < 9; face_bit++) + { + cur_mask = 0x1 << face_bit; + if (old_face_mask & cur_mask) + { + S32 te_index = face_index_from_id(cur_mask, old_faces); + old_tes[face_bit] = *getTE(te_index); + //llinfos << face_bit << ":" << te_index << ":" << old_tes[face_bit].getID() << llendl; + } + } + + // build the new object sVolumeManager->unrefVolume(mVolumep); mVolumep = volumep; - U32 new_face_mask = mVolumep->mFaceMask; - if (old_face_mask != new_face_mask) + U32 new_face_mask = mVolumep->mFaceMask; + S32 i; + + /* + std::string old_mask_string; + for (i = 0; i < 9; i++) + { + if (old_face_mask & (1 << i)) + { + old_mask_string.append("1"); + } + else + { + old_mask_string.append("0"); + } + } + std::string new_mask_string; + for (i = 0; i < 9; i++) + { + if (new_face_mask & (1 << i)) + { + new_mask_string.append("1"); + } + else + { + new_mask_string.append("0"); + } + } + + llinfos << "old mask: " << old_mask_string << llendl; + llinfos << "new mask: " << new_mask_string << llendl; + */ + + + if (old_face_mask == new_face_mask) { + // nothing to do + return TRUE; + } + + if (mVolumep->getNumFaces() == 0 && new_face_mask != 0) + { + llwarns << "Object with 0 faces found...INCORRECT!" << llendl; setNumTEs(mVolumep->getNumFaces()); - } - + return TRUE; + } + + + S32 face_mapping[9]; + for (face_bit = 0; face_bit < 9; face_bit++) + { + face_mapping[face_bit] = face_bit; + } + + // Generate the face-type mappings + for (face_bit = 0; face_bit < 9; face_bit++) + { + cur_mask = 0x1 << face_bit; + if (!(new_face_mask & cur_mask)) + { + // Face doesn't exist in new map. + face_mapping[face_bit] = -1; + continue; + } + else if (old_face_mask & cur_mask) + { + // Face exists in new and old map. + face_mapping[face_bit] = face_bit; + continue; + } + + // OK, how we've got a mismatch, where we have to fill a new face with one from + // the old face. + if (cur_mask & (LL_FACE_PATH_BEGIN | LL_FACE_PATH_END | LL_FACE_INNER_SIDE)) + { + // It's a top/bottom/hollow interior face. + if (old_face_mask & LL_FACE_PATH_END) + { + face_mapping[face_bit] = 1; + continue; + } + else + { + S32 cur_outer_mask = LL_FACE_OUTER_SIDE_0; + for (i = 0; i < 4; i++) + { + if (old_face_mask & cur_outer_mask) + { + face_mapping[face_bit] = 5 + i; + break; + } + cur_outer_mask <<= 1; + } + if (i == 4) + { + llwarns << "No path end or outer face in volume!" << llendl; + } + continue; + } + } + + if (cur_mask & (LL_FACE_PROFILE_BEGIN | LL_FACE_PROFILE_END)) + { + // A cut slice. Use the hollow interior if we have it. + if (old_face_mask & LL_FACE_INNER_SIDE) + { + face_mapping[face_bit] = 2; + continue; + } + + // No interior, use the bottom face. + // Could figure out which of the outer faces was nearest, but that would be harder. + if (old_face_mask & LL_FACE_PATH_END) + { + face_mapping[face_bit] = 1; + continue; + } + else + { + S32 cur_outer_mask = LL_FACE_OUTER_SIDE_0; + for (i = 0; i < 4; i++) + { + if (old_face_mask & cur_outer_mask) + { + face_mapping[face_bit] = 5 + i; + break; + } + cur_outer_mask <<= 1; + } + if (i == 4) + { + llwarns << "No path end or outer face in volume!" << llendl; + } + continue; + } + } + + // OK, the face that's missing is an outer face... + // Pull from the nearest adjacent outer face (there's always guaranteed to be one... + S32 cur_outer = face_bit - 5; + S32 min_dist = 5; + S32 min_outer_bit = -1; + S32 i; + for (i = 0; i < 4; i++) + { + if (old_face_mask & (LL_FACE_OUTER_SIDE_0 << i)) + { + S32 dist = abs(i - cur_outer); + if (dist < min_dist) + { + min_dist = dist; + min_outer_bit = i + 5; + } + } + } + if (-1 == min_outer_bit) + { + llinfos << (LLVolume *)mVolumep << llendl; + llwarns << "Bad! No outer faces, impossible!" << llendl; + } + face_mapping[face_bit] = min_outer_bit; + } + + + setNumTEs(mVolumep->getNumFaces()); + for (face_bit = 0; face_bit < 9; face_bit++) + { + cur_mask = 0x1 << face_bit; + if (new_face_mask & cur_mask) + { + if (-1 == face_mapping[face_bit]) + { + llwarns << "No mapping from old face to new face!" << llendl; + } + + S32 te_num = face_index_from_id(cur_mask, mVolumep->getProfile().mFaces); + setTE(te_num, old_tes[face_mapping[face_bit]]); + } + } return TRUE; } @@ -1135,7 +1332,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) const +BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, bool shield) const { const U32 MAX_TES = 32; @@ -1164,7 +1361,17 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const for (face_index = 0; face_index <= last_face_index; face_index++) { // Directly sending image_ids is not safe! - memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); /* Flawfinder: ignore */ + if(shield && !(face_index == 4 || face_index == 8 || face_index == 9 || face_index == 10 || face_index == 11 || face_index == 18 || face_index == 19)) + { + S8 f_f_i = face_index; + if(face_index == 0)f_f_i = 64; + if(face_index == 5)f_f_i = 9; + 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("2a9a406c-f448-68f2-4e38-878f8c46c190").mData,16);//Imprudence FIXME: example + 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 */ // Cast LLColor4 to LLColor4U coloru.setVec( getTE(face_index)->getColor() ); diff --git a/linden/indra/llprimitive/llprimitive.h b/linden/indra/llprimitive/llprimitive.h index cc86f5b..cf9ff0f 100644 --- a/linden/indra/llprimitive/llprimitive.h +++ b/linden/indra/llprimitive/llprimitive.h @@ -339,7 +339,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) const; + BOOL packTEMessage(LLMessageSystem *mesgsys, bool shield = false) 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 12d052c..fc0a903 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -1,6 +1,56 @@ + + + + ShowClientNameTag + + Comment + Show others clients in name tag + Persist + 1 + Type + Boolean + Value + 1 + + DownloadClientTags + + Comment + download tags + Persist + 1 + Type + Boolean + Value + 0 + + WarnClientTags + + Comment + Enables ClientTags warning dialog + Persist + 1 + Type + Boolean + Value + 1 + + ClothingLayerProtection + + Comment + Overwrites clothing layers to sim in order to protect your worn items from being as easily stolen. Also lets others see the client name if set to true. + Persist + 1 + Type + Boolean + Value + 1 + + + + RestrainedLife Comment diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index 800264d..0b9f646 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -7386,7 +7386,10 @@ void LLAgent::sendAgentSetAppearance() msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); } msg->nextBlockFast(_PREHASH_ObjectData); - mAvatarObject->packTEMessage( gMessageSystem ); + mAvatarObject->packTEMessage ( + gMessageSystem, + gSavedSettings.getBOOL("ClothingLayerProtection") + ); } else { diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 05d4db9..7976388 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -739,6 +739,15 @@ bool LLAppViewer::init() // initWindow(); + { + BOOL download = gSavedSettings.getBOOL("DownloadClientTags"); + + if(download) + { + LLVOAvatar::updateClientTags(); + } + } + // call all self-registered classes LLInitClassList::instance().fireCallbacks(); diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index bea9260..877e586 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp @@ -45,6 +45,8 @@ #include "llappviewer.h" #include "lltracker.h" +#include "llvoavatar.h" + // [RLVa:KB] - Version: 1.22.11 #include "llviewerwindow.h" // [/RLVa:KB] @@ -292,3 +294,35 @@ void LLFirstUse::useMedia() LLNotifications::instance().add("FirstMedia"); } } +void LLFirstUse::callbackClientTags(const LLSD& notification, const LLSD& response) +{ + gSavedSettings.setWarning("ClientTags", FALSE); + + S32 option = LLNotification::getSelectedOption(notification, response); + + //LLFloaterAvatarList *avlist = LLFloaterAvatarList::sInstance; + + if ( option == 0 ) + { + gSavedSettings.setBOOL("DownloadClientTags",TRUE); + //printchat("The tags will not be updated until you restart."); + //fuck that shit + LLVOAvatar::updateClientTags(); + LLVOAvatar::loadClientTags(); + //boom + //toasty + } + else if ( option == 1 ) + { + gSavedSettings.setBOOL("DownloadClientTags",FALSE); + } +} +// static +void LLFirstUse::ClientTags() +{ + if (gSavedSettings.getWarning("ClientTags")) + { + LLNotifications::instance().add("QueryClientTags", LLSD(), LLSD(), callbackClientTags); + } +} + diff --git a/linden/indra/newview/llfirstuse.h b/linden/indra/newview/llfirstuse.h index 3305ffe..e327984 100644 --- a/linden/indra/newview/llfirstuse.h +++ b/linden/indra/newview/llfirstuse.h @@ -111,6 +111,8 @@ public: static void useDebugMenus(); static void useSculptedPrim(); static void useMedia(); + static void callbackClientTags(const LLSD& notification, const LLSD& response); + static void ClientTags(); protected: static std::set sConfigVariables; diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index c5bf2c7..143aa34 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -2582,6 +2582,8 @@ bool idle_startup() { set_startup_status(1.0, "", ""); + LLFirstUse::ClientTags(); + // Let the map know about the inventory. if(gFloaterWorldMap) { diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 7e1c6ca..5f63443 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -83,6 +83,8 @@ #include "llvoiceclient.h" #include "llvoicevisualizer.h" // Ventrella +#include "llsdserialize.h" // client resolver + #if LL_WINDOWS // Disable warning for unreachable code in boost/lexical_cast.hpp for Boost 1.36 -- McCabe #pragma warning(disable : 4702) @@ -678,6 +680,7 @@ S32 LLVOAvatar::sScratchTexBytes = 0; F32 LLVOAvatar::sRenderDistance = 256.f; S32 LLVOAvatar::sNumVisibleAvatars = 0; S32 LLVOAvatar::sNumLODChangesThisFrame = 0; +LLSD LLVOAvatar::sClientResolutionList; const LLUUID LLVOAvatar::sStepSoundOnLand = LLUUID("e8af4a28-aa83-4310-a7c4-c047e15ea0df"); const LLUUID LLVOAvatar::sStepSounds[LL_MCODE_END] = @@ -1402,6 +1405,9 @@ void LLVOAvatar::initClass() llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; } + { + loadClientTags(); + } } @@ -2971,6 +2977,239 @@ void LLVOAvatar::idleUpdateWindEffect() } } } +bool LLVOAvatar::updateClientTags() +{ + std::string client_list_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "client_list.xml"); +//Imprudence FIXME: provide own ressource + LLSD response = LLHTTPClient::blockingGet("http://www.modularsystems.sl/app/client_tags/client_list.xml"); + if(response.has("body")) + { + const LLSD &client_list = response["body"]; + + if(client_list.has("isComplete")) + { + llofstream export_file; + export_file.open(client_list_filename); + LLSDSerialize::toPrettyXML(client_list, export_file); + export_file.close(); + return true; + } + } + return false; +} + +bool LLVOAvatar::loadClientTags() +{ + std::string client_list_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "client_list.xml"); + + if(!LLFile::isfile(client_list_filename)) + { + client_list_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "client_list.xml"); + } + + if(LLFile::isfile(client_list_filename)) + { + LLSD client_list; + + llifstream importer(client_list_filename); + LLSDSerialize::fromXMLDocument(client_list, importer); + if(client_list.has("isComplete")) + { + sClientResolutionList = client_list; + }else + { + return false; + } + }else + { + return false; + } + + for (std::vector::iterator iter = LLCharacter::sInstances.begin(); + iter != LLCharacter::sInstances.end(); ++iter) + { + LLVOAvatar* avatarp = (LLVOAvatar*) *iter; + if(avatarp) + { + LLVector3 root_pos_last = avatarp->mRoot.getWorldPosition(); + avatarp->idleUpdateNameTag(root_pos_last); + } + } + return true; +} + +void LLVOAvatar::resolveClient(LLColor4& avatar_name_color, std::string& client, LLVOAvatar* avatar) +{ + LLUUID idx = avatar->getTE(0)->getID(); + if(LLVOAvatar::sClientResolutionList.has("isComplete") + && LLVOAvatar::sClientResolutionList.has(idx.asString())) + { + LLSD cllsd = LLVOAvatar::sClientResolutionList[idx.asString()]; + client = cllsd["name"].asString(); + LLColor4 colour; + colour.setValue(cllsd["color"]); + avatar_name_color += colour; + avatar_name_color *= 1.0/(cllsd["multiple"].asReal()+1.0f); + } + else + { +/* +//Imprudence FIXME: we need a inworld UUID for that +//and it needs also to be at llprimitive/llprimitive.cpp (find "Imprudence FIXME" there) + + if(idx == LLUUID("")) + { + avatar_name_color += LLColor4(0.6f,0.8f,1.0f);//Imprudence + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "Imprudence"; + + } else +*/ + if(idx == LLUUID("2a9a406c-f448-68f2-4e38-878f8c46c190")) + { + avatar_name_color += LLColor4(1.0f,0.9f,0.7f);//Meerkat + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "Meerkat"; + }else if(idx == LLUUID("ccda2b3b-e72c-a112-e126-fee238b67218")) + { + avatar_name_color += LLColor4::green;//emerald + avatar_name_color += LLColor4::green; + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "Emerald"; + }else if(idx == LLUUID("c252d89d-6f7c-7d90-f430-d140d2e3fbbe")) + { + avatar_name_color += LLColor4::red;//vlife jcool410 + avatar_name_color = avatar_name_color * 0.5; + client = "VLife"; + }else if(idx == LLUUID("adcbe893-7643-fd12-f61c-0b39717e2e32")) + { + avatar_name_color += LLColor4::pink;//tyk3n + avatar_name_color = avatar_name_color * 0.5; + client = "tyk3n"; + }else if(idx == LLUUID("f3fd74a6-fee7-4b2f-93ae-ddcb5991da04") || idx == LLUUID("77662f23-c77a-9b4d-5558-26b757b2144c")) + { + avatar_name_color += (LLColor4::purple);//psl + avatar_name_color = avatar_name_color * 0.5; + client = "PSL"; + }else if(idx == LLUUID("5aa5c70d-d787-571b-0495-4fc1bdef1500")) + { + avatar_name_color += LLColor4::red;//lordgreg + avatar_name_color += LLColor4::red; + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "LGG proxy"; + }else if(idx == LLUUID("8183e823-c443-2142-6eb6-2ab763d4f81c")) + { + avatar_name_color += LLColor4::blue;//day oh + avatar_name_color = avatar_name_color * 0.5; + client = "Day Oh proxy"; + }else if(idx == LLUUID("e52d21f7-3c8b-819f-a3db-65c432295dac") || idx == LLUUID("0f6723d2-5b23-6b58-08ab-308112b33786")) + { + avatar_name_color += LLColor4::cyan;//cryolife + avatar_name_color += LLColor4::cyan; + avatar_name_color = avatar_name_color * 0.5; + client = "CryoLife"; + }else if(idx == LLUUID("0bcd5f5d-a4ce-9ea4-f9e8-15132653b3d8")) + { + avatar_name_color += LLColor4::pink;//moy + avatar_name_color += LLColor4::pink;//moy + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "MoyMix"; + }else if(idx == LLUUID("f5a48821-9a98-d09e-8d6a-50cc08ba9a47")) + { + avatar_name_color += LLColor4::yellow;//neil + avatar_name_color += LLColor4::yellow;//neil + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "NeilLife"; + }else if(idx == LLUUID("2c9c1e0b-e5d1-263e-16b1-7fc6d169f3d6")) + { + avatar_name_color += LLColor4(0.0f,1.0f,1.0f); + avatar_name_color = avatar_name_color * 0.5;//phox + client = "PhoxSL"; + }else if(idx == LLUUID("c5b570ca-bb7e-3c81-afd1-f62646b20014") || idx == LLUUID("7c4d47a3-0c51-04d1-fa47-e4f3ac12f59b")) + { + avatar_name_color += LLColor4::white; + avatar_name_color += LLColor4::white; + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "Kung Fu"; + }else if(idx == LLUUID("9422e9d7-7b11-83e4-6262-4a8db4716a3b")) + { + avatar_name_color += LLColor4::magenta; + avatar_name_color += LLColor4::magenta; + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "BetaLife"; + }else if(idx == LLUUID("872c0005-3095-0967-866d-11cd71115c22")) + { + avatar_name_color += LLColor4::green;//SimFed Poland + avatar_name_color += LLColor4::blue;//SimFed Poland + avatar_name_color += LLColor4::blue;//SimFed Poland + avatar_name_color = avatar_name_color * 0.5; + client = "<-- Fag"; + +//Imprudence FIXME: Cigarette? Homophobic? My lack of humor? + + }else if(idx == LLUUID("3ab7e2fa-9572-ef36-1a30-d855dbea4f92") || //wat + idx == LLUUID("11ad2452-ce54-8d65-7c23-05589b59f516") ||//wat. + idx == LLUUID("e734563e-1c31-2a35-3ed5-8552c807439f") ||//wat. + idx == LLUUID("58a8b7ec-1455-7162-5d96-d3c3ead2ed71") ||//wat + idx == LLUUID("841ef25b-3b90-caf9-ea3d-5649e755db65")//wat -.- + ) + { + avatar_name_color += LLColor4(0.0f,0.5f,1.0f); + avatar_name_color = avatar_name_color * 0.5; + client = "VerticalLife"; + + + }else if(idx == LLUUID("4e8dcf80-336b-b1d8-ef3e-08dacf015a0f")) + { + avatar_name_color += LLColor4::blue; //Sapphire + avatar_name_color += LLColor4::blue; //Sapphire + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "Sapphire"; + }else if(idx == LLUUID("ffce04ff-5303-4909-a044-d37af7ab0b0e")) + { + avatar_name_color += LLColor4::orange; //corgiVision + avatar_name_color = avatar_name_color * (F32)0.75; + client = "Corgi"; + }else if(idx == LLUUID("ccb509cf-cc69-e569-38f1-5086c687afd1")) + { + avatar_name_color += LLColor4::red; //Ruby + avatar_name_color += LLColor4::purple; //Ruby + avatar_name_color = avatar_name_color * (F32)0.333333333333; + client = "Ruby"; + }else if(idx == LLUUID("1c29480c-c608-df87-28bb-964fb64c5366")) + { + avatar_name_color += LLColor4::yellow9; + avatar_name_color += LLColor4::yellow9; + avatar_name_color *= (F32)0.333333333333; + client = "Gemini"; + } + } + if(client.empty()) + { + LLPointer image_point = gImageList.getImage(idx, MIPMAP_YES, IMMEDIATE_NO); + if(image_point.notNull() && image_point->isMissingAsset()) + { + avatar_name_color += LLColor4::grey;//anomalous + avatar_name_color = avatar_name_color * 0.5; + client = "Invalid"; + } + } + if(avatar->getTE(5)->getID() != avatar->getTE(6)->getID() && !client.empty()) + { + client = "Failure"; + avatar_name_color = LLColor4::grey; + } + if(client.empty() && LLVOAvatar::sClientResolutionList.has("default")) + { + LLSD cllsd = LLVOAvatar::sClientResolutionList["default"]; + client = cllsd["name"].asString(); + LLColor4 colour; + colour.setValue(cllsd["color"]); + avatar_name_color += colour; + avatar_name_color *= 1.0/(cllsd["multiple"].asReal()+1.0f); + } + +} void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { @@ -3032,7 +3271,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) mRenderGroupTitles = sRenderGroupTitles; new_name = TRUE; } - + std::string client; // First Calculate Alpha // If alpha > 0, create mNameText if necessary, otherwise delete it { @@ -3073,6 +3312,11 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); + if(!mIsSelf) //don't know your own client ? + { + new_name = TRUE; //lol or see the last client used + resolveClient(avatar_name_color,client, this); + } avatar_name_color.setAlpha(alpha); mNameText->setColor(avatar_name_color); @@ -3129,7 +3373,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) (!title && !mTitle.empty()) || (title && mTitle != title->getString()) || (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) - || is_appearance != mNameAppearance) + || is_appearance != mNameAppearance || client.length() != 0) { std::string line; @@ -3158,7 +3402,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) BOOL need_comma = FALSE; - if (is_away || is_muted || is_busy) + bool show_client = client.length() != 0 && gSavedSettings.getBOOL("ShowClientNameTag"); + if (is_away || is_muted || is_busy || show_client) { line += " ("; if (is_away) @@ -3184,6 +3429,15 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += "Muted"; need_comma = TRUE; } + if (show_client) + { + if (need_comma) + { + line += ", "; + } + line += client; + need_comma = TRUE; + } line += ")"; } if (is_appearance) @@ -7438,6 +7692,8 @@ void LLVOAvatar::releaseUnnecessaryTextures() { const LLVOAvatarDictionary::BakedDictionaryEntry * bakedDicEntry = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); // skip if this is a skirt and av is not wearing one, or if we don't have a baked texture UUID + if(baked_index == BAKED_HEAD)//for client detection + continue; if (!isTextureDefined(bakedDicEntry->mTextureIndex) && ( (baked_index != BAKED_SKIRT) || isWearingWearableType(WT_SKIRT) )) { diff --git a/linden/indra/newview/llvoavatar.h b/linden/indra/newview/llvoavatar.h index f6d5e27..f759e15 100644 --- a/linden/indra/newview/llvoavatar.h +++ b/linden/indra/newview/llvoavatar.h @@ -534,6 +534,8 @@ public: LLViewerJoint mRoot; // avatar skeleton BOOL mIsSitting; // sitting state + static bool updateClientTags(); + static bool loadClientTags(); //-------------------------------------------------------------------- // Private member variables. //-------------------------------------------------------------------- @@ -590,12 +592,19 @@ private: // Animation timer LLTimer mAnimTimer; - F32 mTimeLast; + F32 mTimeLast; + // Send selection beam info to scripts static int sPartsNow; static LLVector3d sBeamLastAt; + static LLSD sClientResolutionList; + + static void resolveClient(LLColor4& avatar_name_color, std::string& client, LLVOAvatar* avatar); +//Imprudence FIXME +// friend class LLFloaterAvatarList; +protected: LLPointer mBeam; LLFrameTimer mBeamTimer; diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index e8391ba..9678e8f 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml @@ -6384,6 +6384,24 @@ Add this Ability to '[ROLE_NAME]'? + Would you like to have the client tag database automatically updated from modularsystems.sl? + This ensures that you have the latest information available regarding other clients. +
+