Change handling of the FetchInventoryDescendents2 capability configuration to allow
for external handlers.0.7.6-extended
							parent
							
								
									712bee7206
								
							
						
					
					
						commit
						1217785155
					
				|  | @ -63,7 +63,7 @@ namespace OpenSim.Region.ClientStack.Linden | ||||||
|             public List<UUID> folders; |             public List<UUID> folders; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| //        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |         // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||||||
| 
 | 
 | ||||||
|         private Scene m_scene; |         private Scene m_scene; | ||||||
| 
 | 
 | ||||||
|  | @ -302,30 +302,43 @@ namespace OpenSim.Region.ClientStack.Linden | ||||||
| 
 | 
 | ||||||
|         private void RegisterCaps(UUID agentID, Caps caps) |         private void RegisterCaps(UUID agentID, Caps caps) | ||||||
|         { |         { | ||||||
|             if (m_fetchInventoryDescendents2Url == "") |             RegisterFetchDescendentsCap(agentID, caps, "FetchInventoryDescendents2", m_fetchInventoryDescendents2Url); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         private void RegisterFetchDescendentsCap(UUID agentID, Caps caps, string capName, string url) | ||||||
|  |         { | ||||||
|  |             string capUrl; | ||||||
|  | 
 | ||||||
|  |             // disable the cap clause | ||||||
|  |             if (url == "") | ||||||
|  |             { | ||||||
|                 return; |                 return; | ||||||
|  |             } | ||||||
|  |             // handled by the simulator | ||||||
|  |             else if (url == "localhost") | ||||||
|  |             { | ||||||
|  |                 capUrl = "/CAPS/" + UUID.Random() + "/"; | ||||||
| 
 | 
 | ||||||
|             // Register this as a poll service           |                 // Register this as a poll service | ||||||
|             PollServiceInventoryEventArgs args  |                 PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(m_scene, capUrl, agentID); | ||||||
|                 = new PollServiceInventoryEventArgs(m_scene, "/CAPS/" + UUID.Random() + "/", agentID);             |                 args.Type = PollServiceEventArgs.EventType.Inventory; | ||||||
|             args.Type = PollServiceEventArgs.EventType.Inventory; |  | ||||||
| 
 | 
 | ||||||
|             caps.RegisterPollHandler("FetchInventoryDescendents2", args); |                 caps.RegisterPollHandler(capName, args); | ||||||
|  |             } | ||||||
|  |             // external handler | ||||||
|  |             else | ||||||
|  |             { | ||||||
|  |                 capUrl = url; | ||||||
|  |                 IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); | ||||||
|  |                 if (handler != null) | ||||||
|  |                     handler.RegisterExternalUserCapsHandler(agentID,caps,capName,capUrl); | ||||||
|  |                 else | ||||||
|  |                     caps.RegisterHandler(capName, capUrl); | ||||||
|  |             } | ||||||
| 
 | 
 | ||||||
| //            MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); |             // m_log.DebugFormat( | ||||||
| // |             //     "[FETCH INVENTORY DESCENDENTS2 MODULE]: Registered capability {0} at {1} in region {2} for {3}", | ||||||
| //            string hostName = m_scene.RegionInfo.ExternalHostName; |             //     capName, capUrl, m_scene.RegionInfo.RegionName, agentID); | ||||||
| //            uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; |  | ||||||
| //            string protocol = "http"; |  | ||||||
| //             |  | ||||||
| //            if (MainServer.Instance.UseSSL) |  | ||||||
| //            { |  | ||||||
| //                hostName = MainServer.Instance.SSLCommonName; |  | ||||||
| //                port = MainServer.Instance.SSLPort; |  | ||||||
| //                protocol = "https"; |  | ||||||
| //            } |  | ||||||
| // |  | ||||||
| //            caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| //        private void DeregisterCaps(UUID agentID, Caps caps) | //        private void DeregisterCaps(UUID agentID, Caps caps) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Mic Bowman
						Mic Bowman