From d3eae4073e75d1482467eee54230df141bdbb568 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 3 Feb 2009 05:20:35 +0000 Subject: [PATCH] - move OpenSim/Framework/IUserData.cs to OpenSim/Data/IUserData.cs - trim trailing whitespace --- OpenSim/{Framework => Data}/IUserData.cs | 3 +- .../Communications/UserManagerBase.cs | 60 +++++++++---------- .../Tests/Common/Mock/TestUserDataPlugin.cs | 3 +- bin/OpenSim.Data.addin.xml | 2 +- 4 files changed, 35 insertions(+), 33 deletions(-) rename OpenSim/{Framework => Data}/IUserData.cs (99%) diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Data/IUserData.cs similarity index 99% rename from OpenSim/Framework/IUserData.cs rename to OpenSim/Data/IUserData.cs index 4653255026..1564033ba3 100644 --- a/OpenSim/Framework/IUserData.cs +++ b/OpenSim/Data/IUserData.cs @@ -27,8 +27,9 @@ using System.Collections.Generic; using OpenMetaverse; +using OpenSim.Framework; -namespace OpenSim.Framework +namespace OpenSim.Data { /// /// An interface for connecting to user storage servers. diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 2e3efd5e76..b12abb391a 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -35,8 +35,8 @@ using OpenMetaverse; using OpenMetaverse.StructuredData; using log4net; using Nwc.XmlRpc; -using OpenSim.Framework; using OpenSim.Framework.Statistics; +using OpenSim.Data; namespace OpenSim.Framework.Communications { @@ -52,22 +52,22 @@ namespace OpenSim.Framework.Communications /// List of plugins to search for user data /// private List _plugins = new List(); - + protected IInterServiceInventoryServices m_interServiceInventoryService; - + /// /// Constructor /// /// public UserManagerBase(IInterServiceInventoryServices interServiceInventoryService) { - m_interServiceInventoryService = interServiceInventoryService; - } - + m_interServiceInventoryService = interServiceInventoryService; + } + /// /// Add a new user data plugin - plugins will be requested in the order they were added. /// - /// The plugin that will provide user data + /// The plugin that will provide user data public void AddPlugin(IUserDataPlugin plugin) { _plugins.Add(plugin); @@ -85,13 +85,13 @@ namespace OpenSim.Framework.Communications // 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.Add("/OpenSim/UserData", new PluginProviderFilter(provider)); loader.Load(); _plugins.AddRange(loader.Plugins); } - #region Get UserProfile + #region Get UserProfile // see IUserService public UserProfileData GetUserProfile(string fname, string lname) @@ -109,7 +109,7 @@ namespace OpenSim.Framework.Communications return null; } - + public void LogoutUsers(UUID regionID) { foreach (IUserDataPlugin plugin in _plugins) @@ -117,7 +117,7 @@ namespace OpenSim.Framework.Communications plugin.LogoutUsers(regionID); } } - + public void ResetAttachments(UUID userID) { foreach (IUserDataPlugin plugin in _plugins) @@ -125,7 +125,7 @@ namespace OpenSim.Framework.Communications plugin.ResetAttachments(userID); } } - + public UserAgentData GetAgentByUUID(UUID userId) { foreach (IUserDataPlugin plugin in _plugins) @@ -140,7 +140,7 @@ namespace OpenSim.Framework.Communications return null; } - + // see IUserService public virtual UserProfileData GetUserProfile(UUID uuid) { @@ -173,7 +173,7 @@ namespace OpenSim.Framework.Communications return new List(); } } - + return pickerlist; } @@ -216,8 +216,8 @@ namespace OpenSim.Framework.Communications try { UserAgentData result = plugin.GetAgentByUUID(uuid); - - if (result != null) + + if (result != null) { return result; } @@ -288,8 +288,8 @@ namespace OpenSim.Framework.Communications try { List result = plugin.GetUserFriendList(ownerID); - - if (result != null) + + if (result != null) { return result; } @@ -310,8 +310,8 @@ namespace OpenSim.Framework.Communications try { Dictionary result = plugin.GetFriendRegionInfos(uuids); - - if (result != null) + + if (result != null) { return result; } @@ -396,7 +396,7 @@ namespace OpenSim.Framework.Communications { return; } - + profile.CurrentAgent = null; UpdateUserProfile(profile); @@ -623,7 +623,7 @@ namespace OpenSim.Framework.Communications string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) { string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); - + UserProfileData user = new UserProfileData(); user.HomeLocation = new Vector3(128, 128, 100); user.ID = SetUUID; @@ -657,9 +657,9 @@ namespace OpenSim.Framework.Communications else { m_interServiceInventoryService.CreateNewUserInventory(userProf.ID); - + return userProf.ID; - } + } } /// @@ -672,22 +672,22 @@ namespace OpenSim.Framework.Communications public bool ResetUserPassword(string firstName, string lastName, string newPassword) { string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(newPassword) + ":" + String.Empty); - + UserProfileData profile = GetUserProfile(firstName, lastName); - + if (null == profile) { m_log.ErrorFormat("[USERSTORAGE]: Could not find user {0} {1}", firstName, lastName); return false; } - + profile.PasswordHash = md5PasswdHash; profile.PasswordSalt = String.Empty; - + UpdateUserProfile(profile); - + return true; - } + } public abstract UserProfileData SetupMasterUser(string firstName, string lastName); public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password); diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs index 8dccacc6dd..73e8a0929a 100644 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Data; namespace OpenSim.Tests.Common.Mock { @@ -205,4 +206,4 @@ namespace OpenSim.Tests.Common.Mock public void LogoutUsers(UUID regionID) {} } -} \ No newline at end of file +} diff --git a/bin/OpenSim.Data.addin.xml b/bin/OpenSim.Data.addin.xml index 138f0babf7..2a3db5ffe3 100644 --- a/bin/OpenSim.Data.addin.xml +++ b/bin/OpenSim.Data.addin.xml @@ -21,6 +21,6 @@ - +