當前位置: 首頁>>代碼示例>>C#>>正文


C# LLUUID.Combine方法代碼示例

本文整理匯總了C#中libsecondlife.LLUUID.Combine方法的典型用法代碼示例。如果您正苦於以下問題:C# LLUUID.Combine方法的具體用法?C# LLUUID.Combine怎麽用?C# LLUUID.Combine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在libsecondlife.LLUUID的用法示例。


在下文中一共展示了LLUUID.Combine方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddUpload

 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);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:ulife-svn,代碼行數:33,代碼來源:AgentAssetUpload.cs

示例2: RequestUpload

        /// <summary>
        /// 
        /// </summary>
        /// <param name="transactionID">Usually a randomly generated UUID</param>
        /// <param name="type"></param>
        /// <param name="data"></param>
        /// <param name="tempFile"></param>
        /// <param name="storeLocal"></param>
        /// <param name="isPriority"></param>
        public void RequestUpload(LLUUID transactionID, AssetType type, byte[] data, bool tempFile, bool storeLocal, 
            bool isPriority)
        {
            if (!Transfers.ContainsKey(transactionID))
            {
                AssetUpload upload = new AssetUpload();
                upload.AssetData = data;
                upload.ID = transactionID;
                upload.AssetID = ((transactionID == LLUUID.Zero) ? transactionID : transactionID.Combine(Client.Network.SecureSessionID));
                upload.Size = data.Length;
                upload.XferID = 0;

                // Build and send the upload packet
                AssetUploadRequestPacket request = new AssetUploadRequestPacket();
                request.AssetBlock.StoreLocal = storeLocal;
                request.AssetBlock.Tempfile = tempFile;
                request.AssetBlock.TransactionID = upload.ID;
                request.AssetBlock.Type = (sbyte)type;

                if (data.Length + 100 < Settings.MAX_PACKET_SIZE)
                {
                    Client.Log(
                        String.Format("Beginning asset upload [Single Packet], ID: {0}, AssetID: {1}, Size: {2}",
                        upload.ID.ToStringHyphenated(), upload.AssetID.ToStringHyphenated(), upload.Size),
                        Helpers.LogLevel.Info);

                    // The whole asset will fit in this packet, makes things easy
                    request.AssetBlock.AssetData = data;
                    upload.Transferred = data.Length;
                }
                else
                {
                    Client.Log(
                        String.Format("Beginning asset upload [Multiple Packets], ID: {0}, AssetID: {1}, Size: {2}",
                        upload.ID.ToStringHyphenated(), upload.AssetID.ToStringHyphenated(), upload.Size),
                        Helpers.LogLevel.Info);

                    // Asset is too big, send in multiple packets
                    request.AssetBlock.AssetData = new byte[0];
                }

                //Client.DebugLog(request.ToString());

                // Add this upload to the Transfers dictionary using the assetID as the key.
                // Once the simulator assigns an actual identifier for this upload it will be
                // removed from Transfers and reinserted with the proper identifier
                lock (Transfers) Transfers[upload.AssetID] = upload;

                Client.Network.SendPacket(request);
            }
            else
            {
                Client.Log("RequestUpload() called for an asset we are already uploading, ignoring",
                    Helpers.LogLevel.Info);
            }
        }
開發者ID:RavenB,項目名稱:gridsearch,代碼行數:65,代碼來源:AssetManager.cs


注:本文中的libsecondlife.LLUUID.Combine方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。