- move OpenSim/Framework/IUserData.cs to OpenSim/Data/IUserData.cs
- trim trailing whitespace0.6.3-post-fixes
parent
9377c6f2b2
commit
d3eae4073e
|
@ -27,8 +27,9 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
|
||||||
namespace OpenSim.Framework
|
namespace OpenSim.Data
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An interface for connecting to user storage servers.
|
/// An interface for connecting to user storage servers.
|
|
@ -35,8 +35,8 @@ using OpenMetaverse;
|
||||||
using OpenMetaverse.StructuredData;
|
using OpenMetaverse.StructuredData;
|
||||||
using log4net;
|
using log4net;
|
||||||
using Nwc.XmlRpc;
|
using Nwc.XmlRpc;
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Framework.Statistics;
|
using OpenSim.Framework.Statistics;
|
||||||
|
using OpenSim.Data;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications
|
namespace OpenSim.Framework.Communications
|
||||||
{
|
{
|
||||||
|
@ -52,22 +52,22 @@ namespace OpenSim.Framework.Communications
|
||||||
/// List of plugins to search for user data
|
/// List of plugins to search for user data
|
||||||
/// </value>
|
/// </value>
|
||||||
private List<IUserDataPlugin> _plugins = new List<IUserDataPlugin>();
|
private List<IUserDataPlugin> _plugins = new List<IUserDataPlugin>();
|
||||||
|
|
||||||
protected IInterServiceInventoryServices m_interServiceInventoryService;
|
protected IInterServiceInventoryServices m_interServiceInventoryService;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="interServiceInventoryService"></param>
|
/// <param name="interServiceInventoryService"></param>
|
||||||
public UserManagerBase(IInterServiceInventoryServices interServiceInventoryService)
|
public UserManagerBase(IInterServiceInventoryServices interServiceInventoryService)
|
||||||
{
|
{
|
||||||
m_interServiceInventoryService = interServiceInventoryService;
|
m_interServiceInventoryService = interServiceInventoryService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a new user data plugin - plugins will be requested in the order they were added.
|
/// Add a new user data plugin - plugins will be requested in the order they were added.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="plugin">The plugin that will provide user data</param>
|
/// <param name="plugin">The plugin that will provide user data</param>
|
||||||
public void AddPlugin(IUserDataPlugin plugin)
|
public void AddPlugin(IUserDataPlugin plugin)
|
||||||
{
|
{
|
||||||
_plugins.Add(plugin);
|
_plugins.Add(plugin);
|
||||||
|
@ -85,13 +85,13 @@ namespace OpenSim.Framework.Communications
|
||||||
|
|
||||||
// loader will try to load all providers (MySQL, MSSQL, etc)
|
// loader will try to load all providers (MySQL, MSSQL, etc)
|
||||||
// unless it is constrainted to the correct "Provider" entry in the addin.xml
|
// 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();
|
loader.Load();
|
||||||
|
|
||||||
_plugins.AddRange(loader.Plugins);
|
_plugins.AddRange(loader.Plugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Get UserProfile
|
#region Get UserProfile
|
||||||
|
|
||||||
// see IUserService
|
// see IUserService
|
||||||
public UserProfileData GetUserProfile(string fname, string lname)
|
public UserProfileData GetUserProfile(string fname, string lname)
|
||||||
|
@ -109,7 +109,7 @@ namespace OpenSim.Framework.Communications
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LogoutUsers(UUID regionID)
|
public void LogoutUsers(UUID regionID)
|
||||||
{
|
{
|
||||||
foreach (IUserDataPlugin plugin in _plugins)
|
foreach (IUserDataPlugin plugin in _plugins)
|
||||||
|
@ -117,7 +117,7 @@ namespace OpenSim.Framework.Communications
|
||||||
plugin.LogoutUsers(regionID);
|
plugin.LogoutUsers(regionID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetAttachments(UUID userID)
|
public void ResetAttachments(UUID userID)
|
||||||
{
|
{
|
||||||
foreach (IUserDataPlugin plugin in _plugins)
|
foreach (IUserDataPlugin plugin in _plugins)
|
||||||
|
@ -125,7 +125,7 @@ namespace OpenSim.Framework.Communications
|
||||||
plugin.ResetAttachments(userID);
|
plugin.ResetAttachments(userID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserAgentData GetAgentByUUID(UUID userId)
|
public UserAgentData GetAgentByUUID(UUID userId)
|
||||||
{
|
{
|
||||||
foreach (IUserDataPlugin plugin in _plugins)
|
foreach (IUserDataPlugin plugin in _plugins)
|
||||||
|
@ -140,7 +140,7 @@ namespace OpenSim.Framework.Communications
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// see IUserService
|
// see IUserService
|
||||||
public virtual UserProfileData GetUserProfile(UUID uuid)
|
public virtual UserProfileData GetUserProfile(UUID uuid)
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,7 @@ namespace OpenSim.Framework.Communications
|
||||||
return new List<AvatarPickerAvatar>();
|
return new List<AvatarPickerAvatar>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pickerlist;
|
return pickerlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,8 +216,8 @@ namespace OpenSim.Framework.Communications
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
UserAgentData result = plugin.GetAgentByUUID(uuid);
|
UserAgentData result = plugin.GetAgentByUUID(uuid);
|
||||||
|
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -288,8 +288,8 @@ namespace OpenSim.Framework.Communications
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<FriendListItem> result = plugin.GetUserFriendList(ownerID);
|
List<FriendListItem> result = plugin.GetUserFriendList(ownerID);
|
||||||
|
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -310,8 +310,8 @@ namespace OpenSim.Framework.Communications
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Dictionary<UUID, FriendRegionInfo> result = plugin.GetFriendRegionInfos(uuids);
|
Dictionary<UUID, FriendRegionInfo> result = plugin.GetFriendRegionInfos(uuids);
|
||||||
|
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ namespace OpenSim.Framework.Communications
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.CurrentAgent = null;
|
profile.CurrentAgent = null;
|
||||||
|
|
||||||
UpdateUserProfile(profile);
|
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 firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID)
|
||||||
{
|
{
|
||||||
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);
|
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);
|
||||||
|
|
||||||
UserProfileData user = new UserProfileData();
|
UserProfileData user = new UserProfileData();
|
||||||
user.HomeLocation = new Vector3(128, 128, 100);
|
user.HomeLocation = new Vector3(128, 128, 100);
|
||||||
user.ID = SetUUID;
|
user.ID = SetUUID;
|
||||||
|
@ -657,9 +657,9 @@ namespace OpenSim.Framework.Communications
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_interServiceInventoryService.CreateNewUserInventory(userProf.ID);
|
m_interServiceInventoryService.CreateNewUserInventory(userProf.ID);
|
||||||
|
|
||||||
return userProf.ID;
|
return userProf.ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -672,22 +672,22 @@ namespace OpenSim.Framework.Communications
|
||||||
public bool ResetUserPassword(string firstName, string lastName, string newPassword)
|
public bool ResetUserPassword(string firstName, string lastName, string newPassword)
|
||||||
{
|
{
|
||||||
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(newPassword) + ":" + String.Empty);
|
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(newPassword) + ":" + String.Empty);
|
||||||
|
|
||||||
UserProfileData profile = GetUserProfile(firstName, lastName);
|
UserProfileData profile = GetUserProfile(firstName, lastName);
|
||||||
|
|
||||||
if (null == profile)
|
if (null == profile)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[USERSTORAGE]: Could not find user {0} {1}", firstName, lastName);
|
m_log.ErrorFormat("[USERSTORAGE]: Could not find user {0} {1}", firstName, lastName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.PasswordHash = md5PasswdHash;
|
profile.PasswordHash = md5PasswdHash;
|
||||||
profile.PasswordSalt = String.Empty;
|
profile.PasswordSalt = String.Empty;
|
||||||
|
|
||||||
UpdateUserProfile(profile);
|
UpdateUserProfile(profile);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract UserProfileData SetupMasterUser(string firstName, string lastName);
|
public abstract UserProfileData SetupMasterUser(string firstName, string lastName);
|
||||||
public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password);
|
public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password);
|
||||||
|
|
|
@ -29,6 +29,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Data;
|
||||||
|
|
||||||
namespace OpenSim.Tests.Common.Mock
|
namespace OpenSim.Tests.Common.Mock
|
||||||
{
|
{
|
||||||
|
@ -205,4 +206,4 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
|
|
||||||
public void LogoutUsers(UUID regionID) {}
|
public void LogoutUsers(UUID regionID) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,6 @@
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin"/>
|
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin"/>
|
||||||
</ExtensionPoint>
|
</ExtensionPoint>
|
||||||
<ExtensionPoint path = "/OpenSim/UserData">
|
<ExtensionPoint path = "/OpenSim/UserData">
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IUserDataPlugin"/>
|
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IUserDataPlugin"/>
|
||||||
</ExtensionPoint>
|
</ExtensionPoint>
|
||||||
</Addin>
|
</Addin>
|
||||||
|
|
Loading…
Reference in New Issue