aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs37
1 files changed, 7 insertions, 30 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
index 5539e3a..7980751 100644
--- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
@@ -273,11 +273,8 @@ namespace OpenSim.Data.PGSQL
273 { 273 {
274 if(reader.Read ()) 274 if(reader.Read ())
275 { 275 {
276 // ad.CreatorId = GetUUID(reader["creatoruuid"]);
277 ad.CreatorId = DBGuid.FromDB(reader["creatoruuid"]); 276 ad.CreatorId = DBGuid.FromDB(reader["creatoruuid"]);
278 // ad.ParcelId = GetUUID(reader["parceluuid"]);
279 ad.ParcelId = DBGuid.FromDB(reader["parceluuid"]); 277 ad.ParcelId = DBGuid.FromDB(reader["parceluuid"]);
280 // ad.SnapshotId = GetUUID(reader["snapshotuuid"]);
281 ad.SnapshotId = DBGuid.FromDB(reader["snapshotuuid"]); 278 ad.SnapshotId = DBGuid.FromDB(reader["snapshotuuid"]);
282 ad.CreationDate = Convert.ToInt32(reader["creationdate"]); 279 ad.CreationDate = Convert.ToInt32(reader["creationdate"]);
283 ad.ExpirationDate = Convert.ToInt32(reader["expirationdate"]); 280 ad.ExpirationDate = Convert.ToInt32(reader["expirationdate"]);
@@ -290,7 +287,6 @@ namespace OpenSim.Data.PGSQL
290 ad.SimName = reader["simname"].ToString(); 287 ad.SimName = reader["simname"].ToString();
291 ad.GlobalPos = reader["posglobal"].ToString(); 288 ad.GlobalPos = reader["posglobal"].ToString();
292 ad.ParcelName = reader["parcelname"].ToString(); 289 ad.ParcelName = reader["parcelname"].ToString();
293
294 } 290 }
295 } 291 }
296 } 292 }
@@ -437,7 +433,6 @@ namespace OpenSim.Data.PGSQL
437 WHERE NOT EXISTS ( 433 WHERE NOT EXISTS (
438 SELECT * FROM upsert )"; 434 SELECT * FROM upsert )";
439 435
440
441 try 436 try
442 { 437 {
443 using (NpgsqlConnection dbcon = new NpgsqlConnection(ConnectionString)) 438 using (NpgsqlConnection dbcon = new NpgsqlConnection(ConnectionString))
@@ -557,15 +552,6 @@ namespace OpenSim.Data.PGSQL
557 else 552 else
558 { 553 {
559 remove = false; 554 remove = false;
560// query = @"INSERT INTO usernotes VALUES ( :UserId, :TargetId, :Notes )
561// where not exists ( Select useruuid from usernotes where useruuid = :UserId and targetuuid = :TargetId );
562//
563// update usernotes
564// set notes = :Notes
565// where useruuid = :UserId
566// and targetuuid = :TargetId;
567// ";
568
569 555
570 query = @"WITH upsert AS ( 556 query = @"WITH upsert AS (
571 UPDATE usernotes SET notes = :Notes, useruuid = :UserId, targetuuid = :TargetId RETURNING * ) 557 UPDATE usernotes SET notes = :Notes, useruuid = :UserId, targetuuid = :TargetId RETURNING * )
@@ -574,8 +560,6 @@ namespace OpenSim.Data.PGSQL
574 WHERE NOT EXISTS ( 560 WHERE NOT EXISTS (
575 SELECT * FROM upsert 561 SELECT * FROM upsert
576 )"; 562 )";
577
578
579 } 563 }
580 564
581 try 565 try
@@ -621,20 +605,16 @@ namespace OpenSim.Data.PGSQL
621 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon)) 605 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon))
622 { 606 {
623 cmd.Parameters.Add(m_database.CreateParameter("Id", props.UserId)); 607 cmd.Parameters.Add(m_database.CreateParameter("Id", props.UserId));
624 m_log.InfoFormat("Profile Data {0}", props.ToString());
625 608
626 using (NpgsqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 609 using (NpgsqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
627 { 610 {
628 if(reader.HasRows) 611 if(reader.HasRows)
629 { 612 {
630 m_log.DebugFormat("[PROFILES_DATA]" + 613 // m_log.DebugFormat("[PROFILES_DATA]" +
631 ": Getting data for {0}.", props.UserId); 614 // ": Getting data for {0}.", props.UserId);
632 reader.Read(); 615 reader.Read();
633 props.WebUrl = (string)reader["profileURL"].ToString(); 616 props.WebUrl = (string)reader["profileURL"].ToString();
634 m_log.DebugFormat("[PROFILES_DATA]: WebURL {0} ", props.WebUrl);
635 // UUID.TryParse((string)reader["profileImage"], out props.ImageId);
636 props.ImageId = DBGuid.FromDB(reader["profileImage"]); 617 props.ImageId = DBGuid.FromDB(reader["profileImage"]);
637 m_log.DebugFormat("[PROFILES_DATA]: profileImage {0} ", props.ImageId);
638 props.AboutText = (string)reader["profileAboutText"]; 618 props.AboutText = (string)reader["profileAboutText"];
639 props.FirstLifeImageId = DBGuid.FromDB(reader["profileFirstImage"]); 619 props.FirstLifeImageId = DBGuid.FromDB(reader["profileFirstImage"]);
640 props.FirstLifeText = (string)reader["profileFirstText"]; 620 props.FirstLifeText = (string)reader["profileFirstText"];
@@ -647,8 +627,8 @@ namespace OpenSim.Data.PGSQL
647 } 627 }
648 else 628 else
649 { 629 {
650 m_log.DebugFormat("[PROFILES_DATA]" + 630 //m_log.DebugFormat("[PROFILES_DATA]" +
651 ": No data for {0}", props.UserId); 631 // ": No data for {0}", props.UserId);
652 632
653 props.WebUrl = string.Empty; 633 props.WebUrl = string.Empty;
654 props.ImageId = UUID.Zero; 634 props.ImageId = UUID.Zero;
@@ -699,8 +679,8 @@ namespace OpenSim.Data.PGSQL
699 679
700 using (NpgsqlCommand put = new NpgsqlCommand(query, dbcon)) 680 using (NpgsqlCommand put = new NpgsqlCommand(query, dbcon))
701 { 681 {
702 m_log.DebugFormat("[PROFILES_DATA]" + 682 //m_log.DebugFormat("[PROFILES_DATA]" +
703 ": Adding new data for {0}", props.UserId); 683 // ": Adding new data for {0}", props.UserId);
704 684
705 put.Parameters.Add(m_database.CreateParameter("userId", props.UserId)); 685 put.Parameters.Add(m_database.CreateParameter("userId", props.UserId));
706 put.Parameters.Add(m_database.CreateParameter("profilePartner", props.PartnerId)); 686 put.Parameters.Add(m_database.CreateParameter("profilePartner", props.PartnerId));
@@ -727,7 +707,7 @@ namespace OpenSim.Data.PGSQL
727 catch (Exception e) 707 catch (Exception e)
728 { 708 {
729 m_log.DebugFormat("[PROFILES_DATA]" + 709 m_log.DebugFormat("[PROFILES_DATA]" +
730 ": Requst properties exception {0} {1}", e.Message, e.StackTrace); 710 ": Requst properties exception {0}", e.Message;
731 result = e.Message; 711 result = e.Message;
732 return false; 712 return false;
733 } 713 }
@@ -822,9 +802,6 @@ namespace OpenSim.Data.PGSQL
822 OSDArray data = new OSDArray(); 802 OSDArray data = new OSDArray();
823 string query = "SELECT \"snapshotuuid\" FROM {0} WHERE \"creatoruuid\" = :Id"; 803 string query = "SELECT \"snapshotuuid\" FROM {0} WHERE \"creatoruuid\" = :Id";
824 804
825 // Get classified image assets
826
827
828 try 805 try
829 { 806 {
830 using (NpgsqlConnection dbcon = new NpgsqlConnection(ConnectionString)) 807 using (NpgsqlConnection dbcon = new NpgsqlConnection(ConnectionString))