diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/IUserData.cs (renamed from OpenSim/Framework/IUserData.cs) | 3 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 60 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 3 | ||||
-rw-r--r-- | bin/OpenSim.Data.addin.xml | 2 |
4 files changed, 35 insertions, 33 deletions
diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Data/IUserData.cs index 4653255..1564033 100644 --- a/OpenSim/Framework/IUserData.cs +++ b/OpenSim/Data/IUserData.cs | |||
@@ -27,8 +27,9 @@ | |||
27 | 27 | ||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using OpenSim.Framework; | ||
30 | 31 | ||
31 | namespace OpenSim.Framework | 32 | namespace OpenSim.Data |
32 | { | 33 | { |
33 | /// <summary> | 34 | /// <summary> |
34 | /// An interface for connecting to user storage servers. | 35 | /// An interface for connecting to user storage servers. |
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 2e3efd5..b12abb3 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -35,8 +35,8 @@ using OpenMetaverse; | |||
35 | using OpenMetaverse.StructuredData; | 35 | using OpenMetaverse.StructuredData; |
36 | using log4net; | 36 | using log4net; |
37 | using Nwc.XmlRpc; | 37 | using Nwc.XmlRpc; |
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Framework.Statistics; | 38 | using OpenSim.Framework.Statistics; |
39 | using OpenSim.Data; | ||
40 | 40 | ||
41 | namespace OpenSim.Framework.Communications | 41 | namespace OpenSim.Framework.Communications |
42 | { | 42 | { |
@@ -52,22 +52,22 @@ namespace OpenSim.Framework.Communications | |||
52 | /// List of plugins to search for user data | 52 | /// List of plugins to search for user data |
53 | /// </value> | 53 | /// </value> |
54 | private List<IUserDataPlugin> _plugins = new List<IUserDataPlugin>(); | 54 | private List<IUserDataPlugin> _plugins = new List<IUserDataPlugin>(); |
55 | 55 | ||
56 | protected IInterServiceInventoryServices m_interServiceInventoryService; | 56 | protected IInterServiceInventoryServices m_interServiceInventoryService; |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Constructor | 59 | /// Constructor |
60 | /// </summary> | 60 | /// </summary> |
61 | /// <param name="interServiceInventoryService"></param> | 61 | /// <param name="interServiceInventoryService"></param> |
62 | public UserManagerBase(IInterServiceInventoryServices interServiceInventoryService) | 62 | public UserManagerBase(IInterServiceInventoryServices interServiceInventoryService) |
63 | { | 63 | { |
64 | m_interServiceInventoryService = interServiceInventoryService; | 64 | m_interServiceInventoryService = interServiceInventoryService; |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Add a new user data plugin - plugins will be requested in the order they were added. | 68 | /// Add a new user data plugin - plugins will be requested in the order they were added. |
69 | /// </summary> | 69 | /// </summary> |
70 | /// <param name="plugin">The plugin that will provide user data</param> | 70 | /// <param name="plugin">The plugin that will provide user data</param> |
71 | public void AddPlugin(IUserDataPlugin plugin) | 71 | public void AddPlugin(IUserDataPlugin plugin) |
72 | { | 72 | { |
73 | _plugins.Add(plugin); | 73 | _plugins.Add(plugin); |
@@ -85,13 +85,13 @@ namespace OpenSim.Framework.Communications | |||
85 | 85 | ||
86 | // loader will try to load all providers (MySQL, MSSQL, etc) | 86 | // loader will try to load all providers (MySQL, MSSQL, etc) |
87 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | 87 | // unless it is constrainted to the correct "Provider" entry in the addin.xml |
88 | loader.Add("/OpenSim/UserData", new PluginProviderFilter(provider)); | 88 | loader.Add("/OpenSim/UserData", new PluginProviderFilter(provider)); |
89 | loader.Load(); | 89 | loader.Load(); |
90 | 90 | ||
91 | _plugins.AddRange(loader.Plugins); | 91 | _plugins.AddRange(loader.Plugins); |
92 | } | 92 | } |
93 | 93 | ||
94 | #region Get UserProfile | 94 | #region Get UserProfile |
95 | 95 | ||
96 | // see IUserService | 96 | // see IUserService |
97 | public UserProfileData GetUserProfile(string fname, string lname) | 97 | public UserProfileData GetUserProfile(string fname, string lname) |
@@ -109,7 +109,7 @@ namespace OpenSim.Framework.Communications | |||
109 | 109 | ||
110 | return null; | 110 | return null; |
111 | } | 111 | } |
112 | 112 | ||
113 | public void LogoutUsers(UUID regionID) | 113 | public void LogoutUsers(UUID regionID) |
114 | { | 114 | { |
115 | foreach (IUserDataPlugin plugin in _plugins) | 115 | foreach (IUserDataPlugin plugin in _plugins) |
@@ -117,7 +117,7 @@ namespace OpenSim.Framework.Communications | |||
117 | plugin.LogoutUsers(regionID); | 117 | plugin.LogoutUsers(regionID); |
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | public void ResetAttachments(UUID userID) | 121 | public void ResetAttachments(UUID userID) |
122 | { | 122 | { |
123 | foreach (IUserDataPlugin plugin in _plugins) | 123 | foreach (IUserDataPlugin plugin in _plugins) |
@@ -125,7 +125,7 @@ namespace OpenSim.Framework.Communications | |||
125 | plugin.ResetAttachments(userID); | 125 | plugin.ResetAttachments(userID); |
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | public UserAgentData GetAgentByUUID(UUID userId) | 129 | public UserAgentData GetAgentByUUID(UUID userId) |
130 | { | 130 | { |
131 | foreach (IUserDataPlugin plugin in _plugins) | 131 | foreach (IUserDataPlugin plugin in _plugins) |
@@ -140,7 +140,7 @@ namespace OpenSim.Framework.Communications | |||
140 | 140 | ||
141 | return null; | 141 | return null; |
142 | } | 142 | } |
143 | 143 | ||
144 | // see IUserService | 144 | // see IUserService |
145 | public virtual UserProfileData GetUserProfile(UUID uuid) | 145 | public virtual UserProfileData GetUserProfile(UUID uuid) |
146 | { | 146 | { |
@@ -173,7 +173,7 @@ namespace OpenSim.Framework.Communications | |||
173 | return new List<AvatarPickerAvatar>(); | 173 | return new List<AvatarPickerAvatar>(); |
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | return pickerlist; | 177 | return pickerlist; |
178 | } | 178 | } |
179 | 179 | ||
@@ -216,8 +216,8 @@ namespace OpenSim.Framework.Communications | |||
216 | try | 216 | try |
217 | { | 217 | { |
218 | UserAgentData result = plugin.GetAgentByUUID(uuid); | 218 | UserAgentData result = plugin.GetAgentByUUID(uuid); |
219 | 219 | ||
220 | if (result != null) | 220 | if (result != null) |
221 | { | 221 | { |
222 | return result; | 222 | return result; |
223 | } | 223 | } |
@@ -288,8 +288,8 @@ namespace OpenSim.Framework.Communications | |||
288 | try | 288 | try |
289 | { | 289 | { |
290 | List<FriendListItem> result = plugin.GetUserFriendList(ownerID); | 290 | List<FriendListItem> result = plugin.GetUserFriendList(ownerID); |
291 | 291 | ||
292 | if (result != null) | 292 | if (result != null) |
293 | { | 293 | { |
294 | return result; | 294 | return result; |
295 | } | 295 | } |
@@ -310,8 +310,8 @@ namespace OpenSim.Framework.Communications | |||
310 | try | 310 | try |
311 | { | 311 | { |
312 | Dictionary<UUID, FriendRegionInfo> result = plugin.GetFriendRegionInfos(uuids); | 312 | Dictionary<UUID, FriendRegionInfo> result = plugin.GetFriendRegionInfos(uuids); |
313 | 313 | ||
314 | if (result != null) | 314 | if (result != null) |
315 | { | 315 | { |
316 | return result; | 316 | return result; |
317 | } | 317 | } |
@@ -396,7 +396,7 @@ namespace OpenSim.Framework.Communications | |||
396 | { | 396 | { |
397 | return; | 397 | return; |
398 | } | 398 | } |
399 | 399 | ||
400 | profile.CurrentAgent = null; | 400 | profile.CurrentAgent = null; |
401 | 401 | ||
402 | UpdateUserProfile(profile); | 402 | UpdateUserProfile(profile); |
@@ -623,7 +623,7 @@ namespace OpenSim.Framework.Communications | |||
623 | string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) | 623 | string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) |
624 | { | 624 | { |
625 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); | 625 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); |
626 | 626 | ||
627 | UserProfileData user = new UserProfileData(); | 627 | UserProfileData user = new UserProfileData(); |
628 | user.HomeLocation = new Vector3(128, 128, 100); | 628 | user.HomeLocation = new Vector3(128, 128, 100); |
629 | user.ID = SetUUID; | 629 | user.ID = SetUUID; |
@@ -657,9 +657,9 @@ namespace OpenSim.Framework.Communications | |||
657 | else | 657 | else |
658 | { | 658 | { |
659 | m_interServiceInventoryService.CreateNewUserInventory(userProf.ID); | 659 | m_interServiceInventoryService.CreateNewUserInventory(userProf.ID); |
660 | 660 | ||
661 | return userProf.ID; | 661 | return userProf.ID; |
662 | } | 662 | } |
663 | } | 663 | } |
664 | 664 | ||
665 | /// <summary> | 665 | /// <summary> |
@@ -672,22 +672,22 @@ namespace OpenSim.Framework.Communications | |||
672 | public bool ResetUserPassword(string firstName, string lastName, string newPassword) | 672 | public bool ResetUserPassword(string firstName, string lastName, string newPassword) |
673 | { | 673 | { |
674 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(newPassword) + ":" + String.Empty); | 674 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(newPassword) + ":" + String.Empty); |
675 | 675 | ||
676 | UserProfileData profile = GetUserProfile(firstName, lastName); | 676 | UserProfileData profile = GetUserProfile(firstName, lastName); |
677 | 677 | ||
678 | if (null == profile) | 678 | if (null == profile) |
679 | { | 679 | { |
680 | m_log.ErrorFormat("[USERSTORAGE]: Could not find user {0} {1}", firstName, lastName); | 680 | m_log.ErrorFormat("[USERSTORAGE]: Could not find user {0} {1}", firstName, lastName); |
681 | return false; | 681 | return false; |
682 | } | 682 | } |
683 | 683 | ||
684 | profile.PasswordHash = md5PasswdHash; | 684 | profile.PasswordHash = md5PasswdHash; |
685 | profile.PasswordSalt = String.Empty; | 685 | profile.PasswordSalt = String.Empty; |
686 | 686 | ||
687 | UpdateUserProfile(profile); | 687 | UpdateUserProfile(profile); |
688 | 688 | ||
689 | return true; | 689 | return true; |
690 | } | 690 | } |
691 | 691 | ||
692 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName); | 692 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName); |
693 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password); | 693 | 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 8dccacc..73e8a09 100644 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Data; | ||
32 | 33 | ||
33 | namespace OpenSim.Tests.Common.Mock | 34 | namespace OpenSim.Tests.Common.Mock |
34 | { | 35 | { |
@@ -205,4 +206,4 @@ namespace OpenSim.Tests.Common.Mock | |||
205 | 206 | ||
206 | public void LogoutUsers(UUID regionID) {} | 207 | public void LogoutUsers(UUID regionID) {} |
207 | } | 208 | } |
208 | } \ No newline at end of file | 209 | } |
diff --git a/bin/OpenSim.Data.addin.xml b/bin/OpenSim.Data.addin.xml index 138f0ba..2a3db5f 100644 --- a/bin/OpenSim.Data.addin.xml +++ b/bin/OpenSim.Data.addin.xml | |||
@@ -21,6 +21,6 @@ | |||
21 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin"/> | 21 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin"/> |
22 | </ExtensionPoint> | 22 | </ExtensionPoint> |
23 | <ExtensionPoint path = "/OpenSim/UserData"> | 23 | <ExtensionPoint path = "/OpenSim/UserData"> |
24 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IUserDataPlugin"/> | 24 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IUserDataPlugin"/> |
25 | </ExtensionPoint> | 25 | </ExtensionPoint> |
26 | </Addin> | 26 | </Addin> |