* Put in crude poll waiting for 60 seconds for delayed user inventory delivery from the inventory service

* This will reduce failures where the inventory server is simply slow
* Still need to properly inform the user if the inventory service has failed altogether
0.6.0-stable
Justin Clarke Casey 2008-04-13 22:09:07 +00:00
parent 08d20ea0b7
commit 451a5bbf30
1 changed files with 27 additions and 2 deletions

View File

@ -360,6 +360,31 @@ namespace OpenSim.Framework.Communications.Cache
CachedUserInfo userProfile; CachedUserInfo userProfile;
if (m_userProfiles.TryGetValue(agentID, out userProfile)) if (m_userProfiles.TryGetValue(agentID, out userProfile))
{ {
// XXX: When a client crosses into a scene, their entire inventory is fetched
// asynchronously. If the client makes a request before the inventory is received, we need
// to give the inventory a chance to come in.
//
// This is a crude way of dealing with that by retrying the lookup. It's not quite as bad
// in CAPS as doing this with the udp request, since here it won't hold up other packets.
// In fact, here we'll be generous and try for longer.
if (!userProfile.HasInventory)
{
int attempts = 0;
while (attempts++ < 20)
{
m_log.DebugFormat(
"[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}",
attempts, folderID, agentID);
Thread.Sleep(3000);
if (userProfile.HasInventory)
{
break;
}
}
}
if (userProfile.HasInventory) if (userProfile.HasInventory)
{ {
if (userProfile.RootFolder.ID == folderID) if (userProfile.RootFolder.ID == folderID)