aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs')
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs92
1 files changed, 46 insertions, 46 deletions
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index 433ed0b..d99b791 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -69,13 +69,13 @@ namespace OpenSim.Server.Handlers.Grid
69 69
70 try 70 try
71 { 71 {
72 Dictionary<string, string> request = 72 Dictionary<string, object> request =
73 ServerUtils.ParseQueryString(body); 73 ServerUtils.ParseQueryString(body);
74 74
75 if (!request.ContainsKey("METHOD")) 75 if (!request.ContainsKey("METHOD"))
76 return FailureResult(); 76 return FailureResult();
77 77
78 string method = request["METHOD"]; 78 string method = request["METHOD"].ToString();
79 79
80 switch (method) 80 switch (method)
81 { 81 {
@@ -117,22 +117,22 @@ namespace OpenSim.Server.Handlers.Grid
117 117
118 #region Method-specific handlers 118 #region Method-specific handlers
119 119
120 byte[] Register(Dictionary<string, string> request) 120 byte[] Register(Dictionary<string, object> request)
121 { 121 {
122 UUID scopeID = UUID.Zero; 122 UUID scopeID = UUID.Zero;
123 if (request.ContainsKey("SCOPEID")) 123 if (request.ContainsKey("SCOPEID"))
124 UUID.TryParse(request["SCOPEID"], out scopeID); 124 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
125 else 125 else
126 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); 126 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region");
127 127
128 int versionNumberMin = 0, versionNumberMax = 0; 128 int versionNumberMin = 0, versionNumberMax = 0;
129 if (request.ContainsKey("VERSIONMIN")) 129 if (request.ContainsKey("VERSIONMIN"))
130 Int32.TryParse(request["VERSIONMIN"], out versionNumberMin); 130 Int32.TryParse(request["VERSIONMIN"].ToString(), out versionNumberMin);
131 else 131 else
132 m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region"); 132 m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region");
133 133
134 if (request.ContainsKey("VERSIONMAX")) 134 if (request.ContainsKey("VERSIONMAX"))
135 Int32.TryParse(request["VERSIONMAX"], out versionNumberMax); 135 Int32.TryParse(request["VERSIONMAX"].ToString(), out versionNumberMax);
136 else 136 else
137 m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region"); 137 m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region");
138 138
@@ -147,8 +147,8 @@ namespace OpenSim.Server.Handlers.Grid
147 GridRegion rinfo = null; 147 GridRegion rinfo = null;
148 try 148 try
149 { 149 {
150 foreach (KeyValuePair<string, string> kvp in request) 150 foreach (KeyValuePair<string, object> kvp in request)
151 rinfoData[kvp.Key] = kvp.Value; 151 rinfoData[kvp.Key] = kvp.Value.ToString();
152 rinfo = new GridRegion(rinfoData); 152 rinfo = new GridRegion(rinfoData);
153 } 153 }
154 catch (Exception e) 154 catch (Exception e)
@@ -166,11 +166,11 @@ namespace OpenSim.Server.Handlers.Grid
166 return FailureResult(); 166 return FailureResult();
167 } 167 }
168 168
169 byte[] Deregister(Dictionary<string, string> request) 169 byte[] Deregister(Dictionary<string, object> request)
170 { 170 {
171 UUID regionID = UUID.Zero; 171 UUID regionID = UUID.Zero;
172 if (request["REGIONID"] != null) 172 if (request.ContainsKey("REGIONID"))
173 UUID.TryParse(request["REGIONID"], out regionID); 173 UUID.TryParse(request["REGIONID"].ToString(), out regionID);
174 else 174 else
175 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region"); 175 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region");
176 176
@@ -183,17 +183,17 @@ namespace OpenSim.Server.Handlers.Grid
183 183
184 } 184 }
185 185
186 byte[] GetNeighbours(Dictionary<string, string> request) 186 byte[] GetNeighbours(Dictionary<string, object> request)
187 { 187 {
188 UUID scopeID = UUID.Zero; 188 UUID scopeID = UUID.Zero;
189 if (request["SCOPEID"] != null) 189 if (request.ContainsKey("SCOPEID"))
190 UUID.TryParse(request["SCOPEID"], out scopeID); 190 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
191 else 191 else
192 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); 192 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours");
193 193
194 UUID regionID = UUID.Zero; 194 UUID regionID = UUID.Zero;
195 if (request["REGIONID"] != null) 195 if (request.ContainsKey("REGIONID"))
196 UUID.TryParse(request["REGIONID"], out regionID); 196 UUID.TryParse(request["REGIONID"].ToString(), out regionID);
197 else 197 else
198 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); 198 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours");
199 199
@@ -221,17 +221,17 @@ namespace OpenSim.Server.Handlers.Grid
221 221
222 } 222 }
223 223
224 byte[] GetRegionByUUID(Dictionary<string, string> request) 224 byte[] GetRegionByUUID(Dictionary<string, object> request)
225 { 225 {
226 UUID scopeID = UUID.Zero; 226 UUID scopeID = UUID.Zero;
227 if (request["SCOPEID"] != null) 227 if (request.ContainsKey("SCOPEID"))
228 UUID.TryParse(request["SCOPEID"], out scopeID); 228 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
229 else 229 else
230 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); 230 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours");
231 231
232 UUID regionID = UUID.Zero; 232 UUID regionID = UUID.Zero;
233 if (request["REGIONID"] != null) 233 if (request.ContainsKey("REGIONID"))
234 UUID.TryParse(request["REGIONID"], out regionID); 234 UUID.TryParse(request["REGIONID"].ToString(), out regionID);
235 else 235 else
236 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); 236 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours");
237 237
@@ -250,21 +250,21 @@ namespace OpenSim.Server.Handlers.Grid
250 return encoding.GetBytes(xmlString); 250 return encoding.GetBytes(xmlString);
251 } 251 }
252 252
253 byte[] GetRegionByPosition(Dictionary<string, string> request) 253 byte[] GetRegionByPosition(Dictionary<string, object> request)
254 { 254 {
255 UUID scopeID = UUID.Zero; 255 UUID scopeID = UUID.Zero;
256 if (request["SCOPEID"] != null) 256 if (request.ContainsKey("SCOPEID"))
257 UUID.TryParse(request["SCOPEID"], out scopeID); 257 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
258 else 258 else
259 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position"); 259 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position");
260 260
261 int x = 0, y = 0; 261 int x = 0, y = 0;
262 if (request["X"] != null) 262 if (request.ContainsKey("X"))
263 Int32.TryParse(request["X"], out x); 263 Int32.TryParse(request["X"].ToString(), out x);
264 else 264 else
265 m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position"); 265 m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position");
266 if (request["Y"] != null) 266 if (request.ContainsKey("Y"))
267 Int32.TryParse(request["Y"], out y); 267 Int32.TryParse(request["Y"].ToString(), out y);
268 else 268 else
269 m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); 269 m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position");
270 270
@@ -283,17 +283,17 @@ namespace OpenSim.Server.Handlers.Grid
283 return encoding.GetBytes(xmlString); 283 return encoding.GetBytes(xmlString);
284 } 284 }
285 285
286 byte[] GetRegionByName(Dictionary<string, string> request) 286 byte[] GetRegionByName(Dictionary<string, object> request)
287 { 287 {
288 UUID scopeID = UUID.Zero; 288 UUID scopeID = UUID.Zero;
289 if (request["SCOPEID"] != null) 289 if (request.ContainsKey("SCOPEID"))
290 UUID.TryParse(request["SCOPEID"], out scopeID); 290 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
291 else 291 else
292 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name"); 292 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name");
293 293
294 string regionName = string.Empty; 294 string regionName = string.Empty;
295 if (request["NAME"] != null) 295 if (request.ContainsKey("NAME"))
296 regionName = request["NAME"]; 296 regionName = request["NAME"].ToString();
297 else 297 else
298 m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name"); 298 m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name");
299 299
@@ -312,23 +312,23 @@ namespace OpenSim.Server.Handlers.Grid
312 return encoding.GetBytes(xmlString); 312 return encoding.GetBytes(xmlString);
313 } 313 }
314 314
315 byte[] GetRegionsByName(Dictionary<string, string> request) 315 byte[] GetRegionsByName(Dictionary<string, object> request)
316 { 316 {
317 UUID scopeID = UUID.Zero; 317 UUID scopeID = UUID.Zero;
318 if (request["SCOPEID"] != null) 318 if (request.ContainsKey("SCOPEID"))
319 UUID.TryParse(request["SCOPEID"], out scopeID); 319 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
320 else 320 else
321 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name"); 321 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name");
322 322
323 string regionName = string.Empty; 323 string regionName = string.Empty;
324 if (request["NAME"] != null) 324 if (request.ContainsKey("NAME"))
325 regionName = request["NAME"]; 325 regionName = request["NAME"].ToString();
326 else 326 else
327 m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name"); 327 m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name");
328 328
329 int max = 0; 329 int max = 0;
330 if (request["MAX"] != null) 330 if (request.ContainsKey("MAX"))
331 Int32.TryParse(request["MAX"], out max); 331 Int32.TryParse(request["MAX"].ToString(), out max);
332 else 332 else
333 m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name"); 333 m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name");
334 334
@@ -355,30 +355,30 @@ namespace OpenSim.Server.Handlers.Grid
355 return encoding.GetBytes(xmlString); 355 return encoding.GetBytes(xmlString);
356 } 356 }
357 357
358 byte[] GetRegionRange(Dictionary<string, string> request) 358 byte[] GetRegionRange(Dictionary<string, object> request)
359 { 359 {
360 //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange"); 360 //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange");
361 UUID scopeID = UUID.Zero; 361 UUID scopeID = UUID.Zero;
362 if (request.ContainsKey("SCOPEID")) 362 if (request.ContainsKey("SCOPEID"))
363 UUID.TryParse(request["SCOPEID"], out scopeID); 363 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
364 else 364 else
365 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range"); 365 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range");
366 366
367 int xmin = 0, xmax = 0, ymin = 0, ymax = 0; 367 int xmin = 0, xmax = 0, ymin = 0, ymax = 0;
368 if (request.ContainsKey("XMIN")) 368 if (request.ContainsKey("XMIN"))
369 Int32.TryParse(request["XMIN"], out xmin); 369 Int32.TryParse(request["XMIN"].ToString(), out xmin);
370 else 370 else
371 m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range"); 371 m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range");
372 if (request.ContainsKey("XMAX")) 372 if (request.ContainsKey("XMAX"))
373 Int32.TryParse(request["XMAX"], out xmax); 373 Int32.TryParse(request["XMAX"].ToString(), out xmax);
374 else 374 else
375 m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range"); 375 m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range");
376 if (request.ContainsKey("YMIN")) 376 if (request.ContainsKey("YMIN"))
377 Int32.TryParse(request["YMIN"], out ymin); 377 Int32.TryParse(request["YMIN"].ToString(), out ymin);
378 else 378 else
379 m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range"); 379 m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range");
380 if (request.ContainsKey("YMAX")) 380 if (request.ContainsKey("YMAX"))
381 Int32.TryParse(request["YMAX"], out ymax); 381 Int32.TryParse(request["YMAX"].ToString(), out ymax);
382 else 382 else
383 m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range"); 383 m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range");
384 384