diff options
author | Mic Bowman | 2013-09-11 12:15:16 -0700 |
---|---|---|
committer | Mic Bowman | 2013-09-11 12:15:16 -0700 |
commit | b29e9d37e7705e461f71a3a599d95ad79b57e18a (patch) | |
tree | a4078fd49ce0a182b6587cebcea9fc5f8ec219b1 | |
parent | BulletSim: update DLLs and SOs with ClearCollisionCache inteface calls (diff) | |
download | opensim-SC_OLD-b29e9d37e7705e461f71a3a599d95ad79b57e18a.zip opensim-SC_OLD-b29e9d37e7705e461f71a3a599d95ad79b57e18a.tar.gz opensim-SC_OLD-b29e9d37e7705e461f71a3a599d95ad79b57e18a.tar.bz2 opensim-SC_OLD-b29e9d37e7705e461f71a3a599d95ad79b57e18a.tar.xz |
Change handling of the FetchInventoryDescendents2 capability configuration to allow
for external handlers.
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 164adeb..340d2e7 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
63 | public List<UUID> folders; | 63 | public List<UUID> folders; |
64 | } | 64 | } |
65 | 65 | ||
66 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 66 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
67 | 67 | ||
68 | private Scene m_scene; | 68 | private Scene m_scene; |
69 | 69 | ||
@@ -115,7 +115,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
115 | m_scene.EventManager.OnRegisterCaps -= RegisterCaps; | 115 | m_scene.EventManager.OnRegisterCaps -= RegisterCaps; |
116 | 116 | ||
117 | foreach (Thread t in m_workerThreads) | 117 | foreach (Thread t in m_workerThreads) |
118 | Watchdog.AbortThread(t.ManagedThreadId); | 118 | Watchdog.AbortThread(t.ManagedThreadId); |
119 | 119 | ||
120 | m_scene = null; | 120 | m_scene = null; |
121 | } | 121 | } |
@@ -296,36 +296,49 @@ namespace OpenSim.Region.ClientStack.Linden | |||
296 | requestinfo.request["body"].ToString(), String.Empty, String.Empty, null, null); | 296 | requestinfo.request["body"].ToString(), String.Empty, String.Empty, null, null); |
297 | 297 | ||
298 | lock (responses) | 298 | lock (responses) |
299 | responses[requestID] = response; | 299 | responses[requestID] = response; |
300 | } | 300 | } |
301 | } | 301 | } |
302 | 302 | ||
303 | private void RegisterCaps(UUID agentID, Caps caps) | 303 | private void RegisterCaps(UUID agentID, Caps caps) |
304 | { | 304 | { |
305 | if (m_fetchInventoryDescendents2Url == "") | 305 | RegisterFetchDescendentsCap(agentID, caps, "FetchInventoryDescendents2", m_fetchInventoryDescendents2Url); |
306 | } | ||
307 | |||
308 | private void RegisterFetchDescendentsCap(UUID agentID, Caps caps, string capName, string url) | ||
309 | { | ||
310 | string capUrl; | ||
311 | |||
312 | // disable the cap clause | ||
313 | if (url == "") | ||
314 | { | ||
306 | return; | 315 | return; |
316 | } | ||
317 | // handled by the simulator | ||
318 | else if (url == "localhost") | ||
319 | { | ||
320 | capUrl = "/CAPS/" + UUID.Random() + "/"; | ||
307 | 321 | ||
308 | // Register this as a poll service | 322 | // Register this as a poll service |
309 | PollServiceInventoryEventArgs args | 323 | PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(m_scene, capUrl, agentID); |
310 | = new PollServiceInventoryEventArgs(m_scene, "/CAPS/" + UUID.Random() + "/", agentID); | 324 | args.Type = PollServiceEventArgs.EventType.Inventory; |
311 | args.Type = PollServiceEventArgs.EventType.Inventory; | ||
312 | 325 | ||
313 | caps.RegisterPollHandler("FetchInventoryDescendents2", args); | 326 | caps.RegisterPollHandler(capName, args); |
327 | } | ||
328 | // external handler | ||
329 | else | ||
330 | { | ||
331 | capUrl = url; | ||
332 | IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); | ||
333 | if (handler != null) | ||
334 | handler.RegisterExternalUserCapsHandler(agentID,caps,capName,capUrl); | ||
335 | else | ||
336 | caps.RegisterHandler(capName, capUrl); | ||
337 | } | ||
314 | 338 | ||
315 | // MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); | 339 | // m_log.DebugFormat( |
316 | // | 340 | // "[FETCH INVENTORY DESCENDENTS2 MODULE]: Registered capability {0} at {1} in region {2} for {3}", |
317 | // string hostName = m_scene.RegionInfo.ExternalHostName; | 341 | // capName, capUrl, m_scene.RegionInfo.RegionName, agentID); |
318 | // uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | ||
319 | // string protocol = "http"; | ||
320 | // | ||
321 | // if (MainServer.Instance.UseSSL) | ||
322 | // { | ||
323 | // hostName = MainServer.Instance.SSLCommonName; | ||
324 | // port = MainServer.Instance.SSLPort; | ||
325 | // protocol = "https"; | ||
326 | // } | ||
327 | // | ||
328 | // caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); | ||
329 | } | 342 | } |
330 | 343 | ||
331 | // private void DeregisterCaps(UUID agentID, Caps caps) | 344 | // private void DeregisterCaps(UUID agentID, Caps caps) |