From 2270b252656146d9d74b84665a7ace6c3139db30 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Thu, 31 Jul 2008 09:24:28 +0000 Subject: Thanks, sempuki, for a patch that moves all Grid Server's plugins to PluginLoader. Fix issue 1871. --- .../Communications/Cache/AssetServerBase.cs | 2 +- .../Communications/Cache/SQLAssetServer.cs | 8 +- .../Communications/InventoryServiceBase.cs | 81 +++++----- .../Framework/Communications/UserManagerBase.cs | 169 +++++++++------------ 4 files changed, 114 insertions(+), 146 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index f729d78..ed5b896 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -43,7 +43,7 @@ namespace OpenSim.Framework.Communications.Cache protected IAssetReceiver m_receiver; protected BlockingQueue m_assetRequests; protected Thread m_localAssetServerThread; - protected IAssetProvider m_assetProvider; + protected IAssetProviderPlugin m_assetProvider; // Temporarily hardcoded - should be a plugin protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs index 94a8509..2f72e11 100644 --- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs +++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs @@ -40,7 +40,7 @@ namespace OpenSim.Framework.Communications.Cache AddPlugin(pluginName, connect); } - public SQLAssetServer(IAssetProvider assetProvider) + public SQLAssetServer(IAssetProviderPlugin assetProvider) { m_assetProvider = assetProvider; } @@ -54,12 +54,12 @@ namespace OpenSim.Framework.Communications.Cache { if (!pluginType.IsAbstract) { - Type typeInterface = pluginType.GetInterface("IAssetProvider", true); + Type typeInterface = pluginType.GetInterface("IAssetProviderPlugin", true); if (typeInterface != null) { - IAssetProvider plug = - (IAssetProvider) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + IAssetProviderPlugin plug = + (IAssetProviderPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); m_assetProvider = plug; m_assetProvider.Initialise(connect); diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 06b707b..40701f0 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -43,38 +43,25 @@ namespace OpenSim.Framework.Communications private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected Dictionary m_plugins = new Dictionary(); + protected List m_plugins = new List(); #region Plugin methods /// /// Adds a new user server plugin - plugins will be requested in the order they were loaded. /// - /// The filename to the user server plugin DLL - public void AddPlugin(string FileName, string connect) + /// The filename to the user server plugin DLL + public void AddPlugin(string provider, string connect) { - if (!String.IsNullOrEmpty(FileName)) - { - m_log.Info("[AGENT INVENTORY]: Inventory storage: Attempting to load " + FileName); - Assembly pluginAssembly = Assembly.LoadFrom(FileName); - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IInventoryData", true); - - if (typeInterface != null) - { - IInventoryData plug = - (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(connect); - m_plugins.Add(plug.getName(), plug); - m_log.Info("[AGENTINVENTORY]: Added IInventoryData Interface"); - } - } - } - } + PluginLoader loader = + new PluginLoader (new InventoryDataInitialiser (connect)); + + // loader will try to load all providers (MySQL, MSSQL, etc) + // unless it is constrainted to the correct "Provider" entry in the addin.xml + loader.Add ("/OpenSim/InventoryData", new PluginProviderFilter (provider)); + loader.Load(); + + m_plugins = loader.Plugins; } #endregion @@ -103,9 +90,9 @@ namespace OpenSim.Framework.Communications userFolders.Add(rootFolder); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - IList folders = plugin.Value.getFolderHierarchy(rootFolder.ID); + IList folders = plugin.getFolderHierarchy(rootFolder.ID); userFolders.AddRange(folders); } @@ -127,9 +114,9 @@ namespace OpenSim.Framework.Communications public InventoryFolderBase RequestRootFolder(LLUUID userID) { // FIXME: Probably doesn't do what was originally intended - only ever queries the first plugin - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - return plugin.Value.getUserRootFolder(userID); + return plugin.getUserRootFolder(userID); } return null; } @@ -168,9 +155,9 @@ namespace OpenSim.Framework.Communications public List RequestSubFolders(LLUUID parentFolderID) { List inventoryList = new List(); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - return plugin.Value.getInventoryFolders(parentFolderID); + return plugin.getInventoryFolders(parentFolderID); } return inventoryList; } @@ -178,9 +165,9 @@ namespace OpenSim.Framework.Communications public List RequestFolderItems(LLUUID folderID) { List itemsList = new List(); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - itemsList = plugin.Value.getInventoryInFolder(folderID); + itemsList = plugin.getInventoryInFolder(folderID); return itemsList; } return itemsList; @@ -194,9 +181,9 @@ namespace OpenSim.Framework.Communications m_log.DebugFormat( "[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - plugin.Value.addInventoryFolder(folder); + plugin.addInventoryFolder(folder); } // FIXME: Should return false on failure @@ -209,9 +196,9 @@ namespace OpenSim.Framework.Communications m_log.DebugFormat( "[AGENT INVENTORY]: Updating folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - plugin.Value.updateInventoryFolder(folder); + plugin.updateInventoryFolder(folder); } // FIXME: Should return false on failure @@ -224,9 +211,9 @@ namespace OpenSim.Framework.Communications m_log.DebugFormat( "[AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - plugin.Value.moveInventoryFolder(folder); + plugin.moveInventoryFolder(folder); } // FIXME: Should return false on failure @@ -239,9 +226,9 @@ namespace OpenSim.Framework.Communications m_log.DebugFormat( "[AGENT INVENTORY]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - plugin.Value.addInventoryItem(item); + plugin.addInventoryItem(item); } // FIXME: Should return false on failure @@ -254,9 +241,9 @@ namespace OpenSim.Framework.Communications m_log.InfoFormat( "[AGENT INVENTORY]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - plugin.Value.updateInventoryItem(item); + plugin.updateInventoryItem(item); } // FIXME: Should return false on failure @@ -269,9 +256,9 @@ namespace OpenSim.Framework.Communications m_log.InfoFormat( "[AGENT INVENTORY]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - plugin.Value.deleteInventoryItem(item.ID); + plugin.deleteInventoryItem(item.ID); } // FIXME: Should return false on failure @@ -296,9 +283,9 @@ namespace OpenSim.Framework.Communications { // m_log.DebugFormat("[AGENT INVENTORY]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID); - foreach (KeyValuePair plugin in m_plugins) + foreach (IInventoryDataPlugin plugin in m_plugins) { - plugin.Value.deleteInventoryFolder(subFolder.ID); + plugin.deleteInventoryFolder(subFolder.ID); } } diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 1b73152..f8e77df 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -47,42 +47,23 @@ namespace OpenSim.Framework.Communications = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public UserConfig _config; - private Dictionary _plugins = new Dictionary(); + private List _plugins = new List(); /// /// Adds a new user server plugin - user servers will be requested in the order they were loaded. /// - /// The filename to the user server plugin DLL - public void AddPlugin(string FileName, string connect) + /// The filename to the user server plugin DLL + public void AddPlugin(string provider, string connect) { - if (!String.IsNullOrEmpty(FileName)) - { - m_log.Info("[USERSTORAGE]: Attempting to load " + FileName); - Assembly pluginAssembly = Assembly.LoadFrom(FileName); - - m_log.Info("[USERSTORAGE]: Found " + pluginAssembly.GetTypes().Length + " interfaces."); - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IUserData", true); - - if (typeInterface != null) - { - IUserData plug = - (IUserData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - AddPlugin(plug, connect); - } - } - } - } - } - - public void AddPlugin(IUserData plug, string connect) - { - plug.Initialise(connect); - _plugins.Add(plug.Name, plug); - m_log.Info("[USERSTORAGE]: Added IUserData Interface"); + PluginLoader loader = + new PluginLoader (new UserDataInitialiser (connect)); + + // loader will try to load all providers (MySQL, MSSQL, etc) + // unless it is constrainted to the correct "Provider" entry in the addin.xml + loader.Add ("/OpenSim/UserData", new PluginProviderFilter (provider)); + loader.Load(); + + _plugins = loader.Plugins; } #region Get UserProfile @@ -90,9 +71,9 @@ namespace OpenSim.Framework.Communications // see IUserService public UserProfileData GetUserProfile(string fname, string lname) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { - UserProfileData profile = plugin.Value.GetUserByName(fname, lname); + UserProfileData profile = plugin.GetUserByName(fname, lname); if (profile != null) { @@ -105,9 +86,9 @@ namespace OpenSim.Framework.Communications } public UserAgentData GetAgentByUUID(LLUUID userId) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { - UserAgentData agent = plugin.Value.GetAgentByUUID(userId); + UserAgentData agent = plugin.GetAgentByUUID(userId); if (agent != null) { @@ -120,9 +101,9 @@ namespace OpenSim.Framework.Communications // see IUserService public UserProfileData GetUserProfile(LLUUID uuid) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { - UserProfileData profile = plugin.Value.GetUserByUUID(uuid); + UserProfileData profile = plugin.GetUserByUUID(uuid); if (null != profile) { @@ -137,15 +118,15 @@ namespace OpenSim.Framework.Communications public List GenerateAgentPickerRequestResponse(LLUUID queryID, string query) { List pickerlist = new List(); - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - pickerlist = plugin.Value.GeneratePickerResults(queryID, query); + pickerlist = plugin.GeneratePickerResults(queryID, query); } catch (Exception) { - m_log.Info("[USERSTORAGE]: Unable to generate AgentPickerData via " + plugin.Key + "(" + query + ")"); + m_log.Info("[USERSTORAGE]: Unable to generate AgentPickerData via " + plugin.Name + "(" + query + ")"); return new List(); } } @@ -159,17 +140,17 @@ namespace OpenSim.Framework.Communications /// public bool UpdateUserProfile(UserProfileData data) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.UpdateUserProfile(data); + plugin.UpdateUserProfile(data); return true; } catch (Exception e) { m_log.InfoFormat("[USERSTORAGE]: Unable to set user {0} {1} via {2}: {3}", data.FirstName, data.SurName, - plugin.Key, e.ToString()); + plugin.Name, e.ToString()); } } return false; @@ -186,15 +167,15 @@ namespace OpenSim.Framework.Communications /// Agent profiles public UserAgentData GetUserAgent(LLUUID uuid) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - return plugin.Value.GetAgentByUUID(uuid); + return plugin.GetAgentByUUID(uuid); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Name + "(" + e.ToString() + ")"); } } @@ -208,15 +189,15 @@ namespace OpenSim.Framework.Communications /// A user agent public UserAgentData GetUserAgent(string name) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - return plugin.Value.GetAgentByName(name); + return plugin.GetAgentByName(name); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Name + "(" + e.ToString() + ")"); } } @@ -231,15 +212,15 @@ namespace OpenSim.Framework.Communications /// A user agent public UserAgentData GetUserAgent(string fname, string lname) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - return plugin.Value.GetAgentByName(fname, lname); + return plugin.GetAgentByName(fname, lname); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Name + "(" + e.ToString() + ")"); } } @@ -248,15 +229,15 @@ namespace OpenSim.Framework.Communications public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.UpdateUserCurrentRegion(avatarid, regionuuid, regionhandle); + plugin.UpdateUserCurrentRegion(avatarid, regionuuid, regionhandle); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to updateuser location via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to updateuser location via " + plugin.Name + "(" + e.ToString() + ")"); } } } @@ -268,15 +249,15 @@ namespace OpenSim.Framework.Communications /// A List of FriendListItems that contains info about the user's friends public List GetUserFriendList(LLUUID ownerID) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - return plugin.Value.GetUserFriendList(ownerID); + return plugin.GetUserFriendList(ownerID); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to GetUserFriendList via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to GetUserFriendList via " + plugin.Name + "(" + e.ToString() + ")"); } } @@ -285,60 +266,60 @@ namespace OpenSim.Framework.Communications public void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.StoreWebLoginKey(agentID, webLoginKey); + plugin.StoreWebLoginKey(agentID, webLoginKey); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to Store WebLoginKey via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to Store WebLoginKey via " + plugin.Name + "(" + e.ToString() + ")"); } } } public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.AddNewUserFriend(friendlistowner,friend,perms); + plugin.AddNewUserFriend(friendlistowner,friend,perms); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to AddNewUserFriend via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to AddNewUserFriend via " + plugin.Name + "(" + e.ToString() + ")"); } } } public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.RemoveUserFriend(friendlistowner, friend); + plugin.RemoveUserFriend(friendlistowner, friend); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to RemoveUserFriend via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to RemoveUserFriend via " + plugin.Name + "(" + e.ToString() + ")"); } } } public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.UpdateUserFriendPerms(friendlistowner, friend, perms); + plugin.UpdateUserFriendPerms(friendlistowner, friend, perms); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to UpdateUserFriendPerms via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to UpdateUserFriendPerms via " + plugin.Name + "(" + e.ToString() + ")"); } } } @@ -564,15 +545,15 @@ namespace OpenSim.Framework.Communications user.HomeRegionX = regX; user.HomeRegionY = regY; - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.AddNewUserProfile(user); + plugin.AddNewUserProfile(user); } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to add user via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to add user via " + plugin.Name + "(" + e.ToString() + ")"); } } @@ -586,16 +567,16 @@ namespace OpenSim.Framework.Communications m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.ID.ToString()); return false; } - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.UpdateUserProfile(UserProfile); + plugin.UpdateUserProfile(UserProfile); } catch (Exception e) { m_log.Info("[USERSTORAGE]: Unable to update user " + UserProfile.ID.ToString() - + " via " + plugin.Key + "(" + e.ToString() + ")"); + + " via " + plugin.Name + "(" + e.ToString() + ")"); return false; } } @@ -612,16 +593,16 @@ namespace OpenSim.Framework.Communications /// The agent data to be added public bool AddUserAgent(UserAgentData agentdata) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.AddNewUserAgent(agentdata); + plugin.AddNewUserAgent(agentdata); return true; } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to add agent via " + plugin.Key + "(" + e.ToString() + ")"); + m_log.Info("[USERSTORAGE]: Unable to add agent via " + plugin.Name + "(" + e.ToString() + ")"); } } return false; @@ -631,15 +612,15 @@ namespace OpenSim.Framework.Communications /// TODO: stubs for now to get us to a compiling state gently public AvatarAppearance GetUserAppearance(LLUUID user) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - return plugin.Value.GetUserAppearance(user); + return plugin.GetUserAppearance(user); } catch (Exception e) { - m_log.InfoFormat("[USERSTORAGE]: Unable to find user appearance {0} via {1} ({2})", user.ToString(), plugin.Key, e.ToString()); + m_log.InfoFormat("[USERSTORAGE]: Unable to find user appearance {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString()); } } return null; @@ -647,60 +628,60 @@ namespace OpenSim.Framework.Communications public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.UpdateUserAppearance(user, appearance); + plugin.UpdateUserAppearance(user, appearance); } catch (Exception e) { - m_log.InfoFormat("[USERSTORAGE]: Unable to update user appearance {0} via {1} ({2})", user.ToString(), plugin.Key, e.ToString()); + m_log.InfoFormat("[USERSTORAGE]: Unable to update user appearance {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString()); } } } public void AddAttachment(LLUUID user, LLUUID item) { - foreach (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.AddAttachment(user, item); + plugin.AddAttachment(user, item); } catch (Exception e) { - m_log.InfoFormat("[USERSTORAGE]: Unable to attach {3} => {0} via {1} ({2})", user.ToString(), plugin.Key, e.ToString(), item.ToString()); + 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 (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - plugin.Value.RemoveAttachment(user, item); + plugin.RemoveAttachment(user, item); } catch (Exception e) { - m_log.InfoFormat("[USERSTORAGE]: Unable to remove attachment {3} => {0} via {1} ({2})", user.ToString(), plugin.Key, e.ToString(), item.ToString()); + 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 (KeyValuePair plugin in _plugins) + foreach (IUserData plugin in _plugins) { try { - return plugin.Value.GetAttachments(user); + return plugin.GetAttachments(user); } catch (Exception e) { - m_log.InfoFormat("[USERSTORAGE]: Unable to get attachments for {0} via {1} ({2})", user.ToString(), plugin.Key, e.ToString()); + 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