diff options
author | James Cook <james@lindenlab.com> | 2010-04-22 14:13:45 -0700 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-04-22 14:13:45 -0700 |
commit | 98f5fc5ff006a82cacde47de0cbb564b6e703597 (patch) | |
tree | 13866bdd70c585c500fbe5c99699c48770ca4519 /indra/newview/llappviewer.cpp | |
parent | 61d79980d888a7bbac96df9955582f835b169a97 (diff) |
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
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ac9672858d..e160951b91 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3906,6 +3906,11 @@ void LLAppViewer::idleNameCache() // deal with any queued name requests and replies. gCacheName->processPending(); + // Can't run the new cache until we have the list of capabilities + // for the agent region, and can therefore decide whether to use + // display names or fall back to the old name system. + if (!region->capabilitiesReceived()) return; + // Agent may have moved to a different region, so need to update cap URL // for name lookups. Can't do this in the cap grant code, as caps are // granted to neighbor regions before the main agent gets there. Can't @@ -3914,21 +3919,26 @@ void LLAppViewer::idleNameCache() std::string name_lookup_url; name_lookup_url.reserve(128); // avoid a memory allocation below name_lookup_url = region->getCapability("GetDisplayNames"); - - // Ensure capability has been granted - U32 url_size = name_lookup_url.size(); - if (url_size > 0) - { - // capabilities require URLs with slashes before query params: - // https://<host>:<port>/cap/<uuid>/?ids=<blah> - // but the caps are granted like: - // https://<host>:<port>/cap/<uuid> - if (name_lookup_url[url_size-1] != '/') - { - name_lookup_url += '/'; - } + if (!name_lookup_url.empty()) + { + // we have support for display names, use it + U32 url_size = name_lookup_url.size(); + // capabilities require URLs with slashes before query params: + // https://<host>:<port>/cap/<uuid>/?ids=<blah> + // but the caps are granted like: + // https://<host>:<port>/cap/<uuid> + if (url_size > 0 && name_lookup_url[url_size-1] != '/') + { + name_lookup_url += '/'; + } LLAvatarNameCache::setNameLookupURL(name_lookup_url); } + else + { + // Display names not available on this region + LLAvatarNameCache::setNameLookupURL( std::string() ); + } + LLAvatarNameCache::idle(); } |