From c2373fb5a6b08b2c32e5f93fa67b25f669e8b47f Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 11 Feb 2010 16:39:15 -0800 Subject: Created stub LLAvatarNameCache for display name lookup, as well as LLAvatarName base data object. Reviewed with Kelly. --- indra/llcommon/CMakeLists.txt | 2 ++ indra/llcommon/llavatarname.cpp | 44 ++++++++++++++++++++++++++++++++++ indra/llcommon/llavatarname.h | 53 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 indra/llcommon/llavatarname.cpp create mode 100644 indra/llcommon/llavatarname.h (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 4481d334b2..bed7b46cd0 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -32,6 +32,7 @@ set(llcommon_SOURCE_FILES llapp.cpp llapr.cpp llassettype.cpp + llavatarname.cpp llbase32.cpp llbase64.cpp llcommon.cpp @@ -113,6 +114,7 @@ set(llcommon_HEADER_FILES llallocator.h llallocator_heap_profile.h llagentconstants.h + llavatarname.h llapp.h llapr.h llassettype.h diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp new file mode 100644 index 0000000000..0563374785 --- /dev/null +++ b/indra/llcommon/llavatarname.cpp @@ -0,0 +1,44 @@ +/** + * @file llavatarname.cpp + * @brief Represents name-related data for an avatar, such as the + * username/SLID ("bobsmith123" or "james.linden") and the display + * name ("James Cook") + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llavatarname.h" + +bool LLAvatarName::operator<(const LLAvatarName& rhs) const +{ + if (mSLID == rhs.mSLID) + return mDisplayName < rhs.mDisplayName; + else + return mSLID < rhs.mSLID; +} diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h new file mode 100644 index 0000000000..4264a8e655 --- /dev/null +++ b/indra/llcommon/llavatarname.h @@ -0,0 +1,53 @@ +/** + * @file llavatarname.h + * @brief Represents name-related data for an avatar, such as the + * username/SLID ("bobsmith123" or "james.linden") and the display + * name ("James Cook") + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLAVATARNAME_H +#define LLAVATARNAME_H + +#include + +class LL_COMMON_API LLAvatarName +{ +public: + bool operator<(const LLAvatarName& rhs) const; + + // "bobsmith123" or "james.linden", US-ASCII only + std::string mSLID; + + // "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode + // Contains data whether or not user has explicitly set + // a display name; may duplicate their SLID. + std::string mDisplayName; +}; + +#endif -- cgit v1.2.3 From c16591c046fa76fc5d13387efa3bcaec3422e593 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 12 Feb 2010 16:12:12 -0800 Subject: Per-avatar customizable icons next to name links in text Changed LLUrlEntryAgent callbacks to handle both link label and icon Eliminated legacy LLNameCache file loading Reviewed with Kelly --- indra/llcommon/llavatarname.cpp | 7 +++++++ indra/llcommon/llavatarname.h | 11 +++++++++++ 2 files changed, 18 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 0563374785..3b1ab4d267 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -35,6 +35,13 @@ #include "llavatarname.h" +LLAvatarName::LLAvatarName() +: mSLID(), + mDisplayName(), + mLastUpdate(0), + mBadge() +{ } + bool LLAvatarName::operator<(const LLAvatarName& rhs) const { if (mSLID == rhs.mSLID) diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 4264a8e655..7205eb4523 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -39,6 +39,8 @@ class LL_COMMON_API LLAvatarName { public: + LLAvatarName(); + bool operator<(const LLAvatarName& rhs) const; // "bobsmith123" or "james.linden", US-ASCII only @@ -48,6 +50,15 @@ public: // Contains data whether or not user has explicitly set // a display name; may duplicate their SLID. std::string mDisplayName; + + // Names can change, so need to keep track of when name was + // last checked. + // Unix time-from-epoch seconds + U32 mLastUpdate; + + // Can be a viewer UI image name ("Person_Check") or a server-side + // image UUID, or empty string. + std::string mBadge; }; #endif -- cgit v1.2.3 From af8f8b4770eb45b4238d98ddd574ba726470f797 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 19 Feb 2010 11:11:45 -0800 Subject: Improved support for toggling display names on/off Stop pre-populated name cache because we have a web service now for lookup Added mIsLegacy to LLAvatarName so we can colorize those name tags differently --- indra/llcommon/llavatarname.cpp | 1 + indra/llcommon/llavatarname.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 3b1ab4d267..3950fc3af1 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -38,6 +38,7 @@ LLAvatarName::LLAvatarName() : mSLID(), mDisplayName(), + mIsLegacy(false), mLastUpdate(0), mBadge() { } diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 7205eb4523..fb67c16f45 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -51,6 +51,10 @@ public: // a display name; may duplicate their SLID. std::string mDisplayName; + // If true, both display name and SLID were generated from + // a legacy first and last name, like "James Linden (james.linden)" + bool mIsLegacy; + // Names can change, so need to keep track of when name was // last checked. // Unix time-from-epoch seconds -- cgit v1.2.3 From 596196c6e7a167b6dfaef8f2fbf6c76048314e0d Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 19 Feb 2010 11:18:49 -0800 Subject: Change channel to "Second Life Alpha" so installers don't wipe 1.23 --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 540aea4252..d53036844d 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -36,7 +36,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 0; const S32 LL_VERSION_PATCH = 0; -const S32 LL_VERSION_BUILD = 200030; +const S32 LL_VERSION_BUILD = 999999; const char * const LL_CHANNEL = "Second Life Developer"; -- cgit v1.2.3 From f3e0e9a5264a80d146a1d4d77fd9c4f5d3070278 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 24 Feb 2010 14:31:46 -0800 Subject: Hack to refresh name tags when I change my display name. Also fixes a crash when turning on display names. --- indra/llcommon/llchat.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h index a77bd211f3..71ab80159e 100644 --- a/indra/llcommon/llchat.h +++ b/indra/llcommon/llchat.h @@ -34,7 +34,6 @@ #ifndef LL_LLCHAT_H #define LL_LLCHAT_H -#include "llstring.h" #include "lluuid.h" #include "v3math.h" @@ -75,7 +74,7 @@ typedef enum e_chat_style class LLChat { public: - LLChat(const std::string& text = LLStringUtil::null) + LLChat(const std::string& text = std::string()) : mText(text), mFromName(), mFromID(), -- cgit v1.2.3 From 0b36c4181203e37d6fc3e59817d5b5abd2d7611e Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 8 Apr 2010 15:43:00 -0700 Subject: DEV-47529 Add expiration to display name cache for viewer Also synchronize LLAvatarNameCache with server version TODO: Get expiration time from web service --- indra/llcommon/llavatarname.cpp | 2 +- indra/llcommon/llavatarname.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 3950fc3af1..cad4f941fe 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -39,7 +39,7 @@ LLAvatarName::LLAvatarName() : mSLID(), mDisplayName(), mIsLegacy(false), - mLastUpdate(0), + mExpires(U32_MAX), mBadge() { } diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index fb67c16f45..4d50f6e76d 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -58,7 +58,7 @@ public: // Names can change, so need to keep track of when name was // last checked. // Unix time-from-epoch seconds - U32 mLastUpdate; + U32 mExpires; // Can be a viewer UI image name ("Person_Check") or a server-side // image UUID, or empty string. -- cgit v1.2.3 From 65e565e0e1d7b964048a32a92f59a5dd8f74bb0c Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 12 Apr 2010 16:36:12 -0700 Subject: DEV-47529 Convert viewer to use final People API lookup URL format Reviewed with Simon --- indra/llcommon/llavatarname.cpp | 2 +- indra/llcommon/llavatarname.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index cad4f941fe..48ff7f3cc8 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -38,7 +38,7 @@ LLAvatarName::LLAvatarName() : mSLID(), mDisplayName(), - mIsLegacy(false), + mIsDisplayNameDefault(false), mExpires(U32_MAX), mBadge() { } diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 4d50f6e76d..5a0306c57e 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -53,7 +53,7 @@ public: // If true, both display name and SLID were generated from // a legacy first and last name, like "James Linden (james.linden)" - bool mIsLegacy; + bool mIsDisplayNameDefault; // Names can change, so need to keep track of when name was // last checked. -- cgit v1.2.3 From 69de1f4eb7cdd063bbdd7b4019a6a9799fc5dc5f Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 16 Apr 2010 19:06:17 -0700 Subject: Accept expires timestamp as UTC datetime in LLSD --- indra/llcommon/llavatarname.cpp | 2 +- indra/llcommon/llavatarname.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 48ff7f3cc8..5debf88818 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -39,7 +39,7 @@ LLAvatarName::LLAvatarName() : mSLID(), mDisplayName(), mIsDisplayNameDefault(false), - mExpires(U32_MAX), + mExpires(F64_MAX), mBadge() { } diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 5a0306c57e..72e2980b5c 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -58,7 +58,7 @@ public: // Names can change, so need to keep track of when name was // last checked. // Unix time-from-epoch seconds - U32 mExpires; + F64 mExpires; // Can be a viewer UI image name ("Person_Check") or a server-side // image UUID, or empty string. -- cgit v1.2.3 From 022a598694cd37bebff3322054324c7d27afd5ff Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 20 Apr 2010 17:05:49 -0700 Subject: Viewer caches avatar display names between sessions Reviewed with Simon --- indra/llcommon/llavatarname.cpp | 25 +++++++++++++++++++++++++ indra/llcommon/llavatarname.h | 8 +++++++- 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 5debf88818..62ba7cb112 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -35,6 +35,13 @@ #include "llavatarname.h" +// Store these in pre-built std::strings to avoid memory allocations in +// LLSD map lookups +static const std::string SL_ID("sl_id"); +static const std::string DISPLAY_NAME("display_name"); +static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); +static const std::string EXPIRES("expires"); + LLAvatarName::LLAvatarName() : mSLID(), mDisplayName(), @@ -50,3 +57,21 @@ bool LLAvatarName::operator<(const LLAvatarName& rhs) const else return mSLID < rhs.mSLID; } + +LLSD LLAvatarName::asLLSD() const +{ + LLSD sd; + sd[SL_ID] = mSLID; + sd[DISPLAY_NAME] = mDisplayName; + sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; + sd[EXPIRES] = mExpires; + return sd; +} + +void LLAvatarName::fromLLSD(const LLSD& sd) +{ + mSLID = sd[SL_ID].asString(); + mDisplayName = sd[DISPLAY_NAME].asString(); + mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); + mExpires = sd[EXPIRES].asReal(); +} diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 72e2980b5c..11bd5f30b7 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -36,13 +36,19 @@ #include +class LLSD; + class LL_COMMON_API LLAvatarName { public: LLAvatarName(); - + bool operator<(const LLAvatarName& rhs) const; + LLSD asLLSD() const; + + void fromLLSD(const LLSD& sd); + // "bobsmith123" or "james.linden", US-ASCII only std::string mSLID; -- cgit v1.2.3 From 98f5fc5ff006a82cacde47de0cbb564b6e703597 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 22 Apr 2010 14:13:45 -0700 Subject: DEV-47529 Turn off display names if no capability from simulator, and Display name update broadcasts entire new name record to nearby viewers Display name update directly inserts new name into sim cache indra.xml has display_names_enabled setting to control cap Synchronized viewer and server versions of avatar name cache Reviewed with Ambroff --- indra/llcommon/llavatarname.cpp | 10 +++++++--- indra/llcommon/llavatarname.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 62ba7cb112..c35b8380b8 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -35,12 +35,15 @@ #include "llavatarname.h" +#include "lldate.h" +#include "llsd.h" + // Store these in pre-built std::strings to avoid memory allocations in // LLSD map lookups static const std::string SL_ID("sl_id"); static const std::string DISPLAY_NAME("display_name"); static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); -static const std::string EXPIRES("expires"); +static const std::string DISPLAY_NAME_EXPIRES("display_name_expires"); LLAvatarName::LLAvatarName() : mSLID(), @@ -64,7 +67,7 @@ LLSD LLAvatarName::asLLSD() const sd[SL_ID] = mSLID; sd[DISPLAY_NAME] = mDisplayName; sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; - sd[EXPIRES] = mExpires; + sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires); return sd; } @@ -73,5 +76,6 @@ void LLAvatarName::fromLLSD(const LLSD& sd) mSLID = sd[SL_ID].asString(); mDisplayName = sd[DISPLAY_NAME].asString(); mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); - mExpires = sd[EXPIRES].asReal(); + LLDate expires = sd[DISPLAY_NAME_EXPIRES]; + mExpires = expires.secondsSinceEpoch(); } diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 11bd5f30b7..b30dca6e6e 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -63,7 +63,7 @@ public: // Names can change, so need to keep track of when name was // last checked. - // Unix time-from-epoch seconds + // Unix time-from-epoch seconds for efficiency F64 mExpires; // Can be a viewer UI image name ("Person_Check") or a server-side -- cgit v1.2.3 From e4f2887983dc6f473c6657b8b653437557c638fa Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 26 Apr 2010 14:19:58 -0700 Subject: Don't save dummy records (from 503 errors) to disk cache --- indra/llcommon/llavatarname.cpp | 1 + indra/llcommon/llavatarname.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index c35b8380b8..4272e096ed 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -49,6 +49,7 @@ LLAvatarName::LLAvatarName() : mSLID(), mDisplayName(), mIsDisplayNameDefault(false), + mIsDummy(false), mExpires(F64_MAX), mBadge() { } diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index b30dca6e6e..3e26887d7a 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -61,6 +61,11 @@ public: // a legacy first and last name, like "James Linden (james.linden)" bool mIsDisplayNameDefault; + // Under error conditions, we may insert "dummy" records with + // names like "???" into caches as placeholders. These can be + // shown in UI, but are not serialized. + bool mIsDummy; + // Names can change, so need to keep track of when name was // last checked. // Unix time-from-epoch seconds for efficiency -- cgit v1.2.3 From 8fae11ee368e5b1dce858cdd698714384430858b Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 28 Apr 2010 17:02:50 -0700 Subject: Remove prototype support for badges next to avatar names Easy to reimplement if we decide we want to do it. --- indra/llcommon/llavatarname.cpp | 3 +-- indra/llcommon/llavatarname.h | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 4272e096ed..4eeb6e706d 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -50,8 +50,7 @@ LLAvatarName::LLAvatarName() mDisplayName(), mIsDisplayNameDefault(false), mIsDummy(false), - mExpires(F64_MAX), - mBadge() + mExpires(F64_MAX) { } bool LLAvatarName::operator<(const LLAvatarName& rhs) const diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 3e26887d7a..d7d91e1c7a 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -70,10 +70,6 @@ public: // last checked. // Unix time-from-epoch seconds for efficiency F64 mExpires; - - // Can be a viewer UI image name ("Person_Check") or a server-side - // image UUID, or empty string. - std::string mBadge; }; #endif -- cgit v1.2.3 From 6b00537c871fb08f760016698c7e83f178c1cf55 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 16:30:57 -0700 Subject: DEV-50013 WIP Added utility to get name and SLID in single string --- indra/llcommon/llavatarname.cpp | 15 +++++++++++++++ indra/llcommon/llavatarname.h | 4 ++++ 2 files changed, 19 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 4eeb6e706d..7415acadd4 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -79,3 +79,18 @@ void LLAvatarName::fromLLSD(const LLSD& sd) LLDate expires = sd[DISPLAY_NAME_EXPIRES]; mExpires = expires.secondsSinceEpoch(); } + +std::string LLAvatarName::getNameAndSLID() const +{ + std::string name; + if (!mSLID.empty()) + { + name = mDisplayName + " (" + mSLID + ")"; + } + else + { + // ...display names are off, legacy name is in mDisplayName + name = mDisplayName; + } + return name; +} diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index d7d91e1c7a..87750210c6 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -49,6 +49,10 @@ public: void fromLLSD(const LLSD& sd); + // For normal names, returns "James Linden (james.linden)" + // When display names are disabled returns just "James Linden" + std::string getNameAndSLID() const; + // "bobsmith123" or "james.linden", US-ASCII only std::string mSLID; -- cgit v1.2.3 From f4148502e484d516b42c4a88603eee6889d45697 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 18 May 2010 16:00:45 -0700 Subject: Rename mSLID to mUsername to match the name of the field in the UI Product made a late-breaking request to change the name of this field. The wire protocol for People API has not yet changed. --- indra/llcommon/llavatarname.cpp | 16 +++++++++------- indra/llcommon/llavatarname.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 7415acadd4..de51a7f2aa 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -46,7 +46,7 @@ static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); static const std::string DISPLAY_NAME_EXPIRES("display_name_expires"); LLAvatarName::LLAvatarName() -: mSLID(), +: mUsername(), mDisplayName(), mIsDisplayNameDefault(false), mIsDummy(false), @@ -55,16 +55,18 @@ LLAvatarName::LLAvatarName() bool LLAvatarName::operator<(const LLAvatarName& rhs) const { - if (mSLID == rhs.mSLID) + if (mUsername == rhs.mUsername) return mDisplayName < rhs.mDisplayName; else - return mSLID < rhs.mSLID; + return mUsername < rhs.mUsername; } LLSD LLAvatarName::asLLSD() const { LLSD sd; - sd[SL_ID] = mSLID; + // Due to a late-breaking change request from Product, we renamed + // "SLID" to "Username", but it was too late to change the wire format. + sd[SL_ID] = mUsername; sd[DISPLAY_NAME] = mDisplayName; sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires); @@ -73,7 +75,7 @@ LLSD LLAvatarName::asLLSD() const void LLAvatarName::fromLLSD(const LLSD& sd) { - mSLID = sd[SL_ID].asString(); + mUsername = sd[SL_ID].asString(); // see asLLSD() above mDisplayName = sd[DISPLAY_NAME].asString(); mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); LLDate expires = sd[DISPLAY_NAME_EXPIRES]; @@ -83,9 +85,9 @@ void LLAvatarName::fromLLSD(const LLSD& sd) std::string LLAvatarName::getNameAndSLID() const { std::string name; - if (!mSLID.empty()) + if (!mUsername.empty()) { - name = mDisplayName + " (" + mSLID + ")"; + name = mDisplayName + " (" + mUsername + ")"; } else { diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 87750210c6..39071ec4c7 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -54,7 +54,7 @@ public: std::string getNameAndSLID() const; // "bobsmith123" or "james.linden", US-ASCII only - std::string mSLID; + std::string mUsername; // "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode // Contains data whether or not user has explicitly set -- cgit v1.2.3 From 31220ceffbacdf0f14929b735b0c9e250e1225ca Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 May 2010 11:23:29 -0700 Subject: DEV-50013 Viewer reads legacy first/last name from People API Useful for voice subsystem and muting subsystem. --- indra/llcommon/llavatarname.cpp | 18 ++++++++++++++++++ indra/llcommon/llavatarname.h | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index de51a7f2aa..e30f353a6c 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -42,12 +42,16 @@ // LLSD map lookups static const std::string SL_ID("sl_id"); static const std::string DISPLAY_NAME("display_name"); +static const std::string LEGACY_FIRST_NAME("legacy_first_name"); +static const std::string LEGACY_LAST_NAME("legacy_last_name"); static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); static const std::string DISPLAY_NAME_EXPIRES("display_name_expires"); LLAvatarName::LLAvatarName() : mUsername(), mDisplayName(), + mLegacyFirstName(), + mLegacyLastName(), mIsDisplayNameDefault(false), mIsDummy(false), mExpires(F64_MAX) @@ -68,6 +72,8 @@ LLSD LLAvatarName::asLLSD() const // "SLID" to "Username", but it was too late to change the wire format. sd[SL_ID] = mUsername; sd[DISPLAY_NAME] = mDisplayName; + sd[LEGACY_FIRST_NAME] = mLegacyFirstName; + sd[LEGACY_LAST_NAME] = mLegacyLastName; sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires); return sd; @@ -77,6 +83,8 @@ void LLAvatarName::fromLLSD(const LLSD& sd) { mUsername = sd[SL_ID].asString(); // see asLLSD() above mDisplayName = sd[DISPLAY_NAME].asString(); + mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); + mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); LLDate expires = sd[DISPLAY_NAME_EXPIRES]; mExpires = expires.secondsSinceEpoch(); @@ -96,3 +104,13 @@ std::string LLAvatarName::getNameAndSLID() const } return name; } + +std::string LLAvatarName::getLegacyName() const +{ + std::string name; + name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() ); + name = mLegacyFirstName; + name += " "; + name += mLegacyLastName; + return name; +} diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 39071ec4c7..fb5cb277a2 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -53,14 +53,31 @@ public: // When display names are disabled returns just "James Linden" std::string getNameAndSLID() const; + // Returns "James Linden" or "bobsmith123 Resident" for backwards + // compatibility with systems like voice and muting + // *TODO: Eliminate this in favor of username only + std::string getLegacyName() const; + // "bobsmith123" or "james.linden", US-ASCII only std::string mUsername; // "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode // Contains data whether or not user has explicitly set - // a display name; may duplicate their SLID. + // a display name; may duplicate their username. std::string mDisplayName; + // For "James Linden", "James" + // For "bobsmith123", "bobsmith123" + // Used to communicate with legacy systems like voice and muting which + // rely on old-style names. + // *TODO: Eliminate this in favor of username only + std::string mLegacyFirstName; + + // For "James Linden", "Linden" + // For "bobsmith123", "Resident" + // see above for rationale + std::string mLegacyLastName; + // If true, both display name and SLID were generated from // a legacy first and last name, like "James Linden (james.linden)" bool mIsDisplayNameDefault; -- cgit v1.2.3 From aee08f53f7a71bb7373345cae19c988ff985aa03 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 May 2010 14:35:29 -0700 Subject: Temporarily accept both username and sl_id from People API Need this for testing during transition, soon we can remove the code to read "sl_id" --- indra/llcommon/llavatarname.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index e30f353a6c..5a20aff4e6 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -41,6 +41,7 @@ // Store these in pre-built std::strings to avoid memory allocations in // LLSD map lookups static const std::string SL_ID("sl_id"); +static const std::string USERNAME("username"); static const std::string DISPLAY_NAME("display_name"); static const std::string LEGACY_FIRST_NAME("legacy_first_name"); static const std::string LEGACY_LAST_NAME("legacy_last_name"); @@ -68,9 +69,7 @@ bool LLAvatarName::operator<(const LLAvatarName& rhs) const LLSD LLAvatarName::asLLSD() const { LLSD sd; - // Due to a late-breaking change request from Product, we renamed - // "SLID" to "Username", but it was too late to change the wire format. - sd[SL_ID] = mUsername; + sd[USERNAME] = mUsername; sd[DISPLAY_NAME] = mDisplayName; sd[LEGACY_FIRST_NAME] = mLegacyFirstName; sd[LEGACY_LAST_NAME] = mLegacyLastName; @@ -81,7 +80,17 @@ LLSD LLAvatarName::asLLSD() const void LLAvatarName::fromLLSD(const LLSD& sd) { - mUsername = sd[SL_ID].asString(); // see asLLSD() above + // *HACK: accept both wire formats for now, as we are transitioning + // People API to use "username" + if (sd.has(USERNAME)) + { + mUsername = sd[USERNAME].asString(); + } + else + { + // *TODO: Remove + mUsername = sd[SL_ID].asString(); + } mDisplayName = sd[DISPLAY_NAME].asString(); mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); -- cgit v1.2.3 From d674d11f895b8f3d578cded931cdc1c430379c95 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 21 May 2010 17:11:31 -0700 Subject: Rename LLAvatarName::getNameAndSLID() to getCompleteName() Discussed with Leyla/Richard --- indra/llcommon/llavatarname.cpp | 2 +- indra/llcommon/llavatarname.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 5a20aff4e6..13b6ad705b 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -99,7 +99,7 @@ void LLAvatarName::fromLLSD(const LLSD& sd) mExpires = expires.secondsSinceEpoch(); } -std::string LLAvatarName::getNameAndSLID() const +std::string LLAvatarName::getCompleteName() const { std::string name; if (!mUsername.empty()) diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index fb5cb277a2..8b74e006c3 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -51,7 +51,7 @@ public: // For normal names, returns "James Linden (james.linden)" // When display names are disabled returns just "James Linden" - std::string getNameAndSLID() const; + std::string getCompleteName() const; // Returns "James Linden" or "bobsmith123 Resident" for backwards // compatibility with systems like voice and muting -- cgit v1.2.3 From a41d414625b07c3aff9bdd7be487c5b908d6a49f Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 26 May 2010 16:45:54 -0700 Subject: DEV-50013 Viewer only reads "username" from People API never "sl_id" --- indra/llcommon/llavatarname.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 13b6ad705b..6e0582f865 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -40,7 +40,6 @@ // Store these in pre-built std::strings to avoid memory allocations in // LLSD map lookups -static const std::string SL_ID("sl_id"); static const std::string USERNAME("username"); static const std::string DISPLAY_NAME("display_name"); static const std::string LEGACY_FIRST_NAME("legacy_first_name"); @@ -80,17 +79,7 @@ LLSD LLAvatarName::asLLSD() const void LLAvatarName::fromLLSD(const LLSD& sd) { - // *HACK: accept both wire formats for now, as we are transitioning - // People API to use "username" - if (sd.has(USERNAME)) - { - mUsername = sd[USERNAME].asString(); - } - else - { - // *TODO: Remove - mUsername = sd[SL_ID].asString(); - } + mUsername = sd[USERNAME].asString(); mDisplayName = sd[DISPLAY_NAME].asString(); mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); -- cgit v1.2.3 From c7a6a2e08f34b2cd21816a905c21e8017646001c Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 27 May 2010 14:56:29 -0700 Subject: DEV-50013 Friendlier info if you can't change name due to time lockout Reviewed with Leyla --- indra/llcommon/llavatarname.cpp | 7 ++++++- indra/llcommon/llavatarname.h | 5 +++++ indra/llcommon/llstring.cpp | 11 +++++++---- 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 6e0582f865..14dc41591b 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -46,6 +46,7 @@ static const std::string LEGACY_FIRST_NAME("legacy_first_name"); static const std::string LEGACY_LAST_NAME("legacy_last_name"); static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); static const std::string DISPLAY_NAME_EXPIRES("display_name_expires"); +static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update"); LLAvatarName::LLAvatarName() : mUsername(), @@ -54,7 +55,8 @@ LLAvatarName::LLAvatarName() mLegacyLastName(), mIsDisplayNameDefault(false), mIsDummy(false), - mExpires(F64_MAX) + mExpires(F64_MAX), + mNextUpdate(0.0) { } bool LLAvatarName::operator<(const LLAvatarName& rhs) const @@ -74,6 +76,7 @@ LLSD LLAvatarName::asLLSD() const sd[LEGACY_LAST_NAME] = mLegacyLastName; sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires); + sd[DISPLAY_NAME_NEXT_UPDATE] = LLDate(mNextUpdate); return sd; } @@ -86,6 +89,8 @@ void LLAvatarName::fromLLSD(const LLSD& sd) mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); LLDate expires = sd[DISPLAY_NAME_EXPIRES]; mExpires = expires.secondsSinceEpoch(); + LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE]; + mNextUpdate = next_update.secondsSinceEpoch(); } std::string LLAvatarName::getCompleteName() const diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 8b74e006c3..650a09a125 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -91,6 +91,11 @@ public: // last checked. // Unix time-from-epoch seconds for efficiency F64 mExpires; + + // You can only change your name every N hours, so record + // when the next update is allowed + // Unix time-from-epoch seconds + F64 mNextUpdate; }; #endif diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index b5a73ec1d1..637064d75f 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -694,14 +694,17 @@ void LLStringOps::setupDatetimeInfo (bool daylight) nowT = time (NULL); - tmpT = localtime (&nowT); - localT = mktime (tmpT); - tmpT = gmtime (&nowT); gmtT = mktime (tmpT); + tmpT = localtime (&nowT); + localT = mktime (tmpT); + sLocalTimeOffset = (long) (gmtT - localT); - + if (tmpT->tm_isdst) + { + sLocalTimeOffset -= 60 * 60; // 1 hour + } sPacificDaylightTime = daylight; sPacificTimeOffset = (sPacificDaylightTime? 7 : 8 ) * 60 * 60; -- cgit v1.2.3 From 88e7a631b3e4c3d63aa80fe9b3e7f2595d3f45f8 Mon Sep 17 00:00:00 2001 From: "Boroondas Gupte (daggyfied changeset by Techwolf Lupindo, original fix by Robin Cornelius)" Date: Thu, 16 Sep 2010 13:26:45 +0200 Subject: SNOW-512/SNOW-287: Build of LLPlugin fails on 64bit linux due to non PIC code linking into the DSO Formatting, cleanup, and one minor change by Techwolf Lupindo. Minor change was a move of the hunk in indra/media_plugins/webkit/CmakeLists.txt to same area as the other plugins CmakeLists.txt files. daggyfied version of https://bitbucket.org/Techwolf/viewer-development/changeset/00bd21962052 --- indra/llcommon/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 9ead183a9e..feb6d50799 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -250,6 +250,13 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) if(LLCOMMON_LINK_SHARED) add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) + if(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) + if(WINDOWS) + add_definitions(/FIXED:NO) + else(WINDOWS) # not windows therefore gcc LINUX and DARWIN + add_definitions(-fPIC) + endif(WINDOWS) + endif(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) ll_stage_sharedlib(llcommon) else(LLCOMMON_LINK_SHARED) add_library (llcommon ${llcommon_SOURCE_FILES}) -- cgit v1.2.3 From 64f0b9a7f8d96e170049990372f445d471b826ac Mon Sep 17 00:00:00 2001 From: "Boroondas Gupte (original patches by Aimee Linden)" Date: Tue, 31 Aug 2010 13:48:30 +0200 Subject: SNOW-748 FIXED Building on OSX 10.6 fails with "warning: -mdynamic-no-pic overrides - fpic or -fPIC" Originally commited at http://svn.secondlife.com/trac/linden/changeset/3499/projects/2010/snowglobe and http://svn.secondlife.com/trac/linden/changeset/3501 SVN changeset 3499 partially applied with --ignore-whitespace: Hunk #1 FAILED at 259. Hunk #2 FAILED at 265. 2 out of 2 hunks FAILED -- saving rejects to file indra/llcommon/CMakeLists.txt.rej patching file indra/media_plugins/webkit/CMakeLists.txt Hunk #1 succeeded at 33 with fuzz 1 (offset -8 lines). patching file indra/media_plugins/base/CMakeLists.txt patching file indra/media_plugins/gstreamer010/CMakeLists.txt patching file indra/media_plugins/example/CMakeLists.txt patching file indra/llplugin/CMakeLists.txt Manually applied to indra/llcommon/CMakeLists.txt (straight forward). SVN changeset 3501 applied with fuzz 1: patching file indra/media_plugins/webkit/CMakeLists.txt Hunk #1 succeeded at 33 with fuzz 1 (offset -8 lines). Hunk #2 succeeded at 39 with fuzz 1 (offset -8 lines). No further changes other than that. --- indra/llcommon/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index feb6d50799..20a6c8d709 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -250,13 +250,13 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) if(LLCOMMON_LINK_SHARED) add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) - if(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) + if(NOT WORD_SIZE EQUAL 32) if(WINDOWS) add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) - endif(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) + endif(NOT WORD_SIZE EQUAL 32) ll_stage_sharedlib(llcommon) else(LLCOMMON_LINK_SHARED) add_library (llcommon ${llcommon_SOURCE_FILES}) -- cgit v1.2.3 From ea112188e258cd51856b767311ee7917c114413a Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Tue, 31 Aug 2010 14:33:27 +0200 Subject: SNOW-748 FOLLOWUP make CMake if indentation consistent with other occurrences (i.e. two spaces only) --- indra/llcommon/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 20a6c8d709..f5acadf30c 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -249,15 +249,15 @@ set_source_files_properties(${llcommon_HEADER_FILES} list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) if(LLCOMMON_LINK_SHARED) - add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) - if(NOT WORD_SIZE EQUAL 32) - if(WINDOWS) - add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) - endif(NOT WORD_SIZE EQUAL 32) - ll_stage_sharedlib(llcommon) + add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) + if(NOT WORD_SIZE EQUAL 32) + if(WINDOWS) + add_definitions(/FIXED:NO) + else(WINDOWS) # not windows therefore gcc LINUX and DARWIN + add_definitions(-fPIC) + endif(WINDOWS) + endif(NOT WORD_SIZE EQUAL 32) + ll_stage_sharedlib(llcommon) else(LLCOMMON_LINK_SHARED) add_library (llcommon ${llcommon_SOURCE_FILES}) endif(LLCOMMON_LINK_SHARED) -- cgit v1.2.3 From e45b3c6884bc7d9bc457b9633932c8aad5a28430 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sat, 4 Sep 2010 19:35:27 +0100 Subject: Correct license on newly exported files to LGPL. --- indra/llcommon/llavatarname.cpp | 36 +++++++++++++++--------------------- indra/llcommon/llavatarname.h | 36 +++++++++++++++--------------------- 2 files changed, 30 insertions(+), 42 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 14dc41591b..b1ec9e9875 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -4,31 +4,25 @@ * username/SLID ("bobsmith123" or "james.linden") and the display * name ("James Cook") * - * $LicenseInfo:firstyear=2010&license=viewergpl$ - * - * Copyright (c) 2010, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2010&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #include "linden_common.h" diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 650a09a125..145aeccd35 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -4,31 +4,25 @@ * username/SLID ("bobsmith123" or "james.linden") and the display * name ("James Cook") * - * $LicenseInfo:firstyear=2010&license=viewergpl$ - * - * Copyright (c) 2010, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2010&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #ifndef LLAVATARNAME_H -- cgit v1.2.3 From ec57776a23f36a9df02ee614c4f0ef20fcea0c7c Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 15 Sep 2010 15:40:29 -0700 Subject: Add role action to allow hosting of events on group land --- indra/llcommon/roles_constants.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/roles_constants.h b/indra/llcommon/roles_constants.h index 70bca821c7..effd15ea72 100644 --- a/indra/llcommon/roles_constants.h +++ b/indra/llcommon/roles_constants.h @@ -52,7 +52,6 @@ enum LLRoleChangeType // // KNOWN HOLES: use these for any single bit powers you need -// bit 0x1 << 41 // bit 0x1 << 46 // bit 0x1 << 49 and above @@ -103,6 +102,8 @@ const U64 GP_LAND_ALLOW_FLY = 0x1 << 24; // Bypass Fly Restriction const U64 GP_LAND_ALLOW_CREATE = 0x1 << 25; // Bypass Create/Edit Objects Restriction const U64 GP_LAND_ALLOW_LANDMARK = 0x1 << 26; // Bypass Landmark Restriction const U64 GP_LAND_ALLOW_SET_HOME = 0x1 << 28; // Bypass Set Home Point Restriction +const U64 GP_LAND_ALLOW_HOLD_EVENT = 0x1LL << 41; // Allowed to hold events on group-owned land + // Parcel Access const U64 GP_LAND_MANAGE_ALLOWED = 0x1 << 29; // Manage Allowed List -- cgit v1.2.3 From 5ee546eb4e446632c32e62a5234241fd6498f281 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 14 Oct 2010 17:01:39 -0600 Subject: for SH-335: create a debug tool to track of memory availability. --- indra/llcommon/llsys.cpp | 19 +++++++++++++++++++ indra/llcommon/llsys.h | 3 +++ 2 files changed, 22 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 00c94404d4..7a82a17d0b 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -635,6 +635,25 @@ U32 LLMemoryInfo::getPhysicalMemoryClamped() const } } +void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) const +{ +#if LL_WINDOWS + MEMORYSTATUSEX state; + state.dwLength = sizeof(state); + GlobalMemoryStatusEx(&state); + + avail_physical_mem_kb = (U32)(state.ullAvailPhys/1024) ; + avail_virtual_mem_kb = (U32)(state.ullAvailVirtual/1024) ; + +#else + //do not know how to collect available memory info for other systems. + //leave it blank here for now. + + avail_physical_mem_kb = -1 ; + avail_virtual_mem_kb = -1 ; +#endif +} + void LLMemoryInfo::stream(std::ostream& s) const { #if LL_WINDOWS diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 39af74e5c8..35425f38ed 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -114,6 +114,9 @@ public: ** be returned. */ U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes + + //get the available memory infomation in KiloBytes. + void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) const; }; -- cgit v1.2.3 From 219cd6ecda60e1c48852f582f0994573fd0e10ae Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 14 Oct 2010 21:23:23 -0600 Subject: more debug code for SH-207: viewer crash in LLVertexBuffer::mapBuffer. --- indra/llcommon/llsys.cpp | 3 ++- indra/llcommon/llsys.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 7a82a17d0b..10cdc7087b 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -635,7 +635,8 @@ U32 LLMemoryInfo::getPhysicalMemoryClamped() const } } -void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) const +//static +void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) { #if LL_WINDOWS MEMORYSTATUSEX state; diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 35425f38ed..41a4f25000 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -116,7 +116,7 @@ public: U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes //get the available memory infomation in KiloBytes. - void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) const; + static void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb); }; -- cgit v1.2.3 From 730a7d7f5c7be6f589a17f13baf1b77a4bb4bdde Mon Sep 17 00:00:00 2001 From: Dessie Linden Date: Tue, 19 Oct 2010 13:50:27 -0700 Subject: Bumped viewer version to 2.3.0 --- indra/llcommon/llversionviewer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index bd65ce8573..12bddbfeed 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -28,8 +28,8 @@ #define LL_LLVERSIONVIEWER_H const S32 LL_VERSION_MAJOR = 2; -const S32 LL_VERSION_MINOR = 2; -const S32 LL_VERSION_PATCH = 1; +const S32 LL_VERSION_MINOR = 3; +const S32 LL_VERSION_PATCH = 0; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; -- cgit v1.2.3 From cbb184d986cbdd09d36cf2b2313726f0f2582cb2 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 20 Oct 2010 12:48:09 -0400 Subject: bump Development version to 2.4 --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 12bddbfeed..9391aed8a1 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -28,7 +28,7 @@ #define LL_LLVERSIONVIEWER_H const S32 LL_VERSION_MAJOR = 2; -const S32 LL_VERSION_MINOR = 3; +const S32 LL_VERSION_MINOR = 4; const S32 LL_VERSION_PATCH = 0; const S32 LL_VERSION_BUILD = 0; -- cgit v1.2.3 From 243210e0ab0bc1454bcbb3a5325fec199737a7c3 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 20 Oct 2010 20:26:47 +0300 Subject: STORM-419 FIXED ' is used uninitialized in this function in lldarray.h Author: Robin Cornelius Ported by: Techwolf Lupindo Reviewed by: Merov Linden --- indra/llcommon/lldarray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lldarray.h b/indra/llcommon/lldarray.h index a8cd03b42a..131b819c99 100644 --- a/indra/llcommon/lldarray.h +++ b/indra/llcommon/lldarray.h @@ -51,7 +51,7 @@ public: LLDynamicArray(S32 size=0) : std::vector(size) { if (size < BlockSize) std::vector::reserve(BlockSize); } - void reset() { std::vector::resize(0); } + void reset() { std::vector::clear(); } // ACCESSORS const Type& get(S32 index) const { return std::vector::operator[](index); } -- cgit v1.2.3 From b3f3fb60999033a7a100102d563e66eaaa876fa3 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 20 Oct 2010 21:23:27 +0300 Subject: STORM-417 FIXED Port of SNOW-140 to SG 2.0 : Forced updates not working on Mac The point of this patch is to make the Mac updater code a bit more flexible and reliable than it is right now. The issue is double: * reliability: the string comparison code on the bundle identifier is not UTF8 compliant * flexibility: the bundle identifier is hard coded to match the bundle identifier of LL viewer (i.e. com.secondlife.indra.viewer) so it can't work for another viewer (in particular, it didn't work for Snowglobe). The "bundle identifier" is one of those Mac only thing stored in the Info.plist of a "bundle" (the ".app" folder that's bundling an executable and all its resources and is seen as an application when browsing with the Mac OS X Finder). The patch fixes both issues: * compare correctly UTF8 encoded strings * allow the bundle ID to be passed as a parameter to the updater The patch has really no consequence on LL viewer. It's more a matter of having cleaner, better code. Author: Cypren Christenson Ported and reviewed by: Merov Linden --- indra/llcommon/llversionviewer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 9391aed8a1..b209e4aa38 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -34,4 +34,8 @@ const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; +#if LL_DARWIN +const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.snowglobe.viewer"; +#endif + #endif -- cgit v1.2.3 From 434109c54e8b941d644fb0c63c2693681c17b2c9 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 1 Nov 2010 12:29:09 -0500 Subject: Remove assert from lldictionary that keeps devs from working with mesh viewer and release viewer. --- indra/llcommon/lldictionary.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 552a805b70..bc3bc3e74a 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -78,7 +78,9 @@ protected: virtual Index notFound() const { // default is to assert - llassert(false); + // don't assert -- makes it impossible to work on mesh-development and viewer-development simultaneously + // -- davep 2010.10.29 + //llassert(false); return Index(-1); } void addEntry(Index index, Entry *entry) -- cgit v1.2.3 From 5d7417b40ed8717b3f307ed9e53c249a3a26cf1b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 2 Nov 2010 20:26:38 +0200 Subject: STORM-422 FIXED Added command line option "-disablecrashlogger" to disable crash logger. This is a patch originally written by Robin Cornelius. I made it work with Google Breakpad. --- indra/llcommon/llapp.cpp | 32 ++++++++++++++++++++++++++++++++ indra/llcommon/llapp.h | 6 ++++++ 2 files changed, 38 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index eebd5ed0a6..39daefd1ad 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -90,6 +90,10 @@ S32 LL_HEARTBEAT_SIGNAL = (SIGRTMAX >= 0) ? (SIGRTMAX-0) : SIGUSR2; // the static application instance LLApp* LLApp::sApplication = NULL; +// Allows the generation of core files for post mortem under gdb +// and disables crashlogger +BOOL LLApp::sDisableCrashlogger = FALSE; + // Local flag for whether or not to do logging in signal handlers. //static BOOL LLApp::sLogInSignal = FALSE; @@ -461,11 +465,30 @@ bool LLApp::isQuitting() return (APP_STATUS_QUITTING == sStatus); } +// static bool LLApp::isExiting() { return isQuitting() || isError(); } +void LLApp::disableCrashlogger() +{ + // Disable Breakpad exception handler. + if (mExceptionHandler != 0) + { + delete mExceptionHandler; + mExceptionHandler = 0; + } + + sDisableCrashlogger = TRUE; +} + +// static +bool LLApp::isCrashloggerDisabled() +{ + return (sDisableCrashlogger == TRUE); +} + #if !LL_WINDOWS // static U32 LLApp::getSigChildCount() @@ -799,6 +822,15 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) { llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl; } + + if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem + { + clear_signals(); + llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl; + raise(signum); + return; + } + // Flag status to ERROR, so thread_error does its work. LLApp::setError(); // Block in the signal handler until somebody says that we're done. diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index ee1d696829..a536a06ea5 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -189,6 +189,11 @@ public: // virtual bool mainLoop() = 0; // Override for the application main loop. Needs to at least gracefully notice the QUITTING state and exit. + // + // Crash logging + // + void disableCrashlogger(); // Let the OS handle the crashes + static bool isCrashloggerDisabled(); // Get the here above set value // // Application status @@ -280,6 +285,7 @@ protected: static void setStatus(EAppStatus status); // Use this to change the application status. static EAppStatus sStatus; // Reflects current application status static BOOL sErrorThreadRunning; // Set while the error thread is running + static BOOL sDisableCrashlogger; // Let the OS handle crashes for us. #if !LL_WINDOWS static LLAtomicU32* sSigChildCount; // Number of SIGCHLDs received. -- cgit v1.2.3