diff options
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index c12b8d6..c8e1e83 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -82,6 +82,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
82 | 82 | ||
83 | private Dictionary<UUID,PollServiceTextureEventArgs> m_pollservices = new Dictionary<UUID,PollServiceTextureEventArgs>(); | 83 | private Dictionary<UUID,PollServiceTextureEventArgs> m_pollservices = new Dictionary<UUID,PollServiceTextureEventArgs>(); |
84 | 84 | ||
85 | private string m_URL; | ||
86 | |||
85 | #region ISharedRegionModule Members | 87 | #region ISharedRegionModule Members |
86 | 88 | ||
87 | public void Initialise(IConfigSource source) | 89 | public void Initialise(IConfigSource source) |
@@ -343,13 +345,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
343 | 345 | ||
344 | private void RegisterCaps(UUID agentID, Caps caps) | 346 | private void RegisterCaps(UUID agentID, Caps caps) |
345 | { | 347 | { |
346 | string capUrl = "/CAPS/" + UUID.Random() + "/"; | 348 | m_URL = "/CAPS/" + UUID.Random() + "/"; |
347 | 349 | ||
348 | // Register this as a poll service | 350 | // Register this as a poll service |
349 | PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); | 351 | PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); |
350 | 352 | ||
351 | args.Type = PollServiceEventArgs.EventType.Texture; | 353 | args.Type = PollServiceEventArgs.EventType.Texture; |
352 | MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); | 354 | MainServer.Instance.AddPollServiceHTTPHandler(m_URL, args); |
353 | 355 | ||
354 | string hostName = m_scene.RegionInfo.ExternalHostName; | 356 | string hostName = m_scene.RegionInfo.ExternalHostName; |
355 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | 357 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; |
@@ -361,20 +363,23 @@ namespace OpenSim.Region.ClientStack.Linden | |||
361 | port = MainServer.Instance.SSLPort; | 363 | port = MainServer.Instance.SSLPort; |
362 | protocol = "https"; | 364 | protocol = "https"; |
363 | } | 365 | } |
364 | caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); | 366 | |
367 | IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); | ||
368 | if (handler != null) | ||
369 | handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", m_URL); | ||
370 | else | ||
371 | caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, m_URL)); | ||
365 | m_pollservices[agentID] = args; | 372 | m_pollservices[agentID] = args; |
366 | m_capsDict[agentID] = capUrl; | 373 | m_capsDict[agentID] = m_URL; |
367 | } | 374 | } |
368 | 375 | ||
369 | private void DeregisterCaps(UUID agentID, Caps caps) | 376 | private void DeregisterCaps(UUID agentID, Caps caps) |
370 | { | 377 | { |
371 | string capUrl; | ||
372 | PollServiceTextureEventArgs args; | 378 | PollServiceTextureEventArgs args; |
373 | if (m_capsDict.TryGetValue(agentID, out capUrl)) | 379 | |
374 | { | 380 | MainServer.Instance.RemoveHTTPHandler("", m_URL); |
375 | MainServer.Instance.RemoveHTTPHandler("", capUrl); | 381 | m_capsDict.Remove(agentID); |
376 | m_capsDict.Remove(agentID); | 382 | |
377 | } | ||
378 | if (m_pollservices.TryGetValue(agentID, out args)) | 383 | if (m_pollservices.TryGetValue(agentID, out args)) |
379 | { | 384 | { |
380 | m_pollservices.Remove(agentID); | 385 | m_pollservices.Remove(agentID); |