当前位置: 首页>>代码示例>>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;未经允许,请勿转载。