Skip to content
Snippets Groups Projects
Commit d38727e4 authored by James Cook's avatar James Cook
Browse files

DEV-47529 Viewer refresh name lookup cap URL on region cross/teleport

Reviewed with Kelly
parent fec93382
No related branches found
No related tags found
No related merge requests found
...@@ -3541,9 +3541,10 @@ void LLAppViewer::idle() ...@@ -3541,9 +3541,10 @@ void LLAppViewer::idle()
// NOTE: Starting at this point, we may still have pointers to "dead" objects // NOTE: Starting at this point, we may still have pointers to "dead" objects
// floating throughout the various object lists. // floating throughout the various object lists.
// //
idleNameCache();
idleNetwork(); idleNetwork();
// Check for away from keyboard, kick idle agents. // Check for away from keyboard, kick idle agents.
idle_afk_check(); idle_afk_check();
...@@ -3878,6 +3879,41 @@ void LLAppViewer::sendLogoutRequest() ...@@ -3878,6 +3879,41 @@ void LLAppViewer::sendLogoutRequest()
} }
} }
void LLAppViewer::idleNameCache()
{
// Neither old nor new name cache can function before agent has a region
LLViewerRegion* region = gAgent.getRegion();
if (!region) return;
// deal with any queued name requests and replies.
gCacheName->processPending();
// 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
// do it in the move-into-region code because cap not guaranteed to be
// granted yet, for example on teleport.
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 += '/';
}
LLAvatarNameCache::setNameLookupURL(name_lookup_url);
}
LLAvatarNameCache::idle();
}
// //
// Handle messages, and all message related stuff // Handle messages, and all message related stuff
// //
...@@ -3905,10 +3941,6 @@ void LLAppViewer::idleNetwork() ...@@ -3905,10 +3941,6 @@ void LLAppViewer::idleNetwork()
{ {
LLFastTimer t(FTM_IDLE_NETWORK); // decode LLFastTimer t(FTM_IDLE_NETWORK); // decode
// deal with any queued name requests and replies.
gCacheName->processPending();
LLAvatarNameCache::idle();
llpushcallstacks ; llpushcallstacks ;
LLTimer check_message_timer; LLTimer check_message_timer;
// Read all available packets from network // Read all available packets from network
......
...@@ -210,6 +210,8 @@ class LLAppViewer : public LLApp ...@@ -210,6 +210,8 @@ class LLAppViewer : public LLApp
void idle(); void idle();
void idleShutdown(); void idleShutdown();
// update avatar SLID and display name caches
void idleNameCache();
void idleNetwork(); void idleNetwork();
void sendLogoutRequest(); void sendLogoutRequest();
......
...@@ -175,24 +175,6 @@ class BaseCapabilitiesComplete : public LLHTTPClient::Responder ...@@ -175,24 +175,6 @@ class BaseCapabilitiesComplete : public LLHTTPClient::Responder
mRegion->showReleaseNotes(); mRegion->showReleaseNotes();
} }
} }
// JAMESDEBUG *TODO* THIS IS WRONG!!!!!!!!!!!!!!!!!!!!!
// this isn't necessarily the region the viewer is in
// Avatar name lookup library needs to know who to ask
std::string name_lookup_url = mRegion->getCapability("GetDisplayNames");
// capabilities require URLs with slashes before query params, like:
// https://<host>:<port>/cap/<uuid>/?ids=<blah>
// but the caps are granted like:
// https://<host>:<port>/cap/<uuid>
U32 url_size = name_lookup_url.size();
if (url_size > 0 && name_lookup_url[url_size-1] != '/')
{
name_lookup_url += '/';
}
LLAvatarNameCache::setNameLookupURL(name_lookup_url);
llinfos << "JAMESDEBUG cap " << name_lookup_url << llendl;
if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment