C# Класс OpenMetaverse.AssetManager

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Cache AssetCache

Открытые методы

Метод Описание
AssetManager ( GridClient client ) : System

Default constructor

RequestAsset ( UUID assetID, AssetType type, bool priority, AssetReceivedCallback callback ) : void

Request an asset download

RequestAsset ( UUID assetID, AssetType type, bool priority, SourceType sourceType, AssetReceivedCallback callback ) : void

Request an asset download

RequestAsset ( UUID assetID, AssetType type, bool priority, SourceType sourceType, UUID transactionID, AssetReceivedCallback callback ) : void

Request an asset download

RequestAssetXfer ( string filename, bool deleteOnCompletion, bool useBigPackets, UUID vFileID, AssetType vFileType, bool fromCache ) : ulong

Request an asset download through the almost deprecated Xfer system

RequestEstateAsset ( ) : void
RequestImage ( UUID textureID, ImageType imageType, TextureDownloadCallback callback ) : void

Overload: Request a texture asset from the simulator using the TexturePipeline system to manage the requests and re-assemble the image from the packets received from the simulator

RequestImage ( UUID textureID, ImageType imageType, TextureDownloadCallback callback, bool progress ) : void

Overload: Request a texture asset from the simulator using the TexturePipeline system to manage the requests and re-assemble the image from the packets received from the simulator

RequestImage ( UUID textureID, ImageType imageType, float priority, int discardLevel, uint packetStart, TextureDownloadCallback callback, bool progress ) : void

Request a texture asset from the simulator using the TexturePipeline system to manage the requests and re-assemble the image from the packets received from the simulator

A bug exists in the Linden Simulator where a -1 will occasionally be sent with a non-zero priority indicating an off-by-one error.

RequestImage ( UUID textureID, TextureDownloadCallback callback ) : void

Overload: Request a texture asset from the simulator using the TexturePipeline system to manage the requests and re-assemble the image from the packets received from the simulator

RequestImageCancel ( UUID textureID ) : void

Cancel a texture request

RequestInventoryAsset ( InventoryItem item, bool priority, AssetReceivedCallback callback ) : void
RequestInventoryAsset ( UUID assetID, UUID itemID, UUID taskID, UUID ownerID, AssetType type, bool priority, AssetReceivedCallback callback ) : void

RequestMesh ( UUID meshID, MeshDownloadCallback callback ) : void

Requests download of a mesh asset

RequestUpload ( Asset asset, bool storeLocal ) : UUID

Request an asset be uploaded to the simulator

RequestUpload ( AssetType type, byte data, bool storeLocal ) : UUID

Request an asset be uploaded to the simulator

RequestUpload ( UUID &assetID, AssetType type, byte data, bool storeLocal ) : UUID

Request an asset be uploaded to the simulator

RequestUpload ( UUID &assetID, AssetType type, byte data, bool storeLocal, UUID transactionID ) : UUID

Initiate an asset upload

RequestUploadBakedTexture ( byte textureData, BakedTextureUploadedCallback callback ) : void

Защищенные методы

Метод Описание
AbortXferHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Process an incoming packet and raise the appropriate events

AssetUploadCompleteHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Process an incoming packet and raise the appropriate events

ConfirmXferPacketHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Process an incoming packet and raise the appropriate events

InitiateDownloadPacketHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Process an incoming packet and raise the appropriate events

OnAssetUploaded ( AssetUploadEventArgs e ) : void

Raises the AssetUploaded event

OnImageReceiveProgress ( ImageReceiveProgressEventArgs e ) : void

Raises the ImageReceiveProgress event

OnInitiateDownload ( InitiateDownloadEventArgs e ) : void

Raises the InitiateDownload event

OnUploadProgress ( AssetUploadEventArgs e ) : void

Raises the UploadProgress event

OnXferReceived ( XferReceivedEventArgs e ) : void

Raises the XferReceived event

RequestXferHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Process an incoming packet and raise the appropriate events

SendXferPacketHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Process an incoming packet and raise the appropriate events

TransferInfoHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Process an incoming packet and raise the appropriate events

TransferPacketHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Process an incoming packet and raise the appropriate events

Приватные методы

Метод Описание
CreateAssetWrapper ( AssetType type ) : Asset
FireImageProgressEvent ( UUID texureID, int transferredBytes, int totalBytes ) : void

Lets TexturePipeline class fire the progress event

HttpRequestTexture ( UUID textureID, ImageType imageType, float priority, int discardLevel, uint packetStart, TextureDownloadCallback callback, bool progress ) : void
SendConfirmXferPacket ( ulong xferID, uint packetNum ) : void
SendNextUploadPacket ( AssetUpload upload ) : void
SetPendingAssetUploadData ( AssetUpload assetData ) : void

Used to force asset data into the PendingUpload property, ie: for raw terrain uploads

WrapAsset ( AssetDownload download ) : Asset

Описание методов

AbortXferHandler() защищенный Метод

Process an incoming packet and raise the appropriate events
protected AbortXferHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object The sender
e OpenMetaverse.PacketReceivedEventArgs The EventArgs object containing the packet data
Результат void

AssetManager() публичный Метод

Default constructor
public AssetManager ( GridClient client ) : System
client GridClient A reference to the GridClient object
Результат System

AssetUploadCompleteHandler() защищенный Метод

Process an incoming packet and raise the appropriate events
protected AssetUploadCompleteHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object The sender
e OpenMetaverse.PacketReceivedEventArgs The EventArgs object containing the packet data
Результат void

ConfirmXferPacketHandler() защищенный Метод

Process an incoming packet and raise the appropriate events
protected ConfirmXferPacketHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object The sender
e OpenMetaverse.PacketReceivedEventArgs The EventArgs object containing the packet data
Результат void

InitiateDownloadPacketHandler() защищенный Метод

Process an incoming packet and raise the appropriate events
protected InitiateDownloadPacketHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object The sender
e OpenMetaverse.PacketReceivedEventArgs The EventArgs object containing the packet data
Результат void

OnAssetUploaded() защищенный Метод

Raises the AssetUploaded event
protected OnAssetUploaded ( AssetUploadEventArgs e ) : void
e AssetUploadEventArgs A AssetUploadedEventArgs object containing the /// data returned from the simulator
Результат void

OnImageReceiveProgress() защищенный Метод

Raises the ImageReceiveProgress event
protected OnImageReceiveProgress ( ImageReceiveProgressEventArgs e ) : void
e ImageReceiveProgressEventArgs A ImageReceiveProgressEventArgs object containing the /// data returned from the simulator
Результат void

OnInitiateDownload() защищенный Метод

Raises the InitiateDownload event
protected OnInitiateDownload ( InitiateDownloadEventArgs e ) : void
e InitiateDownloadEventArgs A InitiateDownloadEventArgs object containing the /// data returned from the simulator
Результат void

OnUploadProgress() защищенный Метод

Raises the UploadProgress event
protected OnUploadProgress ( AssetUploadEventArgs e ) : void
e AssetUploadEventArgs A UploadProgressEventArgs object containing the /// data returned from the simulator
Результат void

OnXferReceived() защищенный Метод

Raises the XferReceived event
protected OnXferReceived ( XferReceivedEventArgs e ) : void
e XferReceivedEventArgs A XferReceivedEventArgs object containing the /// data returned from the simulator
Результат void

RequestAsset() публичный Метод

Request an asset download
public RequestAsset ( UUID assetID, AssetType type, bool priority, AssetReceivedCallback callback ) : void
assetID UUID Asset UUID
type AssetType Asset type, must be correct for the transfer to succeed
priority bool Whether to give this transfer an elevated priority
callback AssetReceivedCallback The callback to fire when the simulator responds with the asset data
Результат void

RequestAsset() публичный Метод

Request an asset download
public RequestAsset ( UUID assetID, AssetType type, bool priority, SourceType sourceType, AssetReceivedCallback callback ) : void
assetID UUID Asset UUID
type AssetType Asset type, must be correct for the transfer to succeed
priority bool Whether to give this transfer an elevated priority
sourceType SourceType Source location of the requested asset
callback AssetReceivedCallback The callback to fire when the simulator responds with the asset data
Результат void

RequestAsset() публичный Метод

Request an asset download
public RequestAsset ( UUID assetID, AssetType type, bool priority, SourceType sourceType, UUID transactionID, AssetReceivedCallback callback ) : void
assetID UUID Asset UUID
type AssetType Asset type, must be correct for the transfer to succeed
priority bool Whether to give this transfer an elevated priority
sourceType SourceType Source location of the requested asset
transactionID UUID UUID of the transaction
callback AssetReceivedCallback The callback to fire when the simulator responds with the asset data
Результат void

RequestAssetXfer() публичный Метод

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
Результат ulong

RequestEstateAsset() публичный Метод

public RequestEstateAsset ( ) : void
Результат void

RequestImage() публичный Метод

Overload: Request a texture asset from the simulator using the TexturePipeline system to manage the requests and re-assemble the image from the packets received from the simulator
public RequestImage ( UUID textureID, ImageType imageType, TextureDownloadCallback callback ) : void
textureID UUID The of the texture asset to download
imageType ImageType The of the texture asset. /// Use for most textures, or for baked layer texture assets
callback TextureDownloadCallback The callback to fire when the image is retrieved. The callback /// will contain the result of the request and the texture asset data
Результат void

RequestImage() публичный Метод

Overload: Request a texture asset from the simulator using the TexturePipeline system to manage the requests and re-assemble the image from the packets received from the simulator
public RequestImage ( UUID textureID, ImageType imageType, TextureDownloadCallback callback, bool progress ) : void
textureID UUID The of the texture asset to download
imageType ImageType The of the texture asset. /// Use for most textures, or for baked layer texture assets
callback TextureDownloadCallback The callback to fire when the image is retrieved. The callback /// will contain the result of the request and the texture asset data
progress bool If true, the callback will be fired for each chunk of the downloaded image. /// The callback asset parameter will contain all previously received chunks of the texture asset starting /// from the beginning of the request
Результат void

RequestImage() публичный Метод

Request a texture asset from the simulator using the TexturePipeline system to manage the requests and re-assemble the image from the packets received from the simulator
A bug exists in the Linden Simulator where a -1 will occasionally be sent with a non-zero priority indicating an off-by-one error.
public RequestImage ( UUID textureID, ImageType imageType, float priority, int discardLevel, uint packetStart, TextureDownloadCallback callback, bool progress ) : void
textureID UUID The of the texture asset to download
imageType ImageType The of the texture asset. /// Use for most textures, or for baked layer texture assets
priority float A float indicating the requested priority for the transfer. Higher priority values tell the simulator /// to prioritize the request before lower valued requests. An image already being transferred using the can have /// its priority changed by resending the request with the new priority value
discardLevel int Number of quality layers to discard. /// This controls the end marker of the data sent. Sending with value -1 combined with priority of 0 cancels an in-progress /// transfer.
packetStart uint The packet number to begin the request at. A value of 0 begins the request /// from the start of the asset texture
callback TextureDownloadCallback The callback to fire when the image is retrieved. The callback /// will contain the result of the request and the texture asset data
progress bool If true, the callback will be fired for each chunk of the downloaded image. /// The callback asset parameter will contain all previously received chunks of the texture asset starting /// from the beginning of the request
Результат void

RequestImage() публичный Метод

Overload: Request a texture asset from the simulator using the TexturePipeline system to manage the requests and re-assemble the image from the packets received from the simulator
public RequestImage ( UUID textureID, TextureDownloadCallback callback ) : void
textureID UUID The of the texture asset to download
callback TextureDownloadCallback The callback to fire when the image is retrieved. The callback /// will contain the result of the request and the texture asset data
Результат void

RequestImageCancel() публичный Метод

Cancel a texture request
public RequestImageCancel ( UUID textureID ) : void
textureID UUID The texture assets
Результат void

RequestInventoryAsset() публичный Метод

public RequestInventoryAsset ( InventoryItem item, bool priority, AssetReceivedCallback callback ) : void
item InventoryItem
priority bool
callback AssetReceivedCallback
Результат void

RequestInventoryAsset() публичный Метод

public RequestInventoryAsset ( UUID assetID, UUID itemID, UUID taskID, UUID ownerID, AssetType type, bool priority, AssetReceivedCallback callback ) : void
assetID UUID Use UUID.Zero if you do not have the /// asset ID but have all the necessary permissions
itemID UUID The item ID of this asset in the inventory
taskID UUID Use UUID.Zero if you are not requesting an /// asset from an object inventory
ownerID UUID The owner of this asset
type AssetType Asset type
priority bool Whether to prioritize this asset download or not
callback AssetReceivedCallback
Результат void

RequestMesh() публичный Метод

Requests download of a mesh asset
public RequestMesh ( UUID meshID, MeshDownloadCallback callback ) : void
meshID UUID UUID of the mesh asset
callback MeshDownloadCallback Callback when the request completes
Результат void

RequestUpload() публичный Метод

Request an asset be uploaded to the simulator
public RequestUpload ( Asset asset, bool storeLocal ) : UUID
asset Asset The Object containing the asset data
storeLocal bool If True, the asset once uploaded will be stored on the simulator /// in which the client was connected in addition to being stored on the asset server
Результат UUID

RequestUpload() публичный Метод

Request an asset be uploaded to the simulator
public RequestUpload ( AssetType type, byte data, bool storeLocal ) : UUID
type AssetType The of the asset being uploaded
data byte A byte array containing the encoded asset data
storeLocal bool If True, the asset once uploaded will be stored on the simulator /// in which the client was connected in addition to being stored on the asset server
Результат UUID

RequestUpload() публичный Метод

Request an asset be uploaded to the simulator
public RequestUpload ( UUID &assetID, AssetType type, byte data, bool storeLocal ) : UUID
assetID UUID
type AssetType Asset type to upload this data as
data byte A byte array containing the encoded asset data
storeLocal bool If True, the asset once uploaded will be stored on the simulator /// in which the client was connected in addition to being stored on the asset server
Результат UUID

RequestUpload() публичный Метод

Initiate an asset upload
public RequestUpload ( UUID &assetID, AssetType type, byte data, bool storeLocal, UUID transactionID ) : UUID
assetID UUID The ID this asset will have if the /// upload succeeds
type AssetType Asset type to upload this data as
data byte Raw asset data to upload
storeLocal bool Whether to store this asset on the local /// simulator or the grid-wide asset server
transactionID UUID The tranaction id for the upload
Результат UUID

RequestUploadBakedTexture() публичный Метод

public RequestUploadBakedTexture ( byte textureData, BakedTextureUploadedCallback callback ) : void
textureData byte
callback BakedTextureUploadedCallback
Результат void

RequestXferHandler() защищенный Метод

Process an incoming packet and raise the appropriate events
protected RequestXferHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object The sender
e OpenMetaverse.PacketReceivedEventArgs The EventArgs object containing the packet data
Результат void

SendXferPacketHandler() защищенный Метод

Process an incoming packet and raise the appropriate events
protected SendXferPacketHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object The sender
e OpenMetaverse.PacketReceivedEventArgs The EventArgs object containing the packet data
Результат void

TransferInfoHandler() защищенный Метод

Process an incoming packet and raise the appropriate events
protected TransferInfoHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object The sender
e OpenMetaverse.PacketReceivedEventArgs The EventArgs object containing the packet data
Результат void

TransferPacketHandler() защищенный Метод

Process an incoming packet and raise the appropriate events
protected TransferPacketHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object The sender
e OpenMetaverse.PacketReceivedEventArgs The EventArgs object containing the packet data
Результат void

Описание свойств

Cache публичное свойство

Texture download cache
public AssetCache Cache
Результат AssetCache