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/Framework/Communications/LoginService.cs | 6 +++ .../Framework/Communications/UserManagerBase.cs | 53 +++------------------- 2 files changed, 13 insertions(+), 46 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 40064d3..73fba1e 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -220,6 +220,9 @@ namespace OpenSim.Framework.Communications } // Otherwise... // Create a new agent session + + m_userManager.ResetAttachments(userProfile.ID); + CreateAgent(userProfile, request); try @@ -390,6 +393,9 @@ namespace OpenSim.Framework.Communications // Otherwise... // Create a new agent session + + m_userManager.ResetAttachments(userProfile.ID); + CreateAgent(userProfile, request); try diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index feeb666..ef900ea 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -83,6 +83,13 @@ namespace OpenSim.Framework.Communications return null; } + public void ResetAttachments(LLUUID userID) + { + foreach (IUserDataPlugin plugin in _plugins) + { + plugin.ResetAttachments(userID); + } + } public UserAgentData GetAgentByUUID(LLUUID userId) { foreach (IUserDataPlugin plugin in _plugins) @@ -639,51 +646,5 @@ namespace OpenSim.Framework.Communications } } } - - public void AddAttachment(LLUUID user, LLUUID item) - { - foreach (IUserDataPlugin plugin in _plugins) - { - try - { - plugin.AddAttachment(user, item); - } - catch (Exception e) - { - m_log.InfoFormat("[USERSTORAGE]: Unable to attach {3} => {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString(), item.ToString()); - } - } - } - - public void RemoveAttachment(LLUUID user, LLUUID item) - { - foreach (IUserDataPlugin plugin in _plugins) - { - try - { - plugin.RemoveAttachment(user, item); - } - catch (Exception e) - { - m_log.InfoFormat("[USERSTORAGE]: Unable to remove attachment {3} => {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString(), item.ToString()); - } - } - } - - public List GetAttachments(LLUUID user) - { - foreach (IUserDataPlugin plugin in _plugins) - { - try - { - return plugin.GetAttachments(user); - } - catch (Exception e) - { - m_log.InfoFormat("[USERSTORAGE]: Unable to get attachments for {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString()); - } - } - return new List(); - } } } -- cgit v1.1