From cedce34ead32b5b6b595c133b94bbbede0324f6b Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 26 Feb 2010 17:33:44 +0100 Subject: Added PrivateLookAtTarget option. When true, viewer won't tell where your avatar is looking. --- linden/indra/newview/app_settings/settings.xml | 11 +++++++++++ linden/indra/newview/llhudeffectlookat.cpp | 24 +++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 93dc2fb..1cf31d7 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -7136,6 +7136,17 @@ 0 + PrivateLookAtTarget + + Comment + If true, viewer won't tell other viewers where your avatar is looking. + Persist + 1 + Type + Boolean + Value + 0 + ProbeHardwareOnStartup Comment diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 3a5bec2..b54101e 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp @@ -285,18 +285,36 @@ void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys) // pack both target object and position // position interpreted as offset if target object is non-null + ELookAtType target_type = mTargetType; + LLVector3d target_offset_global = mTargetOffsetGlobal; + LLViewerObject* target_object = (LLViewerObject*) mTargetObject; + + LLVOAvatar* source_avatar = (LLVOAvatar*)(LLViewerObject*)mSourceObject; + bool is_self = source_avatar-> isSelf(); + bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); + + if (is_private && is_self) + { + //this mimicks own avatar selected, consider not to change this + //because bots could profile other settings for evil client detection + target_type = LOOKAT_TARGET_SELECT; + target_offset_global.setVec(5.0, 0.0, 0.0); + target_object = mSourceObject; + } + + if (mTargetObject) { - htonmemcpy(&(packed_data[TARGET_OBJECT]), mTargetObject->mID.mData, MVT_LLUUID, 16); + htonmemcpy(&(packed_data[TARGET_OBJECT]), target_object->mID.mData, MVT_LLUUID, 16); } else { htonmemcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16); } - htonmemcpy(&(packed_data[TARGET_POS]), mTargetOffsetGlobal.mdV, MVT_LLVector3d, 24); + htonmemcpy(&(packed_data[TARGET_POS]), target_offset_global.mdV, MVT_LLVector3d, 24); - U8 lookAtTypePacked = (U8)mTargetType; + U8 lookAtTypePacked = (U8)target_type; htonmemcpy(&(packed_data[LOOKAT_TYPE]), &lookAtTypePacked, MVT_U8, 1); -- cgit v1.1