aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs100
1 files changed, 54 insertions, 46 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e036a3a..7948a6f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1649,53 +1649,11 @@ namespace OpenSim.Region.Environment.Scenes
1649 { 1649 {
1650 if (regionHandle == m_regInfo.RegionHandle) 1650 if (regionHandle == m_regInfo.RegionHandle)
1651 { 1651 {
1652 if (agent.CapsPath != String.Empty) 1652 capsPaths[agent.AgentID] = agent.CapsPath;
1653 {
1654 m_log.DebugFormat(
1655 "[CONNECTION DEBUGGING]: Setting up CAPS handler for avatar {0} at {1} in {2}",
1656 agent.AgentID, agent.CapsPath, RegionInfo.RegionName);
1657 1653
1658 Caps cap = 1654 if (!agent.child)
1659 new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port, 1655 {
1660 agent.CapsPath, agent.AgentID, m_dumpAssetsToFile); 1656 AddCapsHandler(agent.AgentID);
1661
1662 Util.SetCapsURL(agent.AgentID,
1663 "http://" + m_regInfo.ExternalHostName + ":" + m_httpListener.Port.ToString() +
1664 "/CAPS/" + agent.CapsPath + "0000/");
1665 cap.RegisterHandlers();
1666 if (agent.child)
1667 {
1668
1669 }
1670 cap.AddNewInventoryItem = AddInventoryItem;
1671 cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
1672 cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
1673 cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;
1674
1675 if (m_capsHandlers.ContainsKey(agent.AgentID))
1676 {
1677 m_log.DebugFormat(
1678 "[CONNECTION DEBUGGING]: Caps path already in use for avatar {0} in region {1}",
1679 agent.AgentID, RegionInfo.RegionName);
1680
1681 try
1682 {
1683 m_capsHandlers[agent.AgentID] = cap;
1684 }
1685 catch (KeyNotFoundException)
1686 {
1687 m_log.DebugFormat(
1688 "[CONNECTION DEBUGGING]: Caught exception adding handler for avatar {0} at {1}",
1689 agent.AgentID, RegionInfo.RegionName);
1690
1691 // Fix for a potential race condition.
1692 m_capsHandlers.Add(agent.AgentID, cap);
1693 }
1694 }
1695 else
1696 {
1697 m_capsHandlers.Add(agent.AgentID, cap);
1698 }
1699 } 1657 }
1700 else 1658 else
1701 { 1659 {
@@ -1716,6 +1674,56 @@ namespace OpenSim.Region.Environment.Scenes
1716 "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}", 1674 "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}",
1717 agent.AgentID, regionHandle, RegionInfo.RegionName); 1675 agent.AgentID, regionHandle, RegionInfo.RegionName);
1718 } 1676 }
1677 }
1678
1679 /// <summary>
1680 /// Add a caps handler for the given agent.
1681 /// </summary>
1682 /// <param name="agentId"></param>
1683 /// <param name="capsObjectPath"></param>
1684 public void AddCapsHandler(LLUUID agentId)
1685 {
1686 String capsObjectPath = GetCapsPath(agentId);
1687
1688 m_log.DebugFormat(
1689 "[CONNECTION DEBUGGING]: Setting up CAPS handler for avatar {0} at {1} in {2}",
1690 agentId, capsObjectPath, RegionInfo.RegionName);
1691
1692 Caps cap =
1693 new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port,
1694 capsObjectPath, agentId, m_dumpAssetsToFile);
1695
1696 cap.RegisterHandlers();
1697
1698 cap.AddNewInventoryItem = AddInventoryItem;
1699 cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
1700 cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
1701 cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;
1702
1703 if (m_capsHandlers.ContainsKey(agentId))
1704 {
1705 m_log.DebugFormat(
1706 "[CONNECTION DEBUGGING]: Caps path already in use for avatar {0} in region {1}",
1707 agentId, RegionInfo.RegionName);
1708
1709 try
1710 {
1711 m_capsHandlers[agentId] = cap;
1712 }
1713 catch (KeyNotFoundException)
1714 {
1715 m_log.DebugFormat(
1716 "[CONNECTION DEBUGGING]: Caught exception adding handler for avatar {0} at {1}",
1717 agentId, RegionInfo.RegionName);
1718
1719 // Fix for a potential race condition.
1720 m_capsHandlers.Add(agentId, cap);
1721 }
1722 }
1723 else
1724 {
1725 m_capsHandlers.Add(agentId, cap);
1726 }
1719 } 1727 }
1720 1728
1721 /// <summary> 1729 /// <summary>