aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorSean Dague2008-04-10 14:37:17 +0000
committerSean Dague2008-04-10 14:37:17 +0000
commitef7dfae41c728d10cfe835cb256958c354449f1b (patch)
tree98affd8fd75500ece10eb471ba405709e2d389f4 /OpenSim/Data
parentfurther renaming of properties for clarity (diff)
downloadopensim-SC_OLD-ef7dfae41c728d10cfe835cb256958c354449f1b.zip
opensim-SC_OLD-ef7dfae41c728d10cfe835cb256958c354449f1b.tar.gz
opensim-SC_OLD-ef7dfae41c728d10cfe835cb256958c354449f1b.tar.bz2
opensim-SC_OLD-ef7dfae41c728d10cfe835cb256958c354449f1b.tar.xz
changing UserAgentData to use properties. This caused more
grief than expected, as monodevelop doesn't like to refactor properties of properties.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLManager.cs25
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs74
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserData.cs52
3 files changed, 89 insertions, 62 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs
index e327c46..524efc4 100644
--- a/OpenSim/Data/MSSQL/MSSQLManager.cs
+++ b/OpenSim/Data/MSSQL/MSSQLManager.cs
@@ -352,23 +352,26 @@ namespace OpenSim.Data.MSSQL
352 if (reader.Read()) 352 if (reader.Read())
353 { 353 {
354 // Agent IDs 354 // Agent IDs
355 retval.UUID = new LLUUID((string)reader["UUID"]); 355 retval.ProfileID = new LLUUID((string)reader["UUID"]);
356 retval.sessionID = new LLUUID((string)reader["sessionID"]); 356 retval.SessionID = new LLUUID((string)reader["sessionID"]);
357 retval.secureSessionID = new LLUUID((string)reader["secureSessionID"]); 357 retval.SecureSessionID = new LLUUID((string)reader["secureSessionID"]);
358 358
359 // Agent Who? 359 // Agent Who?
360 retval.agentIP = (string)reader["agentIP"]; 360 retval.AgentIP = (string)reader["agentIP"];
361 retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); 361 retval.AgentPort = Convert.ToUInt32(reader["agentPort"].ToString());
362 retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString()); 362 retval.AgentOnline = Convert.ToBoolean(reader["agentOnline"].ToString());
363 363
364 // Login/Logout times (UNIX Epoch) 364 // Login/Logout times (UNIX Epoch)
365 retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); 365 retval.LoginTime = Convert.ToInt32(reader["loginTime"].ToString());
366 retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); 366 retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString());
367 367
368 // Current position 368 // Current position
369 retval.currentRegion = (string)reader["currentRegion"]; 369 retval.CurrentRegion = (string)reader["currentRegion"];
370 retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); 370 retval.CurrentHandle = Convert.ToUInt64(reader["currentHandle"].ToString());
371 LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); 371 LLVector3 tmp_v;
372 LLVector3.TryParse((string)reader["currentPos"], out tmp_v);
373 retval.CurrentPos = tmp_v;
374
372 } 375 }
373 else 376 else
374 { 377 {
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index f4ef172..f2ec6be 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -295,10 +295,24 @@ namespace OpenSim.Data.MySQL
295 if (reader.Read()) 295 if (reader.Read())
296 { 296 {
297 // Region Main gotta-have-or-we-return-null parts 297 // Region Main gotta-have-or-we-return-null parts
298 if (!UInt64.TryParse(reader["regionHandle"].ToString(), out retval.regionHandle)) 298 UInt64 tmp64;
299 if (!UInt64.TryParse(reader["regionHandle"].ToString(), out tmp64))
300 {
299 return null; 301 return null;
300 if (!LLUUID.TryParse((string)reader["uuid"], out retval.UUID)) 302 }
303 else
304 {
305 retval.regionHandle = tmp64;
306 }
307 LLUUID tmp_uuid;
308 if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid))
309 {
301 return null; 310 return null;
311 }
312 else
313 {
314 retval.UUID = tmp_uuid;
315 }
302 316
303 // non-critical parts 317 // non-critical parts
304 retval.regionName = (string)reader["regionName"]; 318 retval.regionName = (string)reader["regionName"];
@@ -369,7 +383,9 @@ namespace OpenSim.Data.MySQL
369 retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString()); 383 retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString());
370 retval.reservationName = (string) reader["resName"]; 384 retval.reservationName = (string) reader["resName"];
371 retval.status = Convert.ToInt32(reader["status"].ToString()) == 1; 385 retval.status = Convert.ToInt32(reader["status"].ToString()) == 1;
372 LLUUID.TryParse((string) reader["userUUID"], out retval.userUUID); 386 LLUUID tmp;
387 LLUUID.TryParse((string) reader["userUUID"], out tmp);
388 retval.userUUID = tmp;
373 } 389 }
374 else 390 else
375 { 391 {
@@ -390,24 +406,32 @@ namespace OpenSim.Data.MySQL
390 if (reader.Read()) 406 if (reader.Read())
391 { 407 {
392 // Agent IDs 408 // Agent IDs
393 if (!LLUUID.TryParse((string)reader["UUID"], out retval.UUID)) 409 LLUUID tmp;
410 if (!LLUUID.TryParse((string)reader["UUID"], out tmp))
394 return null; 411 return null;
395 LLUUID.TryParse((string) reader["sessionID"], out retval.sessionID); 412 retval.ProfileID = tmp;
396 LLUUID.TryParse((string)reader["secureSessionID"], out retval.secureSessionID); 413
414 LLUUID.TryParse((string) reader["sessionID"], out tmp);
415 retval.SessionID = tmp;
416
417 LLUUID.TryParse((string)reader["secureSessionID"], out tmp);
418 retval.SecureSessionID = tmp;
397 419
398 // Agent Who? 420 // Agent Who?
399 retval.agentIP = (string) reader["agentIP"]; 421 retval.AgentIP = (string) reader["agentIP"];
400 retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); 422 retval.AgentPort = Convert.ToUInt32(reader["agentPort"].ToString());
401 retval.agentOnline = Convert.ToBoolean(Convert.ToInt16(reader["agentOnline"].ToString())); 423 retval.AgentOnline = Convert.ToBoolean(Convert.ToInt16(reader["agentOnline"].ToString()));
402 424
403 // Login/Logout times (UNIX Epoch) 425 // Login/Logout times (UNIX Epoch)
404 retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); 426 retval.LoginTime = Convert.ToInt32(reader["loginTime"].ToString());
405 retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); 427 retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString());
406 428
407 // Current position 429 // Current position
408 retval.currentRegion = new LLUUID((string)reader["currentRegion"]); 430 retval.CurrentRegion = new LLUUID((string)reader["currentRegion"]);
409 retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); 431 retval.CurrentHandle = Convert.ToUInt64(reader["currentHandle"].ToString());
410 LLVector3.TryParse((string) reader["currentPos"], out retval.currentPos); 432 LLVector3 tmp_v;
433 LLVector3.TryParse((string) reader["currentPos"], out tmp_v);
434 retval.CurrentPos = tmp_v;
411 } 435 }
412 else 436 else
413 { 437 {
@@ -883,17 +907,17 @@ namespace OpenSim.Data.MySQL
883 sql += "(?UUID, ?sessionID, ?secureSessionID, ?agentIP, ?agentPort, ?agentOnline, ?loginTime, ?logoutTime, ?currentRegion, ?currentHandle, ?currentPos);"; 907 sql += "(?UUID, ?sessionID, ?secureSessionID, ?agentIP, ?agentPort, ?agentOnline, ?loginTime, ?logoutTime, ?currentRegion, ?currentHandle, ?currentPos);";
884 Dictionary<string, string> parameters = new Dictionary<string, string>(); 908 Dictionary<string, string> parameters = new Dictionary<string, string>();
885 909
886 parameters["?UUID"] = agentdata.UUID.ToString(); 910 parameters["?UUID"] = agentdata.ProfileID.ToString();
887 parameters["?sessionID"] = agentdata.sessionID.ToString(); 911 parameters["?sessionID"] = agentdata.SessionID.ToString();
888 parameters["?secureSessionID"] = agentdata.secureSessionID.ToString(); 912 parameters["?secureSessionID"] = agentdata.SecureSessionID.ToString();
889 parameters["?agentIP"] = agentdata.agentIP.ToString(); 913 parameters["?agentIP"] = agentdata.AgentIP.ToString();
890 parameters["?agentPort"] = agentdata.agentPort.ToString(); 914 parameters["?agentPort"] = agentdata.AgentPort.ToString();
891 parameters["?agentOnline"] = (agentdata.agentOnline == true) ? "1" : "0"; 915 parameters["?agentOnline"] = (agentdata.AgentOnline == true) ? "1" : "0";
892 parameters["?loginTime"] = agentdata.loginTime.ToString(); 916 parameters["?loginTime"] = agentdata.LoginTime.ToString();
893 parameters["?logoutTime"] = agentdata.logoutTime.ToString(); 917 parameters["?logoutTime"] = agentdata.LogoutTime.ToString();
894 parameters["?currentRegion"] = agentdata.currentRegion.ToString(); 918 parameters["?currentRegion"] = agentdata.CurrentRegion.ToString();
895 parameters["?currentHandle"] = agentdata.currentHandle.ToString(); 919 parameters["?currentHandle"] = agentdata.CurrentHandle.ToString();
896 parameters["?currentPos"] = "<" + ((int)agentdata.currentPos.X).ToString() + "," + ((int)agentdata.currentPos.Y).ToString() + "," + ((int)agentdata.currentPos.Z).ToString() + ">"; 920 parameters["?currentPos"] = "<" + ((int)agentdata.CurrentPos.X).ToString() + "," + ((int)agentdata.CurrentPos.Y).ToString() + "," + ((int)agentdata.CurrentPos.Z).ToString() + ">";
897 921
898 bool returnval = false; 922 bool returnval = false;
899 923
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index 815c1bb..3ee0c03 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -674,18 +674,18 @@ namespace OpenSim.Data.SQLite
674 { 674 {
675 UserAgentData ua = new UserAgentData(); 675 UserAgentData ua = new UserAgentData();
676 676
677 ua.UUID = new LLUUID((String) row["UUID"]); 677 ua.ProfileID = new LLUUID((String) row["UUID"]);
678 ua.agentIP = (String) row["agentIP"]; 678 ua.AgentIP = (String) row["agentIP"];
679 ua.agentPort = Convert.ToUInt32(row["agentPort"]); 679 ua.AgentPort = Convert.ToUInt32(row["agentPort"]);
680 ua.agentOnline = Convert.ToBoolean(row["agentOnline"]); 680 ua.AgentOnline = Convert.ToBoolean(row["agentOnline"]);
681 ua.sessionID = new LLUUID((String) row["sessionID"]); 681 ua.SessionID = new LLUUID((String) row["sessionID"]);
682 ua.secureSessionID = new LLUUID((String) row["secureSessionID"]); 682 ua.SecureSessionID = new LLUUID((String) row["secureSessionID"]);
683 ua.regionID = new LLUUID((String) row["regionID"]); 683 ua.RegionID = new LLUUID((String) row["regionID"]);
684 ua.loginTime = Convert.ToInt32(row["loginTime"]); 684 ua.LoginTime = Convert.ToInt32(row["loginTime"]);
685 ua.logoutTime = Convert.ToInt32(row["logoutTime"]); 685 ua.LogoutTime = Convert.ToInt32(row["logoutTime"]);
686 ua.currentRegion = new LLUUID((String) row["currentRegion"]); 686 ua.CurrentRegion = new LLUUID((String) row["currentRegion"]);
687 ua.currentHandle = Convert.ToUInt64(row["currentHandle"]); 687 ua.CurrentHandle = Convert.ToUInt64(row["currentHandle"]);
688 ua.currentPos = new LLVector3( 688 ua.CurrentPos = new LLVector3(
689 Convert.ToSingle(row["currentPosX"]), 689 Convert.ToSingle(row["currentPosX"]),
690 Convert.ToSingle(row["currentPosY"]), 690 Convert.ToSingle(row["currentPosY"]),
691 Convert.ToSingle(row["currentPosZ"]) 691 Convert.ToSingle(row["currentPosZ"])
@@ -695,21 +695,21 @@ namespace OpenSim.Data.SQLite
695 695
696 private static void fillUserAgentRow(DataRow row, UserAgentData ua) 696 private static void fillUserAgentRow(DataRow row, UserAgentData ua)
697 { 697 {
698 row["UUID"] = ua.UUID; 698 row["UUID"] = ua.ProfileID;
699 row["agentIP"] = ua.agentIP; 699 row["agentIP"] = ua.AgentIP;
700 row["agentPort"] = ua.agentPort; 700 row["agentPort"] = ua.AgentPort;
701 row["agentOnline"] = ua.agentOnline; 701 row["agentOnline"] = ua.AgentOnline;
702 row["sessionID"] = ua.sessionID; 702 row["sessionID"] = ua.SessionID;
703 row["secureSessionID"] = ua.secureSessionID; 703 row["secureSessionID"] = ua.SecureSessionID;
704 row["regionID"] = ua.regionID; 704 row["regionID"] = ua.RegionID;
705 row["loginTime"] = ua.loginTime; 705 row["loginTime"] = ua.LoginTime;
706 row["logoutTime"] = ua.logoutTime; 706 row["logoutTime"] = ua.LogoutTime;
707 row["currentRegion"] = ua.currentRegion; 707 row["currentRegion"] = ua.CurrentRegion;
708 row["currentHandle"] = ua.currentHandle.ToString(); 708 row["currentHandle"] = ua.CurrentHandle.ToString();
709 // vectors 709 // vectors
710 row["currentPosX"] = ua.currentPos.X; 710 row["currentPosX"] = ua.CurrentPos.X;
711 row["currentPosY"] = ua.currentPos.Y; 711 row["currentPosY"] = ua.CurrentPos.Y;
712 row["currentPosZ"] = ua.currentPos.Z; 712 row["currentPosZ"] = ua.CurrentPos.Z;
713 } 713 }
714 714
715 /*********************************************************************** 715 /***********************************************************************