aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices/OpenGridServices.GridServer/GridManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/GridManager.cs56
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 }