本文整理汇总了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);
}
}
示例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);
}
}