Don't need to try both AssetService.Get and GetCached in GetMesh since Get always calls GetCached and code paths were identical
parent
49258350e8
commit
3146f4bae0
|
@ -57,7 +57,6 @@ namespace OpenSim.Capabilities.Handlers
|
|||
|
||||
public Hashtable ProcessGetMesh(Hashtable request, UUID AgentId, Caps cap)
|
||||
{
|
||||
|
||||
Hashtable responsedata = new Hashtable();
|
||||
responsedata["int_response_code"] = 400; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
|
@ -69,7 +68,6 @@ namespace OpenSim.Capabilities.Handlers
|
|||
if (request.ContainsKey("mesh_id"))
|
||||
meshStr = request["mesh_id"].ToString();
|
||||
|
||||
|
||||
UUID meshID = UUID.Zero;
|
||||
if (!String.IsNullOrEmpty(meshStr) && UUID.TryParse(meshStr, out meshID))
|
||||
{
|
||||
|
@ -82,12 +80,11 @@ namespace OpenSim.Capabilities.Handlers
|
|||
return responsedata;
|
||||
}
|
||||
|
||||
AssetBase mesh;
|
||||
// Only try to fetch locally cached textures. Misses are redirected
|
||||
mesh = m_assetService.GetCached(meshID.ToString());
|
||||
AssetBase mesh = m_assetService.Get(meshID.ToString());
|
||||
|
||||
if (mesh != null)
|
||||
{
|
||||
if (mesh.Type == (SByte)AssetType.Mesh)
|
||||
if (mesh.Type == (SByte)AssetType.Mesh)
|
||||
{
|
||||
responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
|
||||
responsedata["content_type"] = "application/vnd.ll.mesh";
|
||||
|
@ -105,39 +102,15 @@ namespace OpenSim.Capabilities.Handlers
|
|||
}
|
||||
else
|
||||
{
|
||||
mesh = m_assetService.Get(meshID.ToString());
|
||||
if (mesh != null)
|
||||
{
|
||||
if (mesh.Type == (SByte)AssetType.Mesh)
|
||||
{
|
||||
responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
|
||||
responsedata["content_type"] = "application/vnd.ll.mesh";
|
||||
responsedata["int_response_code"] = 200;
|
||||
}
|
||||
// Optionally add additional mesh types here
|
||||
else
|
||||
{
|
||||
responsedata["int_response_code"] = 404; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh.";
|
||||
return responsedata;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
responsedata["int_response_code"] = 404; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!";
|
||||
return responsedata;
|
||||
}
|
||||
responsedata["int_response_code"] = 404; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!";
|
||||
return responsedata;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return responsedata;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -56,7 +56,7 @@ namespace OpenSim.Services.Interfaces
|
|||
byte[] GetData(string id);
|
||||
|
||||
/// <summary>
|
||||
/// Synchronously fetches an asset from the local cache only
|
||||
/// Synchronously fetches an asset from the local cache only.
|
||||
/// </summary>
|
||||
/// <param name="id">Asset ID</param>
|
||||
/// <returns>The fetched asset, or null if it did not exist in the local cache</returns>
|
||||
|
@ -75,7 +75,9 @@ namespace OpenSim.Services.Interfaces
|
|||
/// <summary>
|
||||
/// Creates a new asset
|
||||
/// </summary>
|
||||
/// Returns a random ID if none is passed into it
|
||||
/// <remarks>
|
||||
/// Returns a random ID if none is passed via the asset argument.
|
||||
/// </remarks>
|
||||
/// <param name="asset"></param>
|
||||
/// <returns></returns>
|
||||
string Store(AssetBase asset);
|
||||
|
@ -83,7 +85,9 @@ namespace OpenSim.Services.Interfaces
|
|||
/// <summary>
|
||||
/// Update an asset's content
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Attachments and bare scripts need this!!
|
||||
/// </remarks>
|
||||
/// <param name="id"> </param>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
|
|
Loading…
Reference in New Issue