예제 #1
0
        public override OSDArray GetLLSDItems(string[] fields, string[] vals)
        {
            string query = "";

            for (int i = 0; i < fields.Length; i++)
            {
                query += String.Format("where {0} = '{1}' and ", fields[i], vals[i]);
                i++;
            }
            query = query.Remove(query.Length - 5);
            if (fields[0] == "inventoryID")
            {
                IInventoryService invService = m_registry.RequestModuleInterface <IInventoryService>();
                if (invService != null)
                {
                    UUID inventoryID           = UUID.Parse(vals[0]);
                    InventoryItemBase baseItem = new InventoryItemBase(UUID.Parse(vals[0]));
                    if (vals.Count() > 1)
                    {
                        UUID        avatarID   = UUID.Parse(vals[1]);
                        IUserFinder userFinder = m_registry.RequestModuleInterface <IUserFinder>();
                        if (userFinder != null && !userFinder.IsLocalGridUser(avatarID))
                        {
                            string serverURL = userFinder.GetUserServerURL(avatarID, "InventoryServerURI") + "xinventory";
                            XInventoryServicesConnector xinv = new XInventoryServicesConnector(serverURL);
                            return(BuildLLSDInventoryItems(xinv.GetItem(baseItem)));
                        }
                    }
                    return(BuildLLSDInventoryItems(invService.GetItem(baseItem)));
                }
            }

            return(null);
        }
예제 #2
0
        public override List <string> GetAgentsLocations(string requestor, List <string> userIDs)
        {
            List <string> locations = new List <string> ();

            foreach (string userID in userIDs)
            {
                List <string> l = base.GetAgentsLocations(requestor, new List <string>()
                {
                    userID
                });
                if (l[0] == "NotOnline")
                {
                    UserAccount acc = m_registry.RequestModuleInterface <IUserAccountService> ().GetUserAccount(null, UUID.Parse(userID));
                    if (acc == null)
                    {
                        IUserFinder userFinder = m_registry.RequestModuleInterface <IUserFinder> ();
                        string      url        = "";
                        if (userFinder != null && (url = userFinder.GetUserServerURL(UUID.Parse(userID), GetHandlers.Helpers_IMServerURI)) != "")
                        {
                            l[0] = url;
                        }
                    }
                }
                locations.Add(l[0]);
            }
            return(locations);
        }
예제 #3
0
        private bool GetUserProfileData(UUID userID, out Dictionary <string, object> userInfo)
        {
            IUserFinder uManage = m_registry.RequestModuleInterface <IUserFinder>();

            userInfo = new Dictionary <string, object>();

            if (!uManage.IsLocalGridUser(userID))
            {
                // Is Foreign
                string home_url = uManage.GetUserServerURL(userID, "HomeURI");

                if (String.IsNullOrEmpty(home_url))
                {
                    userInfo["user_flags"]   = 0;
                    userInfo["user_created"] = 0;
                    userInfo["user_title"]   = "Unavailable";

                    return(true);
                }

                UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url);

                Dictionary <string, object> account = uConn.GetUserInfo(userID);

                if (account.Count > 0)
                {
                    if (account.ContainsKey("user_flags"))
                    {
                        userInfo["user_flags"] = account["user_flags"];
                    }
                    else
                    {
                        userInfo["user_flags"] = "";
                    }

                    if (account.ContainsKey("user_created"))
                    {
                        userInfo["user_created"] = account["user_created"];
                    }
                    else
                    {
                        userInfo["user_created"] = "";
                    }

                    userInfo["user_title"] = "HG Visitor";
                }
                else
                {
                    userInfo["user_flags"]   = 0;
                    userInfo["user_created"] = 0;
                    userInfo["user_title"]   = "HG Visitor";
                }
                return(true);
            }
            return(false);
        }
예제 #4
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));
        }