aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MySQL/MySQLManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Data.MySQL/MySQLManager.cs')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLManager.cs51
1 files changed, 22 insertions, 29 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
index b2f398b..ab478ed 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
@@ -27,17 +27,10 @@
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text;
31using System.Data; 30using System.Data;
32 31using libsecondlife;
33// MySQL Native
34using MySql;
35using MySql.Data;
36using MySql.Data.Types;
37using MySql.Data.MySqlClient; 32using MySql.Data.MySqlClient;
38 33
39using OpenSim.Framework.Data;
40
41namespace OpenSim.Framework.Data.MySQL 34namespace OpenSim.Framework.Data.MySQL
42{ 35{
43 /// <summary> 36 /// <summary>
@@ -71,7 +64,7 @@ namespace OpenSim.Framework.Data.MySQL
71 64
72 dbcon.Open(); 65 dbcon.Open();
73 66
74 System.Console.WriteLine("MySQL connection established"); 67 Console.WriteLine("MySQL connection established");
75 } 68 }
76 catch (Exception e) 69 catch (Exception e)
77 { 70 {
@@ -187,7 +180,7 @@ namespace OpenSim.Framework.Data.MySQL
187 // Region Main 180 // Region Main
188 retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString()); 181 retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString());
189 retval.regionName = (string)reader["regionName"]; 182 retval.regionName = (string)reader["regionName"];
190 retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]); 183 retval.UUID = new LLUUID((string)reader["uuid"]);
191 184
192 // Secrets 185 // Secrets
193 retval.regionRecvKey = (string)reader["regionRecvKey"]; 186 retval.regionRecvKey = (string)reader["regionRecvKey"];
@@ -226,11 +219,11 @@ namespace OpenSim.Framework.Data.MySQL
226 string tempRegionMap = reader["regionMapTexture"].ToString(); 219 string tempRegionMap = reader["regionMapTexture"].ToString();
227 if (tempRegionMap != "") 220 if (tempRegionMap != "")
228 { 221 {
229 retval.regionMapTextureID = new libsecondlife.LLUUID(tempRegionMap); 222 retval.regionMapTextureID = new LLUUID(tempRegionMap);
230 } 223 }
231 else 224 else
232 { 225 {
233 retval.regionMapTextureID = new libsecondlife.LLUUID(); 226 retval.regionMapTextureID = new LLUUID();
234 } 227 }
235 } 228 }
236 else 229 else
@@ -259,7 +252,7 @@ namespace OpenSim.Framework.Data.MySQL
259 retval.reservationMinY = (int)reader["resYMin"]; 252 retval.reservationMinY = (int)reader["resYMin"];
260 retval.reservationName = (string)reader["resName"]; 253 retval.reservationName = (string)reader["resName"];
261 retval.status = (bool)reader["status"]; 254 retval.status = (bool)reader["status"];
262 retval.userUUID = new libsecondlife.LLUUID((string)reader["userUUID"]); 255 retval.userUUID = new LLUUID((string)reader["userUUID"]);
263 256
264 } 257 }
265 else 258 else
@@ -280,9 +273,9 @@ namespace OpenSim.Framework.Data.MySQL
280 if (reader.Read()) 273 if (reader.Read())
281 { 274 {
282 // Agent IDs 275 // Agent IDs
283 retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]); 276 retval.UUID = new LLUUID((string)reader["UUID"]);
284 retval.sessionID = new libsecondlife.LLUUID((string)reader["sessionID"]); 277 retval.sessionID = new LLUUID((string)reader["sessionID"]);
285 retval.secureSessionID = new libsecondlife.LLUUID((string)reader["secureSessionID"]); 278 retval.secureSessionID = new LLUUID((string)reader["secureSessionID"]);
286 279
287 // Agent Who? 280 // Agent Who?
288 retval.agentIP = (string)reader["agentIP"]; 281 retval.agentIP = (string)reader["agentIP"];
@@ -296,7 +289,7 @@ namespace OpenSim.Framework.Data.MySQL
296 // Current position 289 // Current position
297 retval.currentRegion = (string)reader["currentRegion"]; 290 retval.currentRegion = (string)reader["currentRegion"];
298 retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); 291 retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString());
299 libsecondlife.LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); 292 LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos);
300 } 293 }
301 else 294 else
302 { 295 {
@@ -316,7 +309,7 @@ namespace OpenSim.Framework.Data.MySQL
316 309
317 if (reader.Read()) 310 if (reader.Read())
318 { 311 {
319 retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]); 312 retval.UUID = new LLUUID((string)reader["UUID"]);
320 retval.username = (string)reader["username"]; 313 retval.username = (string)reader["username"];
321 retval.surname = (string)reader["lastname"]; 314 retval.surname = (string)reader["lastname"];
322 315
@@ -324,11 +317,11 @@ namespace OpenSim.Framework.Data.MySQL
324 retval.passwordSalt = (string)reader["passwordSalt"]; 317 retval.passwordSalt = (string)reader["passwordSalt"];
325 318
326 retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); 319 retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
327 retval.homeLocation = new libsecondlife.LLVector3( 320 retval.homeLocation = new LLVector3(
328 Convert.ToSingle(reader["homeLocationX"].ToString()), 321 Convert.ToSingle(reader["homeLocationX"].ToString()),
329 Convert.ToSingle(reader["homeLocationY"].ToString()), 322 Convert.ToSingle(reader["homeLocationY"].ToString()),
330 Convert.ToSingle(reader["homeLocationZ"].ToString())); 323 Convert.ToSingle(reader["homeLocationZ"].ToString()));
331 retval.homeLookAt = new libsecondlife.LLVector3( 324 retval.homeLookAt = new LLVector3(
332 Convert.ToSingle(reader["homeLookAtX"].ToString()), 325 Convert.ToSingle(reader["homeLookAtX"].ToString()),
333 Convert.ToSingle(reader["homeLookAtY"].ToString()), 326 Convert.ToSingle(reader["homeLookAtY"].ToString()),
334 Convert.ToSingle(reader["homeLookAtZ"].ToString())); 327 Convert.ToSingle(reader["homeLookAtZ"].ToString()));
@@ -345,8 +338,8 @@ namespace OpenSim.Framework.Data.MySQL
345 retval.profileAboutText = (string)reader["profileAboutText"]; 338 retval.profileAboutText = (string)reader["profileAboutText"];
346 retval.profileFirstText = (string)reader["profileFirstText"]; 339 retval.profileFirstText = (string)reader["profileFirstText"];
347 340
348 retval.profileImage = new libsecondlife.LLUUID((string)reader["profileImage"]); 341 retval.profileImage = new LLUUID((string)reader["profileImage"]);
349 retval.profileFirstImage = new libsecondlife.LLUUID((string)reader["profileFirstImage"]); 342 retval.profileFirstImage = new LLUUID((string)reader["profileFirstImage"]);
350 343
351 } 344 }
352 else 345 else
@@ -371,9 +364,9 @@ namespace OpenSim.Framework.Data.MySQL
371 { 364 {
372 InventoryFolderBase folder = new InventoryFolderBase(); 365 InventoryFolderBase folder = new InventoryFolderBase();
373 366
374 folder.agentID = new libsecondlife.LLUUID((string)reader["agentID"]); 367 folder.agentID = new LLUUID((string)reader["agentID"]);
375 folder.parentID = new libsecondlife.LLUUID((string)reader["parentFolderID"]); 368 folder.parentID = new LLUUID((string)reader["parentFolderID"]);
376 folder.folderID = new libsecondlife.LLUUID((string)reader["folderID"]); 369 folder.folderID = new LLUUID((string)reader["folderID"]);
377 folder.name = (string)reader["folderName"]; 370 folder.name = (string)reader["folderName"];
378 371
379 rows.Add(folder); 372 rows.Add(folder);
@@ -402,14 +395,14 @@ namespace OpenSim.Framework.Data.MySQL
402 { 395 {
403 InventoryItemBase item = new InventoryItemBase(); 396 InventoryItemBase item = new InventoryItemBase();
404 397
405 item.assetID = new libsecondlife.LLUUID((string)reader["assetID"]); 398 item.assetID = new LLUUID((string)reader["assetID"]);
406 item.avatarID = new libsecondlife.LLUUID((string)reader["avatarID"]); 399 item.avatarID = new LLUUID((string)reader["avatarID"]);
407 item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"].ToString()); 400 item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"].ToString());
408 item.inventoryDescription = (string)reader["inventoryDescription"]; 401 item.inventoryDescription = (string)reader["inventoryDescription"];
409 item.inventoryID = new libsecondlife.LLUUID((string)reader["inventoryID"]); 402 item.inventoryID = new LLUUID((string)reader["inventoryID"]);
410 item.inventoryName = (string)reader["inventoryName"]; 403 item.inventoryName = (string)reader["inventoryName"];
411 item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"].ToString()); 404 item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"].ToString());
412 item.parentFolderID = new libsecondlife.LLUUID((string)reader["parentFolderID"]); 405 item.parentFolderID = new LLUUID((string)reader["parentFolderID"]);
413 item.type = Convert.ToInt32(reader["type"].ToString()); 406 item.type = Convert.ToInt32(reader["type"].ToString());
414 407
415 rows.Add(item); 408 rows.Add(item);