OpenMetaverse.AssetManager.RequestAssetXfer C# (CSharp) Method

RequestAssetXfer() public method

Request an asset download through the almost deprecated Xfer system
public RequestAssetXfer ( string filename, bool deleteOnCompletion, bool useBigPackets, UUID vFileID, AssetType vFileType, bool fromCache ) : ulong
filename string Filename of the asset to request
deleteOnCompletion bool Whether or not to delete the asset /// off the server after it is retrieved
useBigPackets bool Use large transfer packets or not
vFileID UUID UUID of the file to request, if filename is /// left empty
vFileType AssetType Asset type of vFileID, or /// AssetType.Unknown if filename is not empty
fromCache bool Sets the FilePath in the request to Cache /// (4) if true, otherwise Unknown (0) is used
return ulong
        public ulong RequestAssetXfer(string filename, bool deleteOnCompletion, bool useBigPackets, UUID vFileID, AssetType vFileType,
            bool fromCache)
        {
            UUID uuid = UUID.Random();
            ulong id = uuid.GetULong();

            XferDownload transfer = new XferDownload();
            transfer.XferID = id;
            transfer.ID = new UUID(id); // Our dictionary tracks transfers with UUIDs, so convert the ulong back
            transfer.Filename = filename;
            transfer.VFileID = vFileID;
            transfer.AssetType = vFileType;

            // Add this transfer to the dictionary
            lock (Transfers) Transfers[transfer.ID] = transfer;

            RequestXferPacket request = new RequestXferPacket();
            request.XferID.ID = id;
            request.XferID.Filename = Utils.StringToBytes(filename);
            request.XferID.FilePath = fromCache ? (byte)4 : (byte)0;
            request.XferID.DeleteOnCompletion = deleteOnCompletion;
            request.XferID.UseBigPackets = useBigPackets;
            request.XferID.VFileID = vFileID;
            request.XferID.VFileType = (short)vFileType;

            Client.Network.SendPacket(request);

            return id;
        }