diff options
author | Adam Frisby | 2007-05-28 23:32:05 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-28 23:32:05 +0000 |
commit | 82ab883ea279150645b7e76ae761a45cb02ac907 (patch) | |
tree | b52de04103307daa1e3d25b8a5f8c97d7a401940 /OpenGridServices/OpenGridServices.GridServer | |
parent | DB4o is re-tah-ded. (Changed default DB provider to MySQL) (diff) | |
download | opensim-SC_OLD-82ab883ea279150645b7e76ae761a45cb02ac907.zip opensim-SC_OLD-82ab883ea279150645b7e76ae761a45cb02ac907.tar.gz opensim-SC_OLD-82ab883ea279150645b7e76ae761a45cb02ac907.tar.bz2 opensim-SC_OLD-82ab883ea279150645b7e76ae761a45cb02ac907.tar.xz |
* Escaped log messages properly when logging to DB
* World map textures are now checked against DBNull before returning
* MySQL now informs when it gets a connection
* "Fastmode" support added to world map queries (MySQL-only), disabled by default.
Diffstat (limited to '')
-rw-r--r-- | OpenGridServices/OpenGridServices.GridServer/GridManager.cs | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/OpenGridServices/OpenGridServices.GridServer/GridManager.cs b/OpenGridServices/OpenGridServices.GridServer/GridManager.cs index b73f24d..74ce973 100644 --- a/OpenGridServices/OpenGridServices.GridServer/GridManager.cs +++ b/OpenGridServices/OpenGridServices.GridServer/GridManager.cs | |||
@@ -315,25 +315,49 @@ namespace OpenGridServices.GridServer | |||
315 | response.Value = responseData; | 315 | response.Value = responseData; |
316 | IList simProfileList = new ArrayList(); | 316 | IList simProfileList = new ArrayList(); |
317 | 317 | ||
318 | SimProfileData simProfile; | 318 | bool fastMode = false; // MySQL Only |
319 | for (int x = xmin; x < xmax; x++) | 319 | |
320 | if (fastMode) | ||
320 | { | 321 | { |
321 | for (int y = ymin; y < ymax; y++) | 322 | Dictionary<ulong, SimProfileData> neighbours = getRegions((uint)xmin, (uint)ymin, (uint)xmax, (uint)ymax); |
323 | |||
324 | foreach (KeyValuePair<ulong, SimProfileData> aSim in neighbours) | ||
322 | { | 325 | { |
323 | simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256))); | 326 | Hashtable simProfileBlock = new Hashtable(); |
324 | if (simProfile != null) | 327 | simProfileBlock["x"] = aSim.Value.regionLocX; |
328 | simProfileBlock["y"] = aSim.Value.regionLocY; | ||
329 | simProfileBlock["name"] = aSim.Value.regionName; | ||
330 | simProfileBlock["access"] = 0; | ||
331 | simProfileBlock["region-flags"] = 0; | ||
332 | simProfileBlock["water-height"] = 20; | ||
333 | simProfileBlock["agents"] = 1; | ||
334 | simProfileBlock["map-image-id"] = aSim.Value.regionMapTextureID.ToString(); | ||
335 | |||
336 | simProfileList.Add(simProfileBlock); | ||
337 | } | ||
338 | } | ||
339 | else | ||
340 | { | ||
341 | SimProfileData simProfile; | ||
342 | for (int x = xmin; x < xmax; x++) | ||
343 | { | ||
344 | for (int y = ymin; y < ymax; y++) | ||
325 | { | 345 | { |
326 | Hashtable simProfileBlock = new Hashtable(); | 346 | simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256))); |
327 | simProfileBlock["x"] = x; | 347 | if (simProfile != null) |
328 | simProfileBlock["y"] = y; | 348 | { |
329 | simProfileBlock["name"] = simProfile.regionName; | 349 | Hashtable simProfileBlock = new Hashtable(); |
330 | simProfileBlock["access"] = 0; | 350 | simProfileBlock["x"] = x; |
331 | simProfileBlock["region-flags"] = 0; | 351 | simProfileBlock["y"] = y; |
332 | simProfileBlock["water-height"] = 20; | 352 | simProfileBlock["name"] = simProfile.regionName; |
333 | simProfileBlock["agents"] = 1; | 353 | simProfileBlock["access"] = 0; |
334 | simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString(); | 354 | simProfileBlock["region-flags"] = 0; |
335 | 355 | simProfileBlock["water-height"] = 20; | |
336 | simProfileList.Add(simProfileBlock); | 356 | simProfileBlock["agents"] = 1; |
357 | simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString(); | ||
358 | |||
359 | simProfileList.Add(simProfileBlock); | ||
360 | } | ||
337 | } | 361 | } |
338 | } | 362 | } |
339 | } | 363 | } |