aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
diff options
context:
space:
mode:
authorMelanie2013-06-08 00:00:39 +0100
committerMelanie2013-06-08 00:00:39 +0100
commitcf4d291443acd526a49c5bf60da81d7df661e53f (patch)
treeba6a2e76e9394d53010a356d8ccc94332ecddd14 /OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
parentMerge commit '75631e0267dbf58253dfcf6327b4d65f35bbaa6d' into careminster (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-cf4d291443acd526a49c5bf60da81d7df661e53f.zip
opensim-SC-cf4d291443acd526a49c5bf60da81d7df661e53f.tar.gz
opensim-SC-cf4d291443acd526a49c5bf60da81d7df661e53f.tar.bz2
opensim-SC-cf4d291443acd526a49c5bf60da81d7df661e53f.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 707cc93..6fb6497 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -71,6 +71,11 @@ namespace OpenSim.Region.ClientStack.Linden
71 private IInventoryService m_InventoryService; 71 private IInventoryService m_InventoryService;
72 private ILibraryService m_LibraryService; 72 private ILibraryService m_LibraryService;
73 73
74 private bool m_Enabled;
75
76 private string m_fetchInventoryDescendents2Url;
77 private string m_webFetchInventoryDescendentsUrl;
78
74 private static WebFetchInvDescHandler m_webFetchHandler; 79 private static WebFetchInvDescHandler m_webFetchHandler;
75 80
76 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); 81 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>();
@@ -83,15 +88,32 @@ namespace OpenSim.Region.ClientStack.Linden
83 88
84 public void Initialise(IConfigSource source) 89 public void Initialise(IConfigSource source)
85 { 90 {
91 IConfig config = source.Configs["ClientStack.LindenCaps"];
92 if (config == null)
93 return;
94
95 m_fetchInventoryDescendents2Url = config.GetString("Cap_FetchInventoryDescendents2", string.Empty);
96 m_webFetchInventoryDescendentsUrl = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty);
97
98 if (m_fetchInventoryDescendents2Url != string.Empty || m_webFetchInventoryDescendentsUrl != string.Empty)
99 {
100 m_Enabled = true;
101 }
86 } 102 }
87 103
88 public void AddRegion(Scene s) 104 public void AddRegion(Scene s)
89 { 105 {
106 if (!m_Enabled)
107 return;
108
90 m_scene = s; 109 m_scene = s;
91 } 110 }
92 111
93 public void RemoveRegion(Scene s) 112 public void RemoveRegion(Scene s)
94 { 113 {
114 if (!m_Enabled)
115 return;
116
95 m_scene.EventManager.OnRegisterCaps -= RegisterCaps; 117 m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
96 m_scene.EventManager.OnDeregisterCaps -= DeregisterCaps; 118 m_scene.EventManager.OnDeregisterCaps -= DeregisterCaps;
97 m_scene = null; 119 m_scene = null;
@@ -99,6 +121,9 @@ namespace OpenSim.Region.ClientStack.Linden
99 121
100 public void RegionLoaded(Scene s) 122 public void RegionLoaded(Scene s)
101 { 123 {
124 if (!m_Enabled)
125 return;
126
102 m_InventoryService = m_scene.InventoryService; 127 m_InventoryService = m_scene.InventoryService;
103 m_LibraryService = m_scene.LibraryService; 128 m_LibraryService = m_scene.LibraryService;
104 129
@@ -284,6 +309,9 @@ namespace OpenSim.Region.ClientStack.Linden
284 309
285 private void RegisterCaps(UUID agentID, Caps caps) 310 private void RegisterCaps(UUID agentID, Caps caps)
286 { 311 {
312 if (m_fetchInventoryDescendents2Url == "")
313 return;
314
287 string capUrl = "/CAPS/" + UUID.Random() + "/"; 315 string capUrl = "/CAPS/" + UUID.Random() + "/";
288 316
289 // Register this as a poll service 317 // Register this as a poll service
@@ -302,6 +330,7 @@ namespace OpenSim.Region.ClientStack.Linden
302 port = MainServer.Instance.SSLPort; 330 port = MainServer.Instance.SSLPort;
303 protocol = "https"; 331 protocol = "https";
304 } 332 }
333
305 caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); 334 caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
306 335
307 m_capsDict[agentID] = capUrl; 336 m_capsDict[agentID] = capUrl;