* Introduced common abstract UserDataBase provider

* Weeded out multiple AvatarPickerAvatar classes
This commit is contained in:
lbsa71
2008-03-28 19:58:45 +00:00
parent 0a47a75b88
commit ca718b6f8d
8 changed files with 166 additions and 182 deletions

View File

@@ -37,7 +37,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// <summary>
/// A database interface class to a user profile storage system
/// </summary>
public class MSSQLUserData : IUserData
public class MSSQLUserData : UserDataBase
{
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -53,7 +53,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// <summary>
/// Loads and initialises the MySQL storage plugin
/// </summary>
public void Initialise()
override public void Initialise()
{
// Load from an INI file connection details
// TODO: move this to XML?
@@ -131,7 +131,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// <param name="user">The first part of the account name</param>
/// <param name="last">The second part of the account name</param>
/// <returns>A user profile</returns>
public UserProfileData GetUserByName(string user, string last)
override public UserProfileData GetUserByName(string user, string last)
{
try
{
@@ -163,7 +163,7 @@ namespace OpenSim.Framework.Data.MSSQL
#region User Friends List Data
public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
override public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
{
int dtvalue = Util.UnixTimeSinceEpoch();
@@ -206,7 +206,7 @@ namespace OpenSim.Framework.Data.MSSQL
}
}
public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
override public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["@ownerID"] = friendlistowner.UUID.ToString();
@@ -239,7 +239,7 @@ namespace OpenSim.Framework.Data.MSSQL
}
}
public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
override public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["@ownerID"] = friendlistowner.UUID.ToString();
@@ -270,7 +270,7 @@ namespace OpenSim.Framework.Data.MSSQL
}
public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
override public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
{
List<FriendListItem> Lfli = new List<FriendListItem>();
@@ -318,14 +318,14 @@ namespace OpenSim.Framework.Data.MSSQL
#endregion
public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
{
m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
}
public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
override public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
{
List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>();
string[] querysplit;
@@ -405,7 +405,7 @@ namespace OpenSim.Framework.Data.MSSQL
}
// See IUserData
public UserProfileData GetUserByUUID(LLUUID uuid)
override public UserProfileData GetUserByUUID(LLUUID uuid)
{
try
{
@@ -438,7 +438,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// </summary>
/// <param name="name">The account name</param>
/// <returns>The users session</returns>
public UserAgentData GetAgentByName(string name)
override public UserAgentData GetAgentByName(string name)
{
return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
}
@@ -449,7 +449,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// <param name="user">First part of the users account name</param>
/// <param name="last">Second part of the users account name</param>
/// <returns>The users session</returns>
public UserAgentData GetAgentByName(string user, string last)
override public UserAgentData GetAgentByName(string user, string last)
{
UserProfileData profile = GetUserByName(user, last);
return GetAgentByUUID(profile.UUID);
@@ -460,7 +460,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// </summary>
/// <param name="uuid">The accounts UUID</param>
/// <returns>The users session</returns>
public UserAgentData GetAgentByUUID(LLUUID uuid)
override public UserAgentData GetAgentByUUID(LLUUID uuid)
{
try
{
@@ -487,7 +487,7 @@ namespace OpenSim.Framework.Data.MSSQL
return null;
}
}
public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
{
UserProfileData user = GetUserByUUID(AgentID);
user.webLoginKey = WebLoginKey;
@@ -498,7 +498,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// Creates a new users profile
/// </summary>
/// <param name="user">The user profile to create</param>
public void AddNewUserProfile(UserProfileData user)
override public void AddNewUserProfile(UserProfileData user)
{
try
{
@@ -618,13 +618,13 @@ namespace OpenSim.Framework.Data.MSSQL
/// Creates a new agent
/// </summary>
/// <param name="agent">The agent to create</param>
public void AddNewUserAgent(UserAgentData agent)
override public void AddNewUserAgent(UserAgentData agent)
{
// Do nothing.
}
public bool UpdateUserProfile(UserProfileData user)
override public bool UpdateUserProfile(UserProfileData user)
{
SqlCommand command = new SqlCommand("UPDATE " + m_usersTableName + " set UUID = @uuid, " +
"username = @username, " +
@@ -724,7 +724,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// <param name="to">The receivers account ID</param>
/// <param name="amount">The amount to transfer</param>
/// <returns>Success?</returns>
public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount)
override public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount)
{
return false;
}
@@ -737,7 +737,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// <param name="to">The receivers account ID</param>
/// <param name="item">The item to transfer</param>
/// <returns>Success?</returns>
public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
override public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
{
return false;
}
@@ -746,7 +746,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// Database provider name
/// </summary>
/// <returns>Provider name</returns>
public string getName()
override public string getName()
{
return "MSSQL Userdata Interface";
}
@@ -755,7 +755,7 @@ namespace OpenSim.Framework.Data.MSSQL
/// Database provider version
/// </summary>
/// <returns>provider version</returns>
public string GetVersion()
override public string GetVersion()
{
return database.getVersion();
}