mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
* Fission OGS1UserServices into user service and OGS1 user data plugin components
* Make OGS1UserServices inherit from UserManagerBase * This allows grid mode regions to use the same user data plugin infrastructure as grid servers and standalone OpenSims
This commit is contained in:
@@ -31,10 +31,18 @@ namespace OpenSim.Framework.Communications
|
||||
{
|
||||
public interface IAvatarService
|
||||
{
|
||||
/// Get's the User Appearance
|
||||
/// <summary>
|
||||
/// Get avatar appearance information
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <returns></returns>
|
||||
AvatarAppearance GetUserAppearance(UUID user);
|
||||
|
||||
/// <summary>
|
||||
/// Update avatar appearance information
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="appearance"></param>
|
||||
void UpdateUserAppearance(UUID user, AvatarAppearance appearance);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1147,14 +1147,15 @@ namespace OpenSim.Framework.Communications.Services
|
||||
if (m_userManager.VerifySession(guess_aid, guess_sid))
|
||||
{
|
||||
authed = "TRUE";
|
||||
m_log.InfoFormat("[UserManager]: CheckAuthSession TRUE for user {0}", guess_aid);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.InfoFormat("[UserManager]: CheckAuthSession FALSE");
|
||||
return Util.CreateUnknownUserErrorResponse();
|
||||
}
|
||||
m_log.InfoFormat("[UserManager]: CheckAuthSession TRUE for user {0}", guess_aid);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.InfoFormat("[UserManager]: CheckAuthSession FALSE");
|
||||
return Util.CreateUnknownUserErrorResponse();
|
||||
}
|
||||
|
||||
Hashtable responseData = new Hashtable();
|
||||
responseData["auth_session"] = authed;
|
||||
response.Value = responseData;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenSim.Framework.Communications
|
||||
/// <value>
|
||||
/// List of plugins to search for user data
|
||||
/// </value>
|
||||
private List<IUserDataPlugin> _plugins = new List<IUserDataPlugin>();
|
||||
private List<IUserDataPlugin> m_plugins = new List<IUserDataPlugin>();
|
||||
|
||||
protected IInterServiceInventoryServices m_interServiceInventoryService;
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Framework.Communications
|
||||
/// <param name="plugin">The plugin that will provide user data</param>
|
||||
public void AddPlugin(IUserDataPlugin plugin)
|
||||
{
|
||||
_plugins.Add(plugin);
|
||||
m_plugins.Add(plugin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -84,15 +84,15 @@ namespace OpenSim.Framework.Communications
|
||||
/// </param>
|
||||
public void AddPlugin(string provider, string connect)
|
||||
{
|
||||
_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IUserDataPlugin>(provider, connect));
|
||||
m_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IUserDataPlugin>(provider, connect));
|
||||
}
|
||||
|
||||
#region Get UserProfile
|
||||
|
||||
// see IUserService
|
||||
public UserProfileData GetUserProfile(string fname, string lname)
|
||||
public virtual UserProfileData GetUserProfile(string fname, string lname)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
UserProfileData profile = plugin.GetUserByName(fname, lname);
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace OpenSim.Framework.Communications
|
||||
|
||||
public void LogoutUsers(UUID regionID)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
plugin.LogoutUsers(regionID);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace OpenSim.Framework.Communications
|
||||
|
||||
public void ResetAttachments(UUID userID)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
plugin.ResetAttachments(userID);
|
||||
}
|
||||
@@ -124,12 +124,20 @@ namespace OpenSim.Framework.Communications
|
||||
|
||||
public UserProfileData GetUserProfile(Uri uri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
UserProfileData profile = plugin.GetUserByUri(uri);
|
||||
|
||||
if (null != profile)
|
||||
return profile;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public UserAgentData GetAgentByUUID(UUID userId)
|
||||
public virtual UserAgentData GetAgentByUUID(UUID userId)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
UserAgentData agent = plugin.GetAgentByUUID(userId);
|
||||
|
||||
@@ -150,7 +158,7 @@ namespace OpenSim.Framework.Communications
|
||||
// see IUserService
|
||||
public virtual UserProfileData GetUserProfile(UUID uuid)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
UserProfileData profile = plugin.GetUserByUUID(uuid);
|
||||
|
||||
@@ -164,10 +172,10 @@ namespace OpenSim.Framework.Communications
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query)
|
||||
public virtual List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query)
|
||||
{
|
||||
List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>();
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -188,9 +196,9 @@ namespace OpenSim.Framework.Communications
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public bool UpdateUserProfile(UserProfileData data)
|
||||
public virtual bool UpdateUserProfile(UserProfileData data)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -217,7 +225,7 @@ namespace OpenSim.Framework.Communications
|
||||
/// <returns>Agent profiles</returns>
|
||||
public UserAgentData GetUserAgent(UUID uuid)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -244,7 +252,7 @@ namespace OpenSim.Framework.Communications
|
||||
/// <returns>A user agent</returns>
|
||||
public UserAgentData GetUserAgent(string name)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -267,7 +275,7 @@ namespace OpenSim.Framework.Communications
|
||||
/// <returns>A user agent</returns>
|
||||
public UserAgentData GetUserAgent(string fname, string lname)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -287,9 +295,9 @@ namespace OpenSim.Framework.Communications
|
||||
/// </summary>
|
||||
/// <param name="name">the UUID of the friend list owner</param>
|
||||
/// <returns>A List of FriendListItems that contains info about the user's friends</returns>
|
||||
public List<FriendListItem> GetUserFriendList(UUID ownerID)
|
||||
public virtual List<FriendListItem> GetUserFriendList(UUID ownerID)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -309,9 +317,9 @@ namespace OpenSim.Framework.Communications
|
||||
return null;
|
||||
}
|
||||
|
||||
public Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids)
|
||||
public virtual Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -332,7 +340,7 @@ namespace OpenSim.Framework.Communications
|
||||
|
||||
public void StoreWebLoginKey(UUID agentID, UUID webLoginKey)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -345,13 +353,13 @@ namespace OpenSim.Framework.Communications
|
||||
}
|
||||
}
|
||||
|
||||
public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
|
||||
public virtual void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
plugin.AddNewUserFriend(friendlistowner,friend,perms);
|
||||
plugin.AddNewUserFriend(friendlistowner, friend, perms);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -360,9 +368,9 @@ namespace OpenSim.Framework.Communications
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveUserFriend(UUID friendlistowner, UUID friend)
|
||||
public virtual void RemoveUserFriend(UUID friendlistowner, UUID friend)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -375,9 +383,9 @@ namespace OpenSim.Framework.Communications
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms)
|
||||
public virtual void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -394,7 +402,7 @@ namespace OpenSim.Framework.Communications
|
||||
/// Resets the currentAgent in the user profile
|
||||
/// </summary>
|
||||
/// <param name="agentID">The agent's ID</param>
|
||||
public void ClearUserAgent(UUID agentID)
|
||||
public virtual void ClearUserAgent(UUID agentID)
|
||||
{
|
||||
UserProfileData profile = GetUserProfile(agentID);
|
||||
|
||||
@@ -408,7 +416,6 @@ namespace OpenSim.Framework.Communications
|
||||
UpdateUserProfile(profile);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region CreateAgent
|
||||
@@ -544,7 +551,7 @@ namespace OpenSim.Framework.Communications
|
||||
/// <param name="regionhandle"></param>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="lookat"></param>
|
||||
public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat)
|
||||
public virtual void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat)
|
||||
{
|
||||
if (StatsManager.UserStats != null)
|
||||
StatsManager.UserStats.AddLogout();
|
||||
@@ -583,15 +590,6 @@ namespace OpenSim.Framework.Communications
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process a user logoff from OpenSim (deprecated as of 2008-08-27)
|
||||
/// </summary>
|
||||
/// <param name="userid"></param>
|
||||
/// <param name="regionid"></param>
|
||||
/// <param name="regionhandle"></param>
|
||||
/// <param name="posx"></param>
|
||||
/// <param name="posy"></param>
|
||||
/// <param name="posz"></param>
|
||||
public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz)
|
||||
{
|
||||
LogOffUser(userid, regionid, regionhandle, new Vector3(posx, posy, posz), new Vector3());
|
||||
@@ -643,7 +641,7 @@ namespace OpenSim.Framework.Communications
|
||||
user.HomeRegionY = regY;
|
||||
user.Email = email;
|
||||
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -669,13 +667,13 @@ namespace OpenSim.Framework.Communications
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset a user password
|
||||
/// Reset a user password.
|
||||
/// </summary>
|
||||
/// <param name="firstName"></param>
|
||||
/// <param name="lastName"></param>
|
||||
/// <param name="newPassword"></param>
|
||||
/// <returns>true if the update was successful, false otherwise</returns>
|
||||
public bool ResetUserPassword(string firstName, string lastName, string newPassword)
|
||||
public virtual bool ResetUserPassword(string firstName, string lastName, string newPassword)
|
||||
{
|
||||
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(newPassword) + ":" + String.Empty);
|
||||
|
||||
@@ -705,7 +703,7 @@ namespace OpenSim.Framework.Communications
|
||||
/// <param name="agentdata">The agent data to be added</param>
|
||||
public bool AddUserAgent(UserAgentData agentdata)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -725,9 +723,9 @@ namespace OpenSim.Framework.Communications
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <returns></returns>
|
||||
public AvatarAppearance GetUserAppearance(UUID user)
|
||||
public virtual AvatarAppearance GetUserAppearance(UUID user)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -741,14 +739,9 @@ namespace OpenSim.Framework.Communications
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update avatar appearance information
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="appearance"></param>
|
||||
public void UpdateUserAppearance(UUID user, AvatarAppearance appearance)
|
||||
public virtual void UpdateUserAppearance(UUID user, AvatarAppearance appearance)
|
||||
{
|
||||
foreach (IUserDataPlugin plugin in _plugins)
|
||||
foreach (IUserDataPlugin plugin in m_plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -838,8 +831,8 @@ namespace OpenSim.Framework.Communications
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool VerifySession(UUID userID, UUID sessionID)
|
||||
|
||||
public virtual bool VerifySession(UUID userID, UUID sessionID)
|
||||
{
|
||||
UserProfileData userProfile = GetUserProfile(userID);
|
||||
|
||||
@@ -851,6 +844,7 @@ namespace OpenSim.Framework.Communications
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user