aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
authorMelanie2009-12-27 03:31:53 +0000
committerMelanie2009-12-27 03:31:53 +0000
commit9cef5f92a1c3edf2ef475706931f1536f2c8524f (patch)
tree8d467f353c68e3decfd3234c65d23a4f146d6e52 /OpenSim/Server
parentAdd the MySQL presence data module (diff)
downloadopensim-SC-9cef5f92a1c3edf2ef475706931f1536f2c8524f.zip
opensim-SC-9cef5f92a1c3edf2ef475706931f1536f2c8524f.tar.gz
opensim-SC-9cef5f92a1c3edf2ef475706931f1536f2c8524f.tar.bz2
opensim-SC-9cef5f92a1c3edf2ef475706931f1536f2c8524f.tar.xz
Change the signature of the forms requester data in preparation to getting
to where lists can be sent as requests
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs12
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs14
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs92
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs8
4 files changed, 63 insertions, 63 deletions
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 0964caa..413a078 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -160,9 +160,9 @@ namespace OpenSim.Server.Base
160 } 160 }
161 } 161 }
162 162
163 public static Dictionary<string, string> ParseQueryString(string query) 163 public static Dictionary<string, object> ParseQueryString(string query)
164 { 164 {
165 Dictionary<string, string> result = new Dictionary<string, string>(); 165 Dictionary<string, object> result = new Dictionary<string, object>();
166 string[] terms = query.Split(new char[] {'&'}); 166 string[] terms = query.Split(new char[] {'&'});
167 167
168 if (terms.Length == 0) 168 if (terms.Length == 0)
@@ -186,17 +186,17 @@ namespace OpenSim.Server.Base
186 return result; 186 return result;
187 } 187 }
188 188
189 public static string BuildQueryString(Dictionary<string, string> data) 189 public static string BuildQueryString(Dictionary<string, object> data)
190 { 190 {
191 string qstring = String.Empty; 191 string qstring = String.Empty;
192 192
193 foreach (KeyValuePair<string, string> kvp in data) 193 foreach (KeyValuePair<string, object> kvp in data)
194 { 194 {
195 string part; 195 string part;
196 if (kvp.Value != String.Empty) 196 if (kvp.Value.ToString() != String.Empty)
197 { 197 {
198 part = System.Web.HttpUtility.UrlEncode(kvp.Key) + 198 part = System.Web.HttpUtility.UrlEncode(kvp.Key) +
199 "=" + System.Web.HttpUtility.UrlEncode(kvp.Value); 199 "=" + System.Web.HttpUtility.UrlEncode(kvp.Value.ToString());
200 } 200 }
201 else 201 else
202 { 202 {
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
index 490a13a..47bc860 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
@@ -86,14 +86,14 @@ namespace OpenSim.Server.Handlers.Authentication
86 86
87 private byte[] DoPlainMethods(string body) 87 private byte[] DoPlainMethods(string body)
88 { 88 {
89 Dictionary<string, string> request = 89 Dictionary<string, object> request =
90 ServerUtils.ParseQueryString(body); 90 ServerUtils.ParseQueryString(body);
91 91
92 int lifetime = 30; 92 int lifetime = 30;
93 93
94 if (request.ContainsKey("LIFETIME")) 94 if (request.ContainsKey("LIFETIME"))
95 { 95 {
96 lifetime = Convert.ToInt32(request["LIFETIME"]); 96 lifetime = Convert.ToInt32(request["LIFETIME"].ToString());
97 if (lifetime > 30) 97 if (lifetime > 30)
98 lifetime = 30; 98 lifetime = 30;
99 } 99 }
@@ -103,12 +103,12 @@ namespace OpenSim.Server.Handlers.Authentication
103 if (!request.ContainsKey("PRINCIPAL")) 103 if (!request.ContainsKey("PRINCIPAL"))
104 return FailureResult(); 104 return FailureResult();
105 105
106 string method = request["METHOD"]; 106 string method = request["METHOD"].ToString();
107 107
108 UUID principalID; 108 UUID principalID;
109 string token; 109 string token;
110 110
111 if (!UUID.TryParse(request["PRINCIPAL"], out principalID)) 111 if (!UUID.TryParse(request["PRINCIPAL"].ToString(), out principalID))
112 return FailureResult(); 112 return FailureResult();
113 113
114 switch (method) 114 switch (method)
@@ -117,7 +117,7 @@ namespace OpenSim.Server.Handlers.Authentication
117 if (!request.ContainsKey("PASSWORD")) 117 if (!request.ContainsKey("PASSWORD"))
118 return FailureResult(); 118 return FailureResult();
119 119
120 token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"], lifetime); 120 token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"].ToString(), lifetime);
121 121
122 if (token != String.Empty) 122 if (token != String.Empty)
123 return SuccessResult(token); 123 return SuccessResult(token);
@@ -126,7 +126,7 @@ namespace OpenSim.Server.Handlers.Authentication
126 if (!request.ContainsKey("TOKEN")) 126 if (!request.ContainsKey("TOKEN"))
127 return FailureResult(); 127 return FailureResult();
128 128
129 if (m_AuthenticationService.Verify(principalID, request["TOKEN"], lifetime)) 129 if (m_AuthenticationService.Verify(principalID, request["TOKEN"].ToString(), lifetime))
130 return SuccessResult(); 130 return SuccessResult();
131 131
132 return FailureResult(); 132 return FailureResult();
@@ -134,7 +134,7 @@ namespace OpenSim.Server.Handlers.Authentication
134 if (!request.ContainsKey("TOKEN")) 134 if (!request.ContainsKey("TOKEN"))
135 return FailureResult(); 135 return FailureResult();
136 136
137 if (m_AuthenticationService.Release(principalID, request["TOKEN"])) 137 if (m_AuthenticationService.Release(principalID, request["TOKEN"].ToString()))
138 return SuccessResult(); 138 return SuccessResult();
139 139
140 return FailureResult(); 140 return FailureResult();
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
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
index 8a68169..d914d32 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
@@ -68,13 +68,13 @@ namespace OpenSim.Server.Handlers.Presence
68 68
69 try 69 try
70 { 70 {
71 Dictionary<string, string> request = 71 Dictionary<string, object> request =
72 ServerUtils.ParseQueryString(body); 72 ServerUtils.ParseQueryString(body);
73 73
74 if (!request.ContainsKey("METHOD")) 74 if (!request.ContainsKey("METHOD"))
75 return FailureResult(); 75 return FailureResult();
76 76
77 string method = request["METHOD"]; 77 string method = request["METHOD"].ToString();
78 78
79 switch (method) 79 switch (method)
80 { 80 {
@@ -92,11 +92,11 @@ namespace OpenSim.Server.Handlers.Presence
92 92
93 } 93 }
94 94
95 byte[] Report(Dictionary<string, string> request) 95 byte[] Report(Dictionary<string, object> request)
96 { 96 {
97 PresenceInfo info = new PresenceInfo(); 97 PresenceInfo info = new PresenceInfo();
98 98
99 if (request["PrincipalID"] == null || request["RegionID"] == null) 99 if (!request.ContainsKey("PrincipalID") || !request.ContainsKey("RegionID"))
100 return FailureResult(); 100 return FailureResult();
101 101
102 if (!UUID.TryParse(request["PrincipalID"].ToString(), 102 if (!UUID.TryParse(request["PrincipalID"].ToString(),