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 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/llavatarname.cpp') 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(); } -- cgit v1.2.3