mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
This commit is contained in:
@@ -26,7 +26,9 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
@@ -34,33 +36,18 @@ namespace OpenSim.Framework
|
||||
public class AssetBase
|
||||
{
|
||||
private byte[] _data;
|
||||
private string _description = String.Empty;
|
||||
private UUID _fullid;
|
||||
private bool _local = false;
|
||||
private string _name = String.Empty;
|
||||
private bool _temporary = false;
|
||||
private sbyte _type;
|
||||
private AssetMetadata _metadata;
|
||||
|
||||
public AssetBase()
|
||||
{
|
||||
Metadata = new AssetMetadata();
|
||||
}
|
||||
|
||||
public AssetBase(UUID assetId, string name)
|
||||
{
|
||||
FullID = assetId;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public virtual UUID FullID
|
||||
{
|
||||
get { return _fullid; }
|
||||
set { _fullid = value; }
|
||||
}
|
||||
|
||||
public virtual string ID
|
||||
{
|
||||
get { return _fullid.ToString(); }
|
||||
set { _fullid = new UUID(value); }
|
||||
Metadata = new AssetMetadata();
|
||||
Metadata.FullID = assetId;
|
||||
Metadata.Name = name;
|
||||
}
|
||||
|
||||
public virtual byte[] Data
|
||||
@@ -69,34 +56,98 @@ namespace OpenSim.Framework
|
||||
set { _data = value; }
|
||||
}
|
||||
|
||||
public virtual sbyte Type
|
||||
public virtual AssetMetadata Metadata
|
||||
{
|
||||
get { return _type; }
|
||||
set { _type = value; }
|
||||
get { return _metadata; }
|
||||
set { _metadata = value; }
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class AssetMetadata
|
||||
{
|
||||
private UUID _fullid;
|
||||
private string _name = String.Empty;
|
||||
private string _description = String.Empty;
|
||||
private DateTime _creation_date;
|
||||
private sbyte _type;
|
||||
private string _content_type;
|
||||
private byte[] _sha1;
|
||||
private bool _local = false;
|
||||
private bool _temporary = false;
|
||||
//private Dictionary<string, Uri> _methods = new Dictionary<string, Uri>();
|
||||
//private OSDMap _extra_data;
|
||||
|
||||
public UUID FullID
|
||||
{
|
||||
get { return _fullid; }
|
||||
set { _fullid = value; }
|
||||
}
|
||||
|
||||
public virtual string Name
|
||||
public string ID
|
||||
{
|
||||
get { return _fullid.ToString(); }
|
||||
set { _fullid = new UUID(value); }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set { _name = value; }
|
||||
}
|
||||
|
||||
public virtual string Description
|
||||
public string Description
|
||||
{
|
||||
get { return _description; }
|
||||
set { _description = value; }
|
||||
}
|
||||
|
||||
public virtual bool Local
|
||||
public DateTime CreationDate
|
||||
{
|
||||
get { return _creation_date; }
|
||||
set { _creation_date = value; }
|
||||
}
|
||||
|
||||
public sbyte Type
|
||||
{
|
||||
get { return _type; }
|
||||
set { _type = value; }
|
||||
}
|
||||
|
||||
public string ContentType
|
||||
{
|
||||
get { return _content_type; }
|
||||
set { _content_type = value; }
|
||||
}
|
||||
|
||||
public byte[] SHA1
|
||||
{
|
||||
get { return _sha1; }
|
||||
set { _sha1 = value; }
|
||||
}
|
||||
|
||||
public bool Local
|
||||
{
|
||||
get { return _local; }
|
||||
set { _local = value; }
|
||||
}
|
||||
|
||||
public virtual bool Temporary
|
||||
public bool Temporary
|
||||
{
|
||||
get { return _temporary; }
|
||||
set { _temporary = value; }
|
||||
}
|
||||
|
||||
//public Dictionary<string, Uri> Methods
|
||||
//{
|
||||
// get { return _methods; }
|
||||
// set { _methods = value; }
|
||||
//}
|
||||
|
||||
//public OSDMap ExtraData
|
||||
//{
|
||||
// get { return _extra_data; }
|
||||
// set { _extra_data = value; }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ namespace OpenSim.Framework
|
||||
public AssetLandmark(AssetBase a)
|
||||
{
|
||||
Data = a.Data;
|
||||
FullID = a.FullID;
|
||||
Type = a.Type;
|
||||
Name = a.Name;
|
||||
Description = a.Description;
|
||||
Metadata.FullID = a.Metadata.FullID;
|
||||
Metadata.Type = a.Metadata.Type;
|
||||
Metadata.Name = a.Metadata.Name;
|
||||
Metadata.Description = a.Metadata.Description;
|
||||
InternData();
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
|
||||
|
||||
AssetBase newAsset = CreateAsset(assetIdStr, name, assetPath, false);
|
||||
|
||||
newAsset.Type = type;
|
||||
newAsset.Metadata.Type = type;
|
||||
assets.Add(newAsset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
/// <summary>
|
||||
/// Manages local cache of assets and their sending to viewers.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// This class actually encapsulates two largely separate mechanisms. One mechanism fetches assets either
|
||||
/// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and
|
||||
/// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and
|
||||
@@ -80,7 +80,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
private Dictionary<UUID, AssetRequestsList> RequestLists;
|
||||
|
||||
/// <summary>
|
||||
/// The 'server' from which assets can be requested and to which assets are persisted.
|
||||
/// The 'server' from which assets can be requested and to which assets are persisted.
|
||||
/// </summary>
|
||||
private readonly IAssetServer m_assetServer;
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
else
|
||||
{
|
||||
// m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId);
|
||||
|
||||
|
||||
NewAssetRequest req = new NewAssetRequest(callback);
|
||||
AssetRequestsList requestList;
|
||||
|
||||
@@ -228,10 +228,10 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
// m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId);
|
||||
requestList = new AssetRequestsList();
|
||||
requestList.TimeRequested = DateTime.Now;
|
||||
requestList.Requests.Add(req);
|
||||
|
||||
RequestLists.Add(assetId, requestList);
|
||||
|
||||
requestList.Requests.Add(req);
|
||||
|
||||
RequestLists.Add(assetId, requestList);
|
||||
|
||||
m_assetServer.RequestAsset(assetId, isTexture);
|
||||
}
|
||||
}
|
||||
@@ -247,7 +247,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
/// the allowed number of polls. This isn't a very good way of doing things since a single thread
|
||||
/// is processing inbound packets, so if the asset server is slow, we could block this for up to
|
||||
/// the timeout period. Whereever possible we want to use the asynchronous callback GetAsset()
|
||||
///
|
||||
///
|
||||
/// <param name="assetID"></param>
|
||||
/// <param name="isTexture"></param>
|
||||
/// <returns>null if the asset could not be retrieved</returns>
|
||||
@@ -264,7 +264,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
return asset;
|
||||
}
|
||||
|
||||
|
||||
m_assetServer.RequestAsset(assetID, isTexture);
|
||||
|
||||
do
|
||||
@@ -275,7 +275,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
return asset;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (--maxPolls > 0);
|
||||
|
||||
m_log.WarnFormat("[ASSET CACHE]: {0} {1} was not received before the retrieval timeout was reached",
|
||||
@@ -290,17 +290,17 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
/// <param name="asset"></param>
|
||||
public void AddAsset(AssetBase asset)
|
||||
{
|
||||
if (!m_memcache.Contains(asset.FullID))
|
||||
if (!m_memcache.Contains(asset.Metadata.FullID))
|
||||
{
|
||||
m_log.Info("[CACHE] Caching " + asset.FullID + " for 24 hours from last access");
|
||||
m_log.Info("[CACHE] Caching " + asset.Metadata.FullID + " for 24 hours from last access");
|
||||
// Use 24 hour rolling asset cache.
|
||||
m_memcache.AddOrUpdate(asset.FullID, asset, TimeSpan.FromHours(24));
|
||||
m_memcache.AddOrUpdate(asset.Metadata.FullID, asset, TimeSpan.FromHours(24));
|
||||
|
||||
// According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the
|
||||
// According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the
|
||||
// information is stored locally. It could disappear, in which case we could send the
|
||||
// ImageNotInDatabase packet to tell the client this.
|
||||
// ImageNotInDatabase packet to tell the client this.
|
||||
//
|
||||
// However, this doesn't quite appear to work with local textures that are part of an avatar's
|
||||
// However, this doesn't quite appear to work with local textures that are part of an avatar's
|
||||
// appearance texture set. Whilst sending an ImageNotInDatabase does trigger an automatic rebake
|
||||
// and reupload by the client, if those assets aren't pushed to the asset server anyway, then
|
||||
// on crossing onto another region server, other avatars can no longer get the required textures.
|
||||
@@ -314,7 +314,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
// But for now, we're going to take the easy way out and store local assets globally.
|
||||
//
|
||||
// TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView.
|
||||
if (!asset.Temporary || asset.Local)
|
||||
if (!asset.Metadata.Temporary || asset.Metadata.Local)
|
||||
{
|
||||
m_assetServer.StoreAsset(asset);
|
||||
}
|
||||
@@ -345,25 +345,25 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
|
||||
AssetInfo assetInf = new AssetInfo(asset);
|
||||
if (!m_memcache.Contains(assetInf.FullID))
|
||||
if (!m_memcache.Contains(assetInf.Metadata.FullID))
|
||||
{
|
||||
m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24));
|
||||
m_memcache.AddOrUpdate(assetInf.Metadata.FullID, assetInf, TimeSpan.FromHours(24));
|
||||
|
||||
if (StatsManager.SimExtraStats != null)
|
||||
{
|
||||
StatsManager.SimExtraStats.AddAsset(assetInf);
|
||||
}
|
||||
|
||||
if (RequestedAssets.ContainsKey(assetInf.FullID))
|
||||
if (RequestedAssets.ContainsKey(assetInf.Metadata.FullID))
|
||||
{
|
||||
AssetRequest req = RequestedAssets[assetInf.FullID];
|
||||
AssetRequest req = RequestedAssets[assetInf.Metadata.FullID];
|
||||
req.AssetInf = assetInf;
|
||||
req.NumPackets = CalculateNumPackets(assetInf.Data);
|
||||
|
||||
RequestedAssets.Remove(assetInf.FullID);
|
||||
RequestedAssets.Remove(assetInf.Metadata.FullID);
|
||||
// If it's a direct request for a script, drop it
|
||||
// because it's a hacked client
|
||||
if (req.AssetRequestSource != 2 || assetInf.Type != 10)
|
||||
if (req.AssetRequestSource != 2 || assetInf.Metadata.Type != 10)
|
||||
AssetRequests.Add(req);
|
||||
}
|
||||
}
|
||||
@@ -373,8 +373,8 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
|
||||
lock (RequestLists)
|
||||
{
|
||||
if (RequestLists.TryGetValue(asset.FullID, out reqList))
|
||||
RequestLists.Remove(asset.FullID);
|
||||
if (RequestLists.TryGetValue(asset.Metadata.FullID, out reqList))
|
||||
RequestLists.Remove(asset.Metadata.FullID);
|
||||
}
|
||||
|
||||
if (reqList != null)
|
||||
@@ -385,8 +385,8 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
foreach (NewAssetRequest req in reqList.Requests)
|
||||
{
|
||||
// Xantor 20080526 are we really calling all the callbacks if multiple queued for 1 request? -- Yes, checked
|
||||
// m_log.DebugFormat("[ASSET CACHE]: Callback for asset {0}", asset.FullID);
|
||||
req.Callback(asset.FullID, asset);
|
||||
// m_log.DebugFormat("[ASSET CACHE]: Callback for asset {0}", asset.Metadata.FullID);
|
||||
req.Callback(asset.Metadata.FullID, asset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,12 +398,12 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
|
||||
// Remember the fact that this asset could not be found to prevent delays from repeated requests
|
||||
m_memcache.Add(assetID, null, TimeSpan.FromHours(24));
|
||||
|
||||
|
||||
// Notify requesters for this asset
|
||||
AssetRequestsList reqList;
|
||||
lock (RequestLists)
|
||||
{
|
||||
if (RequestLists.TryGetValue(assetID, out reqList))
|
||||
if (RequestLists.TryGetValue(assetID, out reqList))
|
||||
RequestLists.Remove(assetID);
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
if (StatsManager.SimExtraStats != null)
|
||||
StatsManager.SimExtraStats.AddAssetRequestTimeAfterCacheMiss(DateTime.Now - reqList.TimeRequested);
|
||||
|
||||
|
||||
foreach (NewAssetRequest req in reqList.Requests)
|
||||
{
|
||||
req.Callback(assetID, null);
|
||||
@@ -461,7 +461,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
source = 3;
|
||||
//Console.WriteLine("asset request " + requestID);
|
||||
}
|
||||
|
||||
|
||||
//check to see if asset is in local cache, if not we need to request it from asset server.
|
||||
//Console.WriteLine("asset request " + requestID);
|
||||
if (!m_memcache.Contains(requestID))
|
||||
@@ -494,7 +494,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
}
|
||||
|
||||
// Scripts cannot be retrieved by direct request
|
||||
if (transferRequest.TransferInfo.SourceType == 2 && asset.Type == 10)
|
||||
if (transferRequest.TransferInfo.SourceType == 2 && asset.Metadata.Type == 10)
|
||||
return;
|
||||
|
||||
// The asset is knosn to exist and is in our cache, so add it to the AssetRequests list
|
||||
@@ -520,7 +520,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
//no requests waiting
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// if less than 5, do all of them
|
||||
int num = Math.Min(5, AssetRequests.Count);
|
||||
|
||||
@@ -580,10 +580,10 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
public AssetInfo(AssetBase aBase)
|
||||
{
|
||||
Data = aBase.Data;
|
||||
FullID = aBase.FullID;
|
||||
Type = aBase.Type;
|
||||
Name = aBase.Name;
|
||||
Description = aBase.Description;
|
||||
Metadata.FullID = aBase.Metadata.FullID;
|
||||
Metadata.Type = aBase.Metadata.Type;
|
||||
Metadata.Name = aBase.Metadata.Name;
|
||||
Metadata.Description = aBase.Metadata.Description;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,10 +592,10 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
public TextureImage(AssetBase aBase)
|
||||
{
|
||||
Data = aBase.Data;
|
||||
FullID = aBase.FullID;
|
||||
Type = aBase.Type;
|
||||
Name = aBase.Name;
|
||||
Description = aBase.Description;
|
||||
Metadata.FullID = aBase.Metadata.FullID;
|
||||
Metadata.Type = aBase.Metadata.Type;
|
||||
Metadata.Name = aBase.Metadata.Name;
|
||||
Metadata.Description = aBase.Metadata.Description;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
/// A list of requests for assets
|
||||
/// </summary>
|
||||
public List<NewAssetRequest> Requests = new List<NewAssetRequest>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Record the time that this request was first made.
|
||||
/// </summary>
|
||||
|
||||
@@ -86,11 +86,11 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
|
||||
#region Rjindael
|
||||
/// <summary>
|
||||
/// This class uses a symmetric key algorithm (Rijndael/AES) to encrypt and
|
||||
/// This class uses a symmetric key algorithm (Rijndael/AES) to encrypt and
|
||||
/// decrypt data. As long as encryption and decryption routines use the same
|
||||
/// parameters to generate the keys, the keys are guaranteed to be the same.
|
||||
/// The class uses static functions with duplicate code to make it easier to
|
||||
/// demonstrate encryption and decryption logic. In a real-life application,
|
||||
/// demonstrate encryption and decryption logic. In a real-life application,
|
||||
/// this may not be the most efficient way of handling encryption, so - as
|
||||
/// soon as you feel comfortable with it - you may want to redesign this class.
|
||||
/// </summary>
|
||||
@@ -123,11 +123,11 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
/// </param>
|
||||
/// <param name="initVector">
|
||||
/// Initialization vector (or IV). This value is required to encrypt the
|
||||
/// first block of plaintext data. For RijndaelManaged class IV must be
|
||||
/// first block of plaintext data. For RijndaelManaged class IV must be
|
||||
/// exactly 16 ASCII characters long.
|
||||
/// </param>
|
||||
/// <param name="keySize">
|
||||
/// Size of encryption key in bits. Allowed values are: 128, 192, and 256.
|
||||
/// Size of encryption key in bits. Allowed values are: 128, 192, and 256.
|
||||
/// Longer keys are more secure than shorter keys.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
// Convert strings into byte arrays.
|
||||
// Let us assume that strings only contain ASCII codes.
|
||||
// If strings include Unicode characters, use Unicode, UTF7, or UTF8
|
||||
// If strings include Unicode characters, use Unicode, UTF7, or UTF8
|
||||
// encoding.
|
||||
byte[] initVectorBytes = Encoding.ASCII.GetBytes(initVector);
|
||||
byte[] saltValueBytes = Encoding.ASCII.GetBytes(saltValue);
|
||||
@@ -153,8 +153,8 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
byte[] plainTextBytes = plainText;
|
||||
|
||||
// First, we must create a password, from which the key will be derived.
|
||||
// This password will be generated from the specified passphrase and
|
||||
// salt value. The password will be created using the specified hash
|
||||
// This password will be generated from the specified passphrase and
|
||||
// salt value. The password will be created using the specified hash
|
||||
// algorithm. Password creation can be done in several iterations.
|
||||
PasswordDeriveBytes password = new PasswordDeriveBytes(
|
||||
passPhrase,
|
||||
@@ -173,8 +173,8 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
// (CBC). Use default options for other symmetric key parameters.
|
||||
symmetricKey.Mode = CipherMode.CBC;
|
||||
|
||||
// Generate encryptor from the existing key bytes and initialization
|
||||
// vector. Key size will be defined based on the number of the key
|
||||
// Generate encryptor from the existing key bytes and initialization
|
||||
// vector. Key size will be defined based on the number of the key
|
||||
// bytes.
|
||||
ICryptoTransform encryptor = symmetricKey.CreateEncryptor(
|
||||
keyBytes,
|
||||
@@ -265,8 +265,8 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
// Convert our ciphertext into a byte array.
|
||||
byte[] cipherTextBytes = cipherText;
|
||||
|
||||
// First, we must create a password, from which the key will be
|
||||
// derived. This password will be generated from the specified
|
||||
// First, we must create a password, from which the key will be
|
||||
// derived. This password will be generated from the specified
|
||||
// passphrase and salt value. The password will be created using
|
||||
// the specified hash algorithm. Password creation can be done in
|
||||
// several iterations.
|
||||
@@ -286,8 +286,8 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
// (CBC). Use default options for other symmetric key parameters.
|
||||
symmetricKey.Mode = CipherMode.CBC;
|
||||
|
||||
// Generate decryptor from the existing key bytes and initialization
|
||||
// vector. Key size will be defined based on the number of the key
|
||||
// Generate decryptor from the existing key bytes and initialization
|
||||
// vector. Key size will be defined based on the number of the key
|
||||
// bytes.
|
||||
ICryptoTransform decryptor = symmetricKey.CreateDecryptor(
|
||||
keyBytes,
|
||||
@@ -320,7 +320,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
for (i = 0; i < decryptedByteCount; i++)
|
||||
plainText[i] = plainTextBytes[i];
|
||||
|
||||
// Return decrypted string.
|
||||
// Return decrypted string.
|
||||
return plainText;
|
||||
}
|
||||
}
|
||||
@@ -403,17 +403,17 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
string salt = Convert.ToBase64String(rand);
|
||||
|
||||
x.Data = UtilRijndael.Encrypt(x.Data, file.Secret, salt, "SHA1", 2, file.IVBytes, file.Keysize);
|
||||
x.Description = String.Format("ENCASS#:~:#{0}#:~:#{1}#:~:#{2}#:~:#{3}",
|
||||
"OPENSIM_AES_AF1",
|
||||
file.AlsoKnownAs,
|
||||
salt,
|
||||
x.Description);
|
||||
x.Metadata.Description = String.Format("ENCASS#:~:#{0}#:~:#{1}#:~:#{2}#:~:#{3}",
|
||||
"OPENSIM_AES_AF1",
|
||||
file.AlsoKnownAs,
|
||||
salt,
|
||||
x.Metadata.Description);
|
||||
}
|
||||
|
||||
private bool DecryptAssetBase(AssetBase x)
|
||||
{
|
||||
// Check it's encrypted first.
|
||||
if (!x.Description.Contains("ENCASS"))
|
||||
if (!x.Metadata.Description.Contains("ENCASS"))
|
||||
return true;
|
||||
|
||||
// ENCASS:ALG:AKA:SALT:Description
|
||||
@@ -421,7 +421,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
string[] splitchars = new string[1];
|
||||
splitchars[0] = "#:~:#";
|
||||
|
||||
string[] meta = x.Description.Split(splitchars, StringSplitOptions.None);
|
||||
string[] meta = x.Metadata.Description.Split(splitchars, StringSplitOptions.None);
|
||||
if (meta.Length < 5)
|
||||
{
|
||||
m_log.Warn("[ENCASSETS] Recieved Encrypted Asset, but header is corrupt");
|
||||
@@ -432,7 +432,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
if (m_keyfiles.ContainsKey(meta[2]))
|
||||
{
|
||||
RjinKeyfile deckey = m_keyfiles[meta[2]];
|
||||
x.Description = meta[4];
|
||||
x.Metadata.Description = meta[4];
|
||||
switch (meta[1])
|
||||
{
|
||||
case "OPENSIM_AES_AF1":
|
||||
@@ -506,7 +506,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
string assetUrl = _assetServerUrl + "/assets/";
|
||||
|
||||
m_log.InfoFormat("[CRYPTO GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID);
|
||||
m_log.InfoFormat("[CRYPTO GRID ASSET CLIENT]: Sending store request for asset {0}", asset.Metadata.FullID);
|
||||
|
||||
RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
}
|
||||
public override void StoreAsset(AssetBase asset)
|
||||
{
|
||||
byte[] idBytes = asset.FullID.Guid.ToByteArray();
|
||||
byte[] idBytes = asset.Metadata.FullID.Guid.ToByteArray();
|
||||
|
||||
string cdir = m_dir + Path.DirectorySeparatorChar + idBytes[0]
|
||||
+ Path.DirectorySeparatorChar + idBytes[1];
|
||||
@@ -56,7 +56,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
if (!Directory.Exists(cdir))
|
||||
Directory.CreateDirectory(cdir);
|
||||
|
||||
FileStream x = new FileStream(cdir + Path.DirectorySeparatorChar + asset.FullID + ".xml", FileMode.Create);
|
||||
FileStream x = new FileStream(cdir + Path.DirectorySeparatorChar + asset.Metadata.FullID + ".xml", FileMode.Create);
|
||||
m_xs.Serialize(x, asset);
|
||||
|
||||
x.Flush();
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
// rc.Request(s);
|
||||
//m_log.InfoFormat("[ASSET]: Stored {0}", rc);
|
||||
|
||||
m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID);
|
||||
m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.Metadata.FullID);
|
||||
|
||||
RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||
m_capsHandlers["SEED"] = new RestStreamHandler("POST", capsBase + m_requestPath, CapsRequest);
|
||||
m_log.DebugFormat(
|
||||
"[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_agentID);
|
||||
|
||||
|
||||
//m_capsHandlers["MapLayer"] =
|
||||
// new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
|
||||
// capsBase + m_mapLayerPath,
|
||||
@@ -247,9 +247,9 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||
//m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
||||
|
||||
string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails);
|
||||
|
||||
|
||||
//m_log.DebugFormat("[CAPS] CapsRequest {0}", result);
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||
|
||||
m_httpListener.AddStreamHandler(
|
||||
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
|
||||
|
||||
string protocol = "http://";
|
||||
|
||||
if (m_httpListener.UseSSL)
|
||||
@@ -648,7 +648,7 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||
/// <returns></returns>
|
||||
public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest)
|
||||
{
|
||||
if (llsdRequest.asset_type == "texture" ||
|
||||
if (llsdRequest.asset_type == "texture" ||
|
||||
llsdRequest.asset_type == "animation" ||
|
||||
llsdRequest.asset_type == "sound")
|
||||
{
|
||||
@@ -741,9 +741,9 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||
|
||||
AssetBase asset;
|
||||
asset = new AssetBase();
|
||||
asset.FullID = assetID;
|
||||
asset.Type = assType;
|
||||
asset.Name = assetName;
|
||||
asset.Metadata.FullID = assetID;
|
||||
asset.Metadata.Type = assType;
|
||||
asset.Metadata.Name = assetName;
|
||||
asset.Data = data;
|
||||
m_assetCache.AddAsset(asset);
|
||||
|
||||
@@ -751,7 +751,7 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||
item.Owner = m_agentID;
|
||||
item.Creator = m_agentID;
|
||||
item.ID = inventoryItem;
|
||||
item.AssetID = asset.FullID;
|
||||
item.AssetID = asset.Metadata.FullID;
|
||||
item.Description = assetDescription;
|
||||
item.Name = assetName;
|
||||
item.AssetType = assType;
|
||||
|
||||
Reference in New Issue
Block a user