* A tweak of the caps system so that new caps have random paths instead of a fixed path

* This allows caps requests to be routed to regions where the agent is currently a root agent instead of the region that they logged into as it did previously.   
* This fixes a wide variety of bugs related to 'can't do X once i've crossed a border'.
* The first seed cap request fails, the second one works.  (this generates an error message on the console)
* Experimental.
0.6.0-stable
Teravus Ovares 2008-04-15 23:10:12 +00:00
parent 3891b2f86f
commit e777f88028
4 changed files with 46 additions and 3 deletions

View File

@ -251,6 +251,11 @@ namespace OpenSim.Framework.Communications.Cache
ItemReceive(userID, itemInfo); ItemReceive(userID, itemInfo);
m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo);
} }
else
{
m_log.Error("[UNABLE TO UPLOAD]: ");
}
} }
/// <summary> /// <summary>
@ -264,6 +269,10 @@ namespace OpenSim.Framework.Communications.Cache
{ {
m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo);
} }
else
{
m_log.Error("[UNABLE TO UPDATE]: ");
}
} }
/// <summary> /// <summary>
@ -283,6 +292,10 @@ namespace OpenSim.Framework.Communications.Cache
m_commsManager.InventoryService.DeleteInventoryItem(userID, item); m_commsManager.InventoryService.DeleteInventoryItem(userID, item);
} }
} }
else
{
m_log.Error("[UNABLE TO DELETE]: ");
}
return result; return result;
} }

View File

@ -64,6 +64,7 @@ namespace OpenSim.Framework
ClientManager ClientManager { get; } ClientManager ClientManager { get; }
string GetCapsPath(LLUUID agentId); string GetCapsPath(LLUUID agentId);
string GetNewCapsPath(LLUUID agentId);
} }
} }

View File

@ -1867,8 +1867,25 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="agentId"></param> /// <param name="agentId"></param>
/// <param name="capsObjectPath"></param> /// <param name="capsObjectPath"></param>
public void AddCapsHandler(LLUUID agentId) public void AddCapsHandler(LLUUID agentId)
{ {
String capsObjectPath = GetCapsPath(agentId); // Here we clear out old Caps handlers for the agent
// this is required because we potentially have multiple simulators in an instance nearby.
Caps oldcap = null;
lock (m_capsHandlers)
{
if (m_capsHandlers.ContainsKey(agentId))
oldcap = m_capsHandlers[agentId];
}
if (oldcap != null)
{
oldcap.DeregisterHandlers();
}
// Generate a new base caps path LLUUID.Random().ToString() instead of agentId.ToString()
// If the caps paths are not different for each region, the client and sim will do weird
// things like send the request to a region the agent is no longer in.
String capsObjectPath = GetNewCapsPath(agentId);
m_log.DebugFormat( m_log.DebugFormat(
"[CAPS]: Setting up CAPS handler for root agent {0} in {1}", "[CAPS]: Setting up CAPS handler for root agent {0} in {1}",

View File

@ -214,5 +214,17 @@ namespace OpenSim.Region.Environment.Scenes
return null; return null;
} }
public string GetNewCapsPath(LLUUID agentID)
{
if (capsPaths.ContainsKey(agentID))
{
capsPaths[agentID] = LLUUID.Random().ToString();
}
else
{
capsPaths.Add(agentID, LLUUID.Random().ToString());
}
return GetCapsPath(agentID);
}
} }
} }