diff options
author | UbitUmarov | 2016-12-27 12:26:08 +0000 |
---|---|---|
committer | UbitUmarov | 2016-12-27 12:26:08 +0000 |
commit | 5c79e03f18dcb85f777debff60f46e1dff816ccf (patch) | |
tree | 06445030a04d31ee9bc281cd50997d3fe5a0c3d0 /OpenSim/Capabilities | |
parent | fix typos (thanks you know who) (diff) | |
download | opensim-SC-5c79e03f18dcb85f777debff60f46e1dff816ccf.zip opensim-SC-5c79e03f18dcb85f777debff60f46e1dff816ccf.tar.gz opensim-SC-5c79e03f18dcb85f777debff60f46e1dff816ccf.tar.bz2 opensim-SC-5c79e03f18dcb85f777debff60f46e1dff816ccf.tar.xz |
some cleanup
Diffstat (limited to 'OpenSim/Capabilities')
-rw-r--r-- | OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs index a9b81f3..a0471bb 100644 --- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs | |||
@@ -64,10 +64,7 @@ namespace OpenSim.Capabilities.Handlers | |||
64 | Hashtable ret = new Hashtable(); | 64 | Hashtable ret = new Hashtable(); |
65 | ret["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound; | 65 | ret["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound; |
66 | ret["content_type"] = "text/plain"; | 66 | ret["content_type"] = "text/plain"; |
67 | ret["keepalive"] = false; | ||
68 | ret["reusecontext"] = false; | ||
69 | ret["int_bytes"] = 0; | 67 | ret["int_bytes"] = 0; |
70 | ret["int_lod"] = 0; | ||
71 | string MeshStr = (string)request["mesh_id"]; | 68 | string MeshStr = (string)request["mesh_id"]; |
72 | 69 | ||
73 | 70 | ||
@@ -76,6 +73,8 @@ namespace OpenSim.Capabilities.Handlers | |||
76 | if (m_assetService == null) | 73 | if (m_assetService == null) |
77 | { | 74 | { |
78 | m_log.Error("[GETMESH]: Cannot fetch mesh " + MeshStr + " without an asset service"); | 75 | m_log.Error("[GETMESH]: Cannot fetch mesh " + MeshStr + " without an asset service"); |
76 | ret["keepalive"] = false; | ||
77 | return ret; | ||
79 | } | 78 | } |
80 | 79 | ||
81 | UUID meshID; | 80 | UUID meshID; |
@@ -101,10 +100,7 @@ namespace OpenSim.Capabilities.Handlers | |||
101 | Hashtable responsedata = new Hashtable(); | 100 | Hashtable responsedata = new Hashtable(); |
102 | responsedata["int_response_code"] = 400; //501; //410; //404; | 101 | responsedata["int_response_code"] = 400; //501; //410; //404; |
103 | responsedata["content_type"] = "text/plain"; | 102 | responsedata["content_type"] = "text/plain"; |
104 | responsedata["keepalive"] = false; | ||
105 | responsedata["str_response_string"] = "Request wasn't what was expected"; | 103 | responsedata["str_response_string"] = "Request wasn't what was expected"; |
106 | responsedata["reusecontext"] = false; | ||
107 | responsedata["int_lod"] = 0; | ||
108 | responsedata["int_bytes"] = 0; | 104 | responsedata["int_bytes"] = 0; |
109 | 105 | ||
110 | string meshStr = string.Empty; | 106 | string meshStr = string.Empty; |
@@ -118,10 +114,8 @@ namespace OpenSim.Capabilities.Handlers | |||
118 | if (m_assetService == null) | 114 | if (m_assetService == null) |
119 | { | 115 | { |
120 | responsedata["int_response_code"] = 404; //501; //410; //404; | 116 | responsedata["int_response_code"] = 404; //501; //410; //404; |
121 | responsedata["content_type"] = "text/plain"; | ||
122 | responsedata["keepalive"] = false; | 117 | responsedata["keepalive"] = false; |
123 | responsedata["str_response_string"] = "The asset service is unavailable. So is your mesh."; | 118 | responsedata["str_response_string"] = "The asset service is unavailable. So is your mesh."; |
124 | responsedata["reusecontext"] = false; | ||
125 | return responsedata; | 119 | return responsedata; |
126 | } | 120 | } |
127 | 121 | ||
@@ -155,10 +149,7 @@ namespace OpenSim.Capabilities.Handlers | |||
155 | { | 149 | { |
156 | responsedata["int_response_code"] = 404; //501; //410; //404; | 150 | responsedata["int_response_code"] = 404; //501; //410; //404; |
157 | responsedata["content_type"] = "text/plain"; | 151 | responsedata["content_type"] = "text/plain"; |
158 | responsedata["keepalive"] = false; | ||
159 | responsedata["str_response_string"] = "This range doesnt exist."; | 152 | responsedata["str_response_string"] = "This range doesnt exist."; |
160 | responsedata["reusecontext"] = false; | ||
161 | responsedata["int_lod"] = 3; | ||
162 | return responsedata; | 153 | return responsedata; |
163 | } | 154 | } |
164 | else | 155 | else |
@@ -169,28 +160,11 @@ namespace OpenSim.Capabilities.Handlers | |||
169 | 160 | ||
170 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); | 161 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); |
171 | 162 | ||
172 | if (start > 20000) | ||
173 | { | ||
174 | responsedata["int_lod"] = 3; | ||
175 | } | ||
176 | else if (start < 4097) | ||
177 | { | ||
178 | responsedata["int_lod"] = 1; | ||
179 | } | ||
180 | else | ||
181 | { | ||
182 | responsedata["int_lod"] = 2; | ||
183 | } | ||
184 | |||
185 | |||
186 | if (start == 0 && len == mesh.Data.Length) // well redudante maybe | 163 | if (start == 0 && len == mesh.Data.Length) // well redudante maybe |
187 | { | 164 | { |
188 | responsedata["int_response_code"] = (int)System.Net.HttpStatusCode.OK; | 165 | responsedata["int_response_code"] = (int)System.Net.HttpStatusCode.OK; |
189 | responsedata["bin_response_data"] = mesh.Data; | 166 | responsedata["bin_response_data"] = mesh.Data; |
190 | responsedata["int_bytes"] = mesh.Data.Length; | 167 | responsedata["int_bytes"] = mesh.Data.Length; |
191 | responsedata["reusecontext"] = false; | ||
192 | responsedata["int_lod"] = 3; | ||
193 | |||
194 | } | 168 | } |
195 | else | 169 | else |
196 | { | 170 | { |
@@ -203,7 +177,6 @@ namespace OpenSim.Capabilities.Handlers | |||
203 | Array.Copy(mesh.Data, start, d, 0, len); | 177 | Array.Copy(mesh.Data, start, d, 0, len); |
204 | responsedata["bin_response_data"] = d; | 178 | responsedata["bin_response_data"] = d; |
205 | responsedata["int_bytes"] = len; | 179 | responsedata["int_bytes"] = len; |
206 | responsedata["reusecontext"] = false; | ||
207 | } | 180 | } |
208 | } | 181 | } |
209 | } | 182 | } |
@@ -213,8 +186,6 @@ namespace OpenSim.Capabilities.Handlers | |||
213 | responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); | 186 | responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); |
214 | responsedata["content_type"] = "application/vnd.ll.mesh"; | 187 | responsedata["content_type"] = "application/vnd.ll.mesh"; |
215 | responsedata["int_response_code"] = 200; | 188 | responsedata["int_response_code"] = 200; |
216 | responsedata["reusecontext"] = false; | ||
217 | responsedata["int_lod"] = 3; | ||
218 | } | 189 | } |
219 | } | 190 | } |
220 | else | 191 | else |
@@ -222,8 +193,6 @@ namespace OpenSim.Capabilities.Handlers | |||
222 | responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); | 193 | responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); |
223 | responsedata["content_type"] = "application/vnd.ll.mesh"; | 194 | responsedata["content_type"] = "application/vnd.ll.mesh"; |
224 | responsedata["int_response_code"] = 200; | 195 | responsedata["int_response_code"] = 200; |
225 | responsedata["reusecontext"] = false; | ||
226 | responsedata["int_lod"] = 3; | ||
227 | } | 196 | } |
228 | } | 197 | } |
229 | // Optionally add additional mesh types here | 198 | // Optionally add additional mesh types here |
@@ -231,10 +200,7 @@ namespace OpenSim.Capabilities.Handlers | |||
231 | { | 200 | { |
232 | responsedata["int_response_code"] = 404; //501; //410; //404; | 201 | responsedata["int_response_code"] = 404; //501; //410; //404; |
233 | responsedata["content_type"] = "text/plain"; | 202 | responsedata["content_type"] = "text/plain"; |
234 | responsedata["keepalive"] = false; | ||
235 | responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh."; | 203 | responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh."; |
236 | responsedata["reusecontext"] = false; | ||
237 | responsedata["int_lod"] = 1; | ||
238 | return responsedata; | 204 | return responsedata; |
239 | } | 205 | } |
240 | } | 206 | } |
@@ -242,10 +208,7 @@ namespace OpenSim.Capabilities.Handlers | |||
242 | { | 208 | { |
243 | responsedata["int_response_code"] = 404; //501; //410; //404; | 209 | responsedata["int_response_code"] = 404; //501; //410; //404; |
244 | responsedata["content_type"] = "text/plain"; | 210 | responsedata["content_type"] = "text/plain"; |
245 | responsedata["keepalive"] = false; | ||
246 | responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!"; | 211 | responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!"; |
247 | responsedata["reusecontext"] = false; | ||
248 | responsedata["int_lod"] = 0; | ||
249 | return responsedata; | 212 | return responsedata; |
250 | } | 213 | } |
251 | } | 214 | } |