From 41440e184b1c12f1b83d894b2cd5b7b801b4ca38 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 19 Aug 2008 18:34:46 +0000
Subject: Attachment persistence (Mantis #1711) Change user server to handle
attachment assets record properly. Ensure that attachments are not re-rezzed
on region crossing. Persistence will NOT WORK with earliser UGAI!! Change
region server to match.
---
OpenSim/Data/MSSQL/MSSQLUserData.cs | 35 +++---------------------
OpenSim/Data/MySQL/MySQLUserData.cs | 39 +++++++--------------------
OpenSim/Data/NHibernate/NHibernateUserData.cs | 13 +--------
OpenSim/Data/SQLite/SQLiteUserData.cs | 37 +++----------------------
OpenSim/Data/UserDataBase.cs | 4 +--
5 files changed, 19 insertions(+), 109 deletions(-)
(limited to 'OpenSim/Data')
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs
index e63a9fe..cfe5f50 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs
@@ -893,37 +893,6 @@ namespace OpenSim.Data.MSSQL
}
///
- /// add an attachement to an avatar
- ///
- /// the avatar UUID
- /// the item UUID
- override public void AddAttachment(LLUUID user, LLUUID item)
- {
- // TBI?
- }
-
- ///
- /// Remove an attachement from an avatar
- ///
- /// the avatar UUID
- /// the item UUID
- override public void RemoveAttachment(LLUUID user, LLUUID item)
- {
- // TBI?
- }
-
- ///
- /// get (fetch?) all attached item to an avatar
- ///
- /// the avatar UUID
- /// List of attached item
- /// return an empty list
- override public List GetAttachments(LLUUID user)
- {
- return new List();
- }
-
- ///
/// Database provider name
///
/// Provider name
@@ -948,5 +917,9 @@ namespace OpenSim.Data.MSSQL
public void runQuery(string query)
{
}
+
+ override public void ResetAttachments(LLUUID userID)
+ {
+ }
}
}
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index 9a056b2..caae677 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -779,36 +779,6 @@ namespace OpenSim.Data.MySQL
}
///
- /// Adds an attachment item to a user
- ///
- /// the user UUID
- /// the item UUID
- override public void AddAttachment(LLUUID user, LLUUID item)
- {
- return;
- }
-
- ///
- /// Removes an attachment from a user
- ///
- /// the user UUID
- /// the item UUID
- override public void RemoveAttachment(LLUUID user, LLUUID item)
- {
- return;
- }
-
- ///
- /// Get the list of item attached to a user
- ///
- /// the user UUID
- /// UUID list of attached item
- override public List GetAttachments(LLUUID user)
- {
- return new List();
- }
-
- ///
/// Database provider name
///
/// Provider name
@@ -845,5 +815,14 @@ namespace OpenSim.Data.MySQL
{
database.writeAttachments(agentID, data);
}
+
+ override public void ResetAttachments(LLUUID userID)
+ {
+ MySqlCommand cmd = (MySqlCommand) (database.Connection.CreateCommand());
+ cmd.CommandText = "update avatarattachments set asset = '00000000-0000-0000-0000-000000000000' where UUID = ?uuid";
+ cmd.Parameters.AddWithValue("?uuid", userID.ToString());
+
+ cmd.ExecuteNonQuery();
+ }
}
}
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs
index c776474..8435762 100644
--- a/OpenSim/Data/NHibernate/NHibernateUserData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs
@@ -303,19 +303,8 @@ namespace OpenSim.Data.NHibernate
}
}
- override public void AddAttachment(LLUUID user, LLUUID item)
+ public override void ResetAttachments(LLUUID userID)
{
- return;
- }
-
- override public void RemoveAttachment(LLUUID user, LLUUID item)
- {
- return;
- }
-
- override public List GetAttachments(LLUUID user)
- {
- return new List();
}
public override string Name {
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index 08a97f09..beff2a4 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -583,39 +583,6 @@ namespace OpenSim.Data.SQLite
}
///
- /// Add an attachment item to an avatar
- ///
- /// the user UUID
- /// the item UUID
- /// DO NOTHING ?
- override public void AddAttachment(LLUUID user, LLUUID item)
- {
- return;
- }
-
- ///
- /// Remove an attachement item from an avatar
- ///
- /// the user UUID
- /// the item UUID
- /// DO NOTHING ?
- override public void RemoveAttachment(LLUUID user, LLUUID item)
- {
- return;
- }
-
- ///
- /// Get list of attached item
- ///
- /// the user UUID
- /// List of attached item
- /// DO NOTHING ?
- override public List GetAttachments(LLUUID user)
- {
- return new List();
- }
-
- ///
/// Returns the name of the storage provider
///
/// Storage provider name
@@ -1040,5 +1007,9 @@ namespace OpenSim.Data.SQLite
// return true;
}
+
+ override public void ResetAttachments(LLUUID userID)
+ {
+ }
}
}
diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs
index b984c10..e57c8f8 100644
--- a/OpenSim/Data/UserDataBase.cs
+++ b/OpenSim/Data/UserDataBase.cs
@@ -72,9 +72,7 @@ namespace OpenSim.Data
// aplist[user] = appearance;
// m_log.Info("[APPEARANCE] Setting appearance for " + user.ToString() + appearance.ToString());
// }
- public abstract void AddAttachment(LLUUID user, LLUUID item);
- public abstract void RemoveAttachment(LLUUID user, LLUUID item);
- public abstract List GetAttachments(LLUUID user);
+ public abstract void ResetAttachments(LLUUID userID);
public abstract string Version {get;}
public abstract string Name {get;}
--
cgit v1.1