aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2007-05-28 23:32:05 +0000
committerAdam Frisby2007-05-28 23:32:05 +0000
commit82ab883ea279150645b7e76ae761a45cb02ac907 (patch)
treeb52de04103307daa1e3d25b8a5f8c97d7a401940
parentDB4o is re-tah-ded. (Changed default DB provider to MySQL) (diff)
downloadopensim-SC-82ab883ea279150645b7e76ae761a45cb02ac907.zip
opensim-SC-82ab883ea279150645b7e76ae761a45cb02ac907.tar.gz
opensim-SC-82ab883ea279150645b7e76ae761a45cb02ac907.tar.bz2
opensim-SC-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.
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs14
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/GridManager.cs56
2 files changed, 52 insertions, 18 deletions
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
index 1f7413f..aee18b9 100644
--- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
@@ -33,6 +33,8 @@ namespace OpenGrid.Framework.Data.MySQL
33 dbcon = new MySqlConnection(connectionString); 33 dbcon = new MySqlConnection(connectionString);
34 34
35 dbcon.Open(); 35 dbcon.Open();
36
37 System.Console.WriteLine("MySQL connection established");
36 } 38 }
37 catch (Exception e) 39 catch (Exception e)
38 { 40 {
@@ -120,7 +122,15 @@ namespace OpenGrid.Framework.Data.MySQL
120 retval.regionUserSendKey = (string)reader["regionUserSendKey"]; 122 retval.regionUserSendKey = (string)reader["regionUserSendKey"];
121 123
122 // World Map Addition 124 // World Map Addition
123 retval.regionMapTextureID = new libsecondlife.LLUUID((string)reader["regionMapTexture"]); 125 string tempRegionMap = reader["regionMapTexture"].ToString();
126 if (tempRegionMap != "")
127 {
128 retval.regionMapTextureID = new libsecondlife.LLUUID(tempRegionMap);
129 }
130 else
131 {
132 retval.regionMapTextureID = new libsecondlife.LLUUID();
133 }
124 } 134 }
125 else 135 else
126 { 136 {
@@ -209,7 +219,7 @@ namespace OpenGrid.Framework.Data.MySQL
209 219
210 public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) 220 public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage)
211 { 221 {
212 string sql = "INSERT INTO logs (target, server, method, arguments, priority, message) VALUES ("; 222 string sql = "INSERT INTO logs (`target`, `server`, `method`, `arguments`, `priority`, `message`) VALUES ";
213 sql += "(?target, ?server, ?method, ?arguments, ?priority, ?message)"; 223 sql += "(?target, ?server, ?method, ?arguments, ?priority, ?message)";
214 224
215 Dictionary<string, string> parameters = new Dictionary<string, string>(); 225 Dictionary<string, string> parameters = new Dictionary<string, string>();
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 }