diff options
author | James Cook <james@lindenlab.com> | 2010-04-19 17:09:37 -0700 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-04-19 17:09:37 -0700 |
commit | d373dc8782e7085e313b3637c168c87c2b5a71ed (patch) | |
tree | 048c48a0507cc543fa5806cfa7b07df9d06873dc /indra | |
parent | 16aa2a2a0f29fa927455e616817eef2bedbbf7a7 (diff) |
Viewer asks login.cgi if the grid supports display names
If not, turns off display names. Cleaned up name cache reset code.
Alphabetized login auth param requests for easier merges going forward.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llmessage/llavatarnamecache.cpp | 13 | ||||
-rw-r--r-- | indra/llmessage/llavatarnamecache.h | 4 | ||||
-rw-r--r-- | indra/newview/lllogininstance.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 9 |
5 files changed, 53 insertions, 29 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 62c2df90a9..69770c1f2a 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -34,7 +34,6 @@ #include "llavatarnamecache.h" -#include "llcachename.h" // *TODO: remove #include "llframetimer.h" #include "llhttpclient.h" #include "llsd.h" @@ -379,15 +378,13 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot) } -void LLAvatarNameCache::toggleDisplayNames() +void LLAvatarNameCache::setUseDisplayNames(bool use) { - sUseDisplayNames = !sUseDisplayNames; - // flush our cache - sCache.clear(); - // force re-lookups - if (gCacheName) + if (use != sUseDisplayNames) { - gCacheName->clear(); + sUseDisplayNames = use; + // flush our cache + sCache.clear(); } } diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index 111e56433b..ad5ecc896e 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -69,8 +69,8 @@ namespace LLAvatarNameCache // If name information is in cache, callback will be called immediately. void get(const LLUUID& agent_id, callback_slot_t slot); - // HACK: turn display names on and off - void toggleDisplayNames(); + // Not all grids support display names + void setUseDisplayNames(bool use); bool useDisplayNames(); void erase(const LLUUID& agent_id); diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 24c72c65ce..475a3f5384 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -120,15 +120,33 @@ LLSD LLLoginInstance::getResponse() void LLLoginInstance::constructAuthParams(const LLSD& credentials) { + // *Note: this is where gUserAuth used to be created. + // Set up auth request options. -//#define LL_MINIMIAL_REQUESTED_OPTIONS LLSD requested_options; - // *Note: this is where gUserAuth used to be created. + requested_options.append("global-textures"); requested_options.append("inventory-root"); requested_options.append("inventory-skeleton"); //requested_options.append("inventory-meat"); //requested_options.append("inventory-skel-targets"); + requested_options.append("login-flags"); + +//#define LL_MINIMIAL_REQUESTED_OPTIONS #if (!defined LL_MINIMIAL_REQUESTED_OPTIONS) + // *NOTE: Keep alphabetized for easier merges + requested_options.append("adult_compliant"); + requested_options.append("buddy-list"); + requested_options.append("classified_categories"); + requested_options.append("display_names"); + requested_options.append("event_categories"); + requested_options.append("event_notifications"); + requested_options.append("gestures"); + if(gSavedSettings.getBOOL("ConnectAsGod")) + { + gSavedSettings.setBOOL("UseDebugMenus", TRUE); + requested_options.append("god-connect"); + } + requested_options.append("initial-outfit"); if(FALSE == gSavedSettings.getBOOL("NoInventoryLibrary")) { requested_options.append("inventory-lib-root"); @@ -136,25 +154,11 @@ void LLLoginInstance::constructAuthParams(const LLSD& credentials) requested_options.append("inventory-skel-lib"); // requested_options.append("inventory-meat-lib"); } - - requested_options.append("initial-outfit"); - requested_options.append("gestures"); - requested_options.append("event_categories"); - requested_options.append("event_notifications"); - requested_options.append("classified_categories"); - requested_options.append("adult_compliant"); //requested_options.append("inventory-targets"); - requested_options.append("buddy-list"); + requested_options.append("tutorial_setting"); requested_options.append("ui-config"); + // *NOTE: Keep alphabetized for easier merges #endif - requested_options.append("tutorial_setting"); - requested_options.append("login-flags"); - requested_options.append("global-textures"); - if(gSavedSettings.getBOOL("ConnectAsGod")) - { - gSavedSettings.setBOOL("UseDebugMenus", TRUE); - requested_options.append("god-connect"); - } char hashed_mac_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ LLMD5 hashed_mac; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 18792950eb..5fe091109f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1614,6 +1614,22 @@ bool idle_startup() LLClassifiedInfo::loadCategories(classified_categories); } + bool use_display_names = false; + LLSD display_names = response["display_names"]; + if (display_names.isDefined()) + { + for(LLSD::array_const_iterator it = display_names.beginArray(), + end = display_names.endArray(); it != end; ++it) + { + LLSD display_name_version = (*it)["version"]; + if (display_name_version.isDefined() + && display_name_version.asInteger() > 0) + { + use_display_names = true; + } + } + } + LLAvatarNameCache::setUseDisplayNames(use_display_names); // This method MUST be called before gInventory.findCategoryUUIDForType because of // gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a9e705b6ef..adf71878f5 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7592,6 +7592,13 @@ class LLWorldToggleCameraControls : public view_listener_t } }; +// IDEVO JAMESDEBUG temp code for testing +void toggle_display_names() +{ + bool use = LLAvatarNameCache::useDisplayNames(); + LLAvatarNameCache::setUseDisplayNames(!use); +} + void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y) { static LLMenuGL* show_navbar_context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_hide_navbar.xml", @@ -7757,7 +7764,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); // IDEVO - commit.add("IDEVO.ToggleDisplayNames", boost::bind(&LLAvatarNameCache::toggleDisplayNames)); + commit.add("IDEVO.ToggleDisplayNames", boost::bind(&toggle_display_names)); enable.add("IDEVO.CheckDisplayNames", boost::bind(&LLAvatarNameCache::useDisplayNames)); // Advanced > HUD Info |