Ejemplo n.º 1
0
        public string RezAll(BotInventoryEval man, InventoryBase b, SimPosition dest)
        {
            string ret = "";
            var manager = man.Manager;
            if (b is InventoryItem)
            {
                InventoryItem item = b as InventoryItem;

                bool canCopy = (item.Permissions.OwnerMask & PermissionMask.Copy) == PermissionMask.Copy;

                ret += item.Name + nl;
                if (dest == null)
                {
                    Simulator sim = Client.Network.CurrentSim;
                    Client.Inventory.RequestRestoreRezFromInventory(sim, item, item.UUID);
                }
                else
                {
                    Simulator sim = SimRegion.GetRegion(dest.GlobalPosition).TheSimulator;
                    Client.Inventory.RequestRezFromInventory(sim, dest.SimRotation, dest.SimPosition, item, UUID.Zero);
                }
            }
            else if (b is InventoryFolder)
            {
                InventoryFolder folder = b as InventoryFolder;
                List<InventoryBase> folderContents = man.FolderContents(folder.UUID);
                if (folderContents != null)
                    foreach (InventoryBase list in folderContents)
                    {
                        ret += RezAll(man, list, dest);
                    }
            }
            return ret;
        }
Ejemplo n.º 2
0
        public string GiveAll(BotInventoryEval man, InventoryBase b, SimObject dest, bool moveInsteadOfCopy)
        {
            string ret     = "";
            var    manager = man.Manager;

            if (b is InventoryItem)
            {
                InventoryItem item = b as InventoryItem;

                bool canCopy = (item.Permissions.OwnerMask & PermissionMask.Copy) == PermissionMask.Copy;

                ret += item.Name + nl;
                if (dest.IsAvatar)
                {
                    manager.GiveItem(item.UUID, item.Name, item.AssetType, dest.ID, true);
                }
                else
                {
                    throw new NotImplementedException("giving items to objects");
                }
            }
            else if (b is InventoryFolder)
            {
                InventoryFolder item = b as InventoryFolder;
                if (dest.IsAvatar)
                {
                    manager.GiveFolder(item.UUID, item.Name, AssetType.Folder, dest.ID, true);
                    return(item.Name + nl);
                }
                InventoryFolder      folder         = b as InventoryFolder;
                List <InventoryBase> folderContents = man.FolderContents(folder.UUID);
                if (folderContents != null)
                {
                    foreach (InventoryBase list in folderContents)
                    {
                        ret += GiveAll(man, list, dest, moveInsteadOfCopy);
                    }
                }
            }
            return(ret);
        }
Ejemplo n.º 3
0
        public string RezAll(BotInventoryEval man, InventoryBase b, SimPosition dest)
        {
            string ret     = "";
            var    manager = man.Manager;

            if (b is InventoryItem)
            {
                InventoryItem item = b as InventoryItem;

                bool canCopy = (item.Permissions.OwnerMask & PermissionMask.Copy) == PermissionMask.Copy;

                ret += item.Name + nl;
                if (dest == null)
                {
                    Simulator sim = Client.Network.CurrentSim;
                    Client.Inventory.RequestRestoreRezFromInventory(sim, item, item.UUID);
                }
                else
                {
                    Simulator sim = SimRegion.GetRegion(dest.GlobalPosition).TheSimulator;
                    Client.Inventory.RequestRezFromInventory(sim, dest.SimRotation, dest.SimPosition, item, UUID.Zero);
                }
            }
            else if (b is InventoryFolder)
            {
                InventoryFolder      folder         = b as InventoryFolder;
                List <InventoryBase> folderContents = man.FolderContents(folder.UUID);
                if (folderContents != null)
                {
                    foreach (InventoryBase list in folderContents)
                    {
                        ret += RezAll(man, list, dest);
                    }
                }
            }
            return(ret);
        }
Ejemplo n.º 4
0
        public string GiveAll(BotInventoryEval man, InventoryBase b, SimObject dest, bool moveInsteadOfCopy)
        {
            string ret = "";
            var manager = man.Manager;
            if (b is InventoryItem)
            {
                InventoryItem item = b as InventoryItem;

                bool canCopy = (item.Permissions.OwnerMask & PermissionMask.Copy) == PermissionMask.Copy;

                ret += item.Name + nl;
                if (dest.IsAvatar)
                {
                    manager.GiveItem(item.UUID, item.Name, item.AssetType, dest.ID, true);
                }
                else
                {
                    throw new NotImplementedException("giving items to objects");
                }
            }
            else if (b is InventoryFolder)
            {
                InventoryFolder item = b as InventoryFolder;
                if (dest.IsAvatar)
                {
                    manager.GiveFolder(item.UUID, item.Name, AssetType.Folder, dest.ID, true);
                    return item.Name + nl;
                }
                InventoryFolder folder = b as InventoryFolder;
                List<InventoryBase> folderContents = man.FolderContents(folder.UUID);
                if (folderContents != null)
                    foreach (InventoryBase list in folderContents)
                    {
                        ret += GiveAll(man, list, dest, moveInsteadOfCopy);
                    }
            }
            return ret;
        }