aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorSean Dague2007-08-28 13:02:51 +0000
committerSean Dague2007-08-28 13:02:51 +0000
commitc1a899b651ea2a43f88c8afb04fa27d492e5964c (patch)
tree7d685337db8f115f0986448dc36dbbbeaeaa49b7 /OpenSim/Framework
parentsqlite is storing now, uint64 makes things "interesting". (diff)
downloadopensim-SC-c1a899b651ea2a43f88c8afb04fa27d492e5964c.zip
opensim-SC-c1a899b651ea2a43f88c8afb04fa27d492e5964c.tar.gz
opensim-SC-c1a899b651ea2a43f88c8afb04fa27d492e5964c.tar.bz2
opensim-SC-c1a899b651ea2a43f88c8afb04fa27d492e5964c.tar.xz
Ensure that UserProfileData doesn't pass down null values.
These cause some issues with the ADO.NET mapping
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteUserData.cs43
-rw-r--r--OpenSim/Framework/Data/UserProfileData.cs11
2 files changed, 32 insertions, 22 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
index d442784..bba5791 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
@@ -363,12 +363,12 @@ namespace OpenSim.Framework.Data.SQLite
363 // back out. Not enough time to figure it out yet. 363 // back out. Not enough time to figure it out yet.
364 UserProfileData user = new UserProfileData(); 364 UserProfileData user = new UserProfileData();
365 user.UUID = new LLUUID((String)row["UUID"]); 365 user.UUID = new LLUUID((String)row["UUID"]);
366 user.username = (string)row["username"]; 366 user.username = (String)row["username"];
367 user.surname = (string)row["surname"]; 367 user.surname = (String)row["surname"];
368 user.passwordHash = (string)row["passwordHash"]; 368 user.passwordHash = (String)row["passwordHash"];
369 user.passwordSalt = (string)row["passwordSalt"]; 369 user.passwordSalt = (String)row["passwordSalt"];
370 370
371 user.homeRegion = Convert.ToUInt64(row["homeRegion"]); 371 // user.homeRegion = Convert.ToUInt64(row["homeRegion"]);
372 user.homeLocation = new LLVector3( 372 user.homeLocation = new LLVector3(
373 Convert.ToSingle(row["homeLocationX"]), 373 Convert.ToSingle(row["homeLocationX"]),
374 Convert.ToSingle(row["homeLocationY"]), 374 Convert.ToSingle(row["homeLocationY"]),
@@ -381,15 +381,15 @@ namespace OpenSim.Framework.Data.SQLite
381 ); 381 );
382 user.created = Convert.ToInt32(row["created"]); 382 user.created = Convert.ToInt32(row["created"]);
383 user.lastLogin = Convert.ToInt32(row["lastLogin"]); 383 user.lastLogin = Convert.ToInt32(row["lastLogin"]);
384 user.rootInventoryFolderID = new LLUUID((string)row["rootInventoryFolderID"]); 384 user.rootInventoryFolderID = new LLUUID((String)row["rootInventoryFolderID"]);
385 user.userInventoryURI = (string)row["userInventoryURI"]; 385 user.userInventoryURI = (String)row["userInventoryURI"];
386 user.userAssetURI = (string)row["userAssetURI"]; 386 user.userAssetURI = (String)row["userAssetURI"];
387 user.profileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]); 387 user.profileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]);
388 user.profileWantDoMask = Convert.ToUInt32(row["profileWantDoMask"]); 388 user.profileWantDoMask = Convert.ToUInt32(row["profileWantDoMask"]);
389 user.profileAboutText = (string)row["profileAboutText"]; 389 user.profileAboutText = (String)row["profileAboutText"];
390 user.profileFirstText = (string)row["profileFirstText"]; 390 user.profileFirstText = (String)row["profileFirstText"];
391 user.profileImage = new LLUUID((string)row["profileImage"]); 391 user.profileImage = new LLUUID((String)row["profileImage"]);
392 user.profileFirstImage = new LLUUID((string)row["profileFirstImage"]); 392 user.profileFirstImage = new LLUUID((String)row["profileFirstImage"]);
393 return user; 393 return user;
394 } 394 }
395 395
@@ -421,22 +421,29 @@ namespace OpenSim.Framework.Data.SQLite
421 row["profileFirstText"] = user.profileFirstText; 421 row["profileFirstText"] = user.profileFirstText;
422 row["profileImage"] = user.profileImage; 422 row["profileImage"] = user.profileImage;
423 row["profileFirstImage"] = user.profileFirstImage; 423 row["profileFirstImage"] = user.profileFirstImage;
424
425 // ADO.NET doesn't handle NULL very well
426 foreach (DataColumn col in ds.Tables["users"].Columns) {
427 if (row[col] == null) {
428 row[col] = "";
429 }
430 }
424 } 431 }
425 432
426 private UserAgentData buildUserAgent(DataRow row) 433 private UserAgentData buildUserAgent(DataRow row)
427 { 434 {
428 UserAgentData ua = new UserAgentData(); 435 UserAgentData ua = new UserAgentData();
429 436
430 ua.UUID = new LLUUID((string)row["UUID"]); 437 ua.UUID = new LLUUID((String)row["UUID"]);
431 ua.agentIP = (string)row["agentIP"]; 438 ua.agentIP = (String)row["agentIP"];
432 ua.agentPort = Convert.ToUInt32(row["agentPort"]); 439 ua.agentPort = Convert.ToUInt32(row["agentPort"]);
433 ua.agentOnline = Convert.ToBoolean(row["agentOnline"]); 440 ua.agentOnline = Convert.ToBoolean(row["agentOnline"]);
434 ua.sessionID = new LLUUID((string)row["sessionID"]); 441 ua.sessionID = new LLUUID((String)row["sessionID"]);
435 ua.secureSessionID = new LLUUID((string)row["secureSessionID"]); 442 ua.secureSessionID = new LLUUID((String)row["secureSessionID"]);
436 ua.regionID = new LLUUID((string)row["regionID"]); 443 ua.regionID = new LLUUID((String)row["regionID"]);
437 ua.loginTime = Convert.ToInt32(row["loginTime"]); 444 ua.loginTime = Convert.ToInt32(row["loginTime"]);
438 ua.logoutTime = Convert.ToInt32(row["logoutTime"]); 445 ua.logoutTime = Convert.ToInt32(row["logoutTime"]);
439 ua.currentRegion = new LLUUID((string)row["currentRegion"]); 446 ua.currentRegion = new LLUUID((String)row["currentRegion"]);
440 ua.currentHandle = Convert.ToUInt32(row["currentHandle"]); 447 ua.currentHandle = Convert.ToUInt32(row["currentHandle"]);
441 ua.currentPos = new LLVector3( 448 ua.currentPos = new LLVector3(
442 Convert.ToSingle(row["currentPosX"]), 449 Convert.ToSingle(row["currentPosX"]),
diff --git a/OpenSim/Framework/Data/UserProfileData.cs b/OpenSim/Framework/Data/UserProfileData.cs
index 67ff64c..3c1f1c7 100644
--- a/OpenSim/Framework/Data/UserProfileData.cs
+++ b/OpenSim/Framework/Data/UserProfileData.cs
@@ -63,6 +63,9 @@ namespace OpenSim.Framework.Data
63 /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into 63 /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into
64 /// </summary> 64 /// </summary>
65 public ulong homeRegion; 65 public ulong homeRegion;
66
67 public uint homeRegionX;
68 public uint homeRegionY;
66 /// <summary> 69 /// <summary>
67 /// The coordinates inside the region of the home location 70 /// The coordinates inside the region of the home location
68 /// </summary> 71 /// </summary>
@@ -86,11 +89,11 @@ namespace OpenSim.Framework.Data
86 /// <summary> 89 /// <summary>
87 /// A URI to the users inventory server, used for foreigners and large grids 90 /// A URI to the users inventory server, used for foreigners and large grids
88 /// </summary> 91 /// </summary>
89 public string userInventoryURI; 92 public string userInventoryURI = String.Empty;
90 /// <summary> 93 /// <summary>
91 /// A URI to the users asset server, used for foreigners and large grids. 94 /// A URI to the users asset server, used for foreigners and large grids.
92 /// </summary> 95 /// </summary>
93 public string userAssetURI; 96 public string userAssetURI = String.Empty;
94 97
95 /// <summary> 98 /// <summary>
96 /// A uint mask containing the "I can do" fields of the users profile 99 /// A uint mask containing the "I can do" fields of the users profile
@@ -104,11 +107,11 @@ namespace OpenSim.Framework.Data
104 /// <summary> 107 /// <summary>
105 /// The about text listed in a users profile. 108 /// The about text listed in a users profile.
106 /// </summary> 109 /// </summary>
107 public string profileAboutText; 110 public string profileAboutText = String.Empty;
108 /// <summary> 111 /// <summary>
109 /// The first life about text listed in a users profile 112 /// The first life about text listed in a users profile
110 /// </summary> 113 /// </summary>
111 public string profileFirstText; 114 public string profileFirstText = String.Empty;
112 115
113 /// <summary> 116 /// <summary>
114 /// The profile image for an avatar stored on the asset server 117 /// The profile image for an avatar stored on the asset server