aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
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/Data.SQLite/SQLiteUserData.cs
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 '')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteUserData.cs43
1 files changed, 25 insertions, 18 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"]),