private IDataReader GetForeignInventory(UUID AgentID, UUID folder_id, string serverURL)
        {
            FakeDataReader        d             = new FakeDataReader();
            IConfigurationService configService = m_registry.RequestModuleInterface <IConfigurationService>();

            if (serverURL == "" && configService != null)
            {
                List <string> urls = configService.FindValueOf("InventoryServerURI");
                if (urls.Count > 0)
                {
                    serverURL = urls[0];
                }
                else
                {
                    return(null);
                }
            }
            XInventoryServicesConnector xinv = new XInventoryServicesConnector(serverURL + "xinventory");
            InventoryCollection         c    = xinv.GetFolderContent(AgentID, folder_id);

            if (c != null)
            {
                foreach (InventoryItemBase item in c.Items)
                {
                    d.items.Add(item);
                }
            }
            return(d);
        }
Esempio n. 2
0
        public override List <InventoryItemBase> GetItems(UUID avatarID, string[] fields, string[] vals)
        {
            IUserFinder userFinder = m_registry.RequestModuleInterface <IUserFinder>();

            if (userFinder != null && !userFinder.IsLocalGridUser(avatarID))
            {
                string serverURL = userFinder.GetUserServerURL(avatarID, "InventoryServerURI") + "xinventory";
                UUID   id        = UUID.Parse(vals[0]);
                XInventoryServicesConnector xinv = new XInventoryServicesConnector(serverURL);
                if (fields[0] == "parentFolderID")
                {
                    return(xinv.GetFolderContent(avatarID, id).Items);
                }
                else
                {
                    return(new List <InventoryItemBase> {
                        xinv.GetItem(new InventoryItemBase(id))
                    });
                }
            }
            return(base.GetItems(avatarID, fields, vals));
        }