Beispiel #1
0
        public void AddUpload(LLUUID transactionID, AssetBase asset)
        {
            AssetTransaction upload = new AssetTransaction();

            lock (this.transactions)
            {
                upload.Asset         = asset;
                upload.TransactionID = transactionID;
                this.transactions.Add(transactionID, upload);
            }
            if (upload.Asset.Data.Length > 2)
            {
                //is complete
                upload.UploadComplete = true;
                AssetUploadCompletePacket response = new AssetUploadCompletePacket();
                response.AssetBlock.Type    = asset.Type;
                response.AssetBlock.Success = true;
                response.AssetBlock.UUID    = transactionID.Combine(this.ourClient.SecureSessionID);
                this.ourClient.OutPacket(response);
                m_assetCache.AddAsset(asset);
            }
            else
            {
                upload.UploadComplete = false;
                upload.XferID         = Util.GetNextXferID();
                RequestXferPacket xfer = new RequestXferPacket();
                xfer.XferID.ID        = upload.XferID;
                xfer.XferID.VFileType = upload.Asset.Type;
                xfer.XferID.VFileID   = transactionID.Combine(this.ourClient.SecureSessionID);
                xfer.XferID.FilePath  = 0;
                xfer.XferID.Filename  = new byte[0];
                this.ourClient.OutPacket(xfer);
            }
        }