public Packet MoveInventoryFolder(
            LLUUID parentID
            , LLUUID folderID
            )
        {
            MoveInventoryFolderPacket p = new MoveInventoryFolderPacket();

            p.AgentData.AgentID   = AgentID;
            p.AgentData.SessionID = SessionID;
            p.AgentData.Stamp     = false;

            p.InventoryData    = new MoveInventoryFolderPacket.InventoryDataBlock[1];
            p.InventoryData[0] = new MoveInventoryFolderPacket.InventoryDataBlock();

            p.InventoryData[0].ParentID = parentID;
            p.InventoryData[0].FolderID = folderID;

            return(p);
        }
Esempio n. 2
0
        /// <summary>
        /// Moves the folders, the keys in the Dictionary parameter,
        /// to a new parents, the value of that folder's key.
        /// </summary>
        /// <param name="FoldersNewParents"></param>
        public void MoveFolders(Dictionary<LLUUID, LLUUID> foldersNewParents)
        {
            // FIXME: Use two List<LLUUID> to stay consistent

            lock (Store)
            {
                foreach (KeyValuePair<LLUUID, LLUUID> entry in foldersNewParents)
                {
                    if (_Store.Contains(entry.Key))
                    {
                        InventoryBase inv = _Store[entry.Key];
                        inv.ParentUUID = entry.Value;
                        _Store.UpdateNodeFor(inv);
                    }
                }
            }

            //TODO: Test if this truly supports multiple-folder move
            MoveInventoryFolderPacket move = new MoveInventoryFolderPacket();
            move.AgentData.AgentID = _Client.Self.AgentID;
            move.AgentData.SessionID = _Client.Self.SessionID;
            move.AgentData.Stamp = false; //FIXME: ??

            move.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[foldersNewParents.Count];

            int index = 0;
            foreach (KeyValuePair<LLUUID, LLUUID> folder in foldersNewParents)
            {
                MoveInventoryFolderPacket.InventoryDataBlock block = new MoveInventoryFolderPacket.InventoryDataBlock();
                block.FolderID = folder.Key;
                block.ParentID = folder.Value;
                move.InventoryData[index++] = block;
            }

            _Client.Network.SendPacket(move);
        }
Esempio n. 3
0
        public void MoveFolder(LLUUID folder, LLUUID newParent)
        {
            lock (Store)
            {
                if (_Store.Contains(folder))
                {
                    InventoryBase inv = Store[folder];
                    inv.ParentUUID = newParent;
                    _Store.UpdateNodeFor(inv);
                }
            }

            MoveInventoryFolderPacket move = new MoveInventoryFolderPacket();
            move.AgentData.AgentID = _Client.Self.AgentID;
            move.AgentData.SessionID = _Client.Self.SessionID;
            move.AgentData.Stamp = false; //FIXME: ??

            move.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[1];
            move.InventoryData[0] = new MoveInventoryFolderPacket.InventoryDataBlock();
            move.InventoryData[0].FolderID = folder;
            move.InventoryData[0].ParentID = newParent;

            _Client.Network.SendPacket(move);
        }
Esempio n. 4
0
		public Packet MoveInventoryFolder(
			LLUUID parentID
			, LLUUID folderID
			)
		{
            MoveInventoryFolderPacket p = new MoveInventoryFolderPacket();
            p.AgentData.AgentID   = AgentID;
            p.AgentData.SessionID = SessionID;
            p.AgentData.Stamp     = false;

            p.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[1];
            p.InventoryData[0] = new MoveInventoryFolderPacket.InventoryDataBlock();

            p.InventoryData[0].ParentID = parentID;
            p.InventoryData[0].FolderID = folderID;

            return p;

		}
Esempio n. 5
0
        /// <summary>
        /// Move multiple folders.
        /// </summary>
        /// <param name="newParent">The parent to move the folders to.</param>
        /// <param name="folders">The folders to move.</param>
        public void MoveFolders(ICollection<UUID> folders, UUID newParent)
        {
            //TODO: Test if this truly supports multiple-folder move
            MoveInventoryFolderPacket move = new MoveInventoryFolderPacket();
            move.AgentData.AgentID = _Agents.AgentID;
            move.AgentData.SessionID = _Agents.SessionID;
            move.AgentData.Stamp = false; //FIXME: ??

            move.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[folders.Count];

            int i = 0;
            foreach (UUID folder in folders)
            {
                MoveInventoryFolderPacket.InventoryDataBlock block = new MoveInventoryFolderPacket.InventoryDataBlock();
                block.FolderID = folder;
                block.ParentID = newParent;
                move.InventoryData[i] = block;
                ++i;
            }

            _Network.SendPacket(move);
        }
Esempio n. 6
0
        public bool MoveInventoryFolder(MoveInventoryFolderPacket invPacket)
        {
            if (invPacket.AgentData.AgentID.Equals(libOwner))
                // Tell grid surfer to forward request to region, because the Library is served from there (!)
                return false;

            if (connected)
            {
                string uri = InventoryServerURL + "/" + AuthToken + "/MoveFolder/";
                foreach (MoveInventoryFolderPacket.InventoryDataBlock block in invPacket.InventoryData)
                {
                    InventoryFolderBase folder = new InventoryFolderBase();
                    folder.ID = block.FolderID;
                    folder.Owner = invPacket.AgentData.AgentID;
                    folder.ParentID = block.ParentID;
                    OpenSimComms.InventoryFolderOperation(uri, folder, NullCallBack);
                }
            }
            // Tell grid surfer not to forward
            return true;
        }