aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-18 23:36:43 +0100
committerJustin Clark-Casey (justincc)2011-08-18 23:36:43 +0100
commit3146f4bae0d6c0b190fb6b8477c690046a1c79af (patch)
tree40c094016c98abab9b462a8b762bbd868d9d791b /OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
parentrefactor: fold CreateSceneViewer() back into ScenePresence constructor (diff)
downloadopensim-SC-3146f4bae0d6c0b190fb6b8477c690046a1c79af.zip
opensim-SC-3146f4bae0d6c0b190fb6b8477c690046a1c79af.tar.gz
opensim-SC-3146f4bae0d6c0b190fb6b8477c690046a1c79af.tar.bz2
opensim-SC-3146f4bae0d6c0b190fb6b8477c690046a1c79af.tar.xz
Don't need to try both AssetService.Get and GetCached in GetMesh since Get always calls GetCached and code paths were identical
Diffstat (limited to '')
-rw-r--r--OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs45
1 files changed, 9 insertions, 36 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
index c60abb1..720640e 100644
--- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
@@ -57,7 +57,6 @@ namespace OpenSim.Capabilities.Handlers
57 57
58 public Hashtable ProcessGetMesh(Hashtable request, UUID AgentId, Caps cap) 58 public Hashtable ProcessGetMesh(Hashtable request, UUID AgentId, Caps cap)
59 { 59 {
60
61 Hashtable responsedata = new Hashtable(); 60 Hashtable responsedata = new Hashtable();
62 responsedata["int_response_code"] = 400; //501; //410; //404; 61 responsedata["int_response_code"] = 400; //501; //410; //404;
63 responsedata["content_type"] = "text/plain"; 62 responsedata["content_type"] = "text/plain";
@@ -69,7 +68,6 @@ namespace OpenSim.Capabilities.Handlers
69 if (request.ContainsKey("mesh_id")) 68 if (request.ContainsKey("mesh_id"))
70 meshStr = request["mesh_id"].ToString(); 69 meshStr = request["mesh_id"].ToString();
71 70
72
73 UUID meshID = UUID.Zero; 71 UUID meshID = UUID.Zero;
74 if (!String.IsNullOrEmpty(meshStr) && UUID.TryParse(meshStr, out meshID)) 72 if (!String.IsNullOrEmpty(meshStr) && UUID.TryParse(meshStr, out meshID))
75 { 73 {
@@ -82,12 +80,11 @@ namespace OpenSim.Capabilities.Handlers
82 return responsedata; 80 return responsedata;
83 } 81 }
84 82
85 AssetBase mesh; 83 AssetBase mesh = m_assetService.Get(meshID.ToString());
86 // Only try to fetch locally cached textures. Misses are redirected 84
87 mesh = m_assetService.GetCached(meshID.ToString());
88 if (mesh != null) 85 if (mesh != null)
89 { 86 {
90 if (mesh.Type == (SByte)AssetType.Mesh) 87 if (mesh.Type == (SByte)AssetType.Mesh)
91 { 88 {
92 responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); 89 responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
93 responsedata["content_type"] = "application/vnd.ll.mesh"; 90 responsedata["content_type"] = "application/vnd.ll.mesh";
@@ -105,39 +102,15 @@ namespace OpenSim.Capabilities.Handlers
105 } 102 }
106 else 103 else
107 { 104 {
108 mesh = m_assetService.Get(meshID.ToString()); 105 responsedata["int_response_code"] = 404; //501; //410; //404;
109 if (mesh != null) 106 responsedata["content_type"] = "text/plain";
110 { 107 responsedata["keepalive"] = false;
111 if (mesh.Type == (SByte)AssetType.Mesh) 108 responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!";
112 { 109 return responsedata;
113 responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
114 responsedata["content_type"] = "application/vnd.ll.mesh";
115 responsedata["int_response_code"] = 200;
116 }
117 // Optionally add additional mesh types here
118 else
119 {
120 responsedata["int_response_code"] = 404; //501; //410; //404;
121 responsedata["content_type"] = "text/plain";
122 responsedata["keepalive"] = false;
123 responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh.";
124 return responsedata;
125 }
126 }
127
128 else
129 {
130 responsedata["int_response_code"] = 404; //501; //410; //404;
131 responsedata["content_type"] = "text/plain";
132 responsedata["keepalive"] = false;
133 responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!";
134 return responsedata;
135 }
136 } 110 }
137
138 } 111 }
139 112
140 return responsedata; 113 return responsedata;
141 } 114 }
142 } 115 }
143} 116} \ No newline at end of file