Apply updated patch from issue 1871. Thanks sempuki.

0.6.0-stable
Mike Mazur 2008-07-31 23:53:24 +00:00
parent 6d15f25026
commit 15669281fa
8 changed files with 35 additions and 34 deletions

View File

@ -416,7 +416,7 @@ namespace OpenSim.Data.MSSQL
} }
/// <summary> /// <summary>
/// See IUserData /// See IUserDataPlugin
/// </summary> /// </summary>
/// <param name="uuid"></param> /// <param name="uuid"></param>
/// <returns></returns> /// <returns></returns>

View File

@ -244,7 +244,7 @@ namespace OpenSim.Data.MySQL
#endregion #endregion
// see IUserData // see IUserDataPlugin
override public UserProfileData GetUserByName(string user, string last) override public UserProfileData GetUserByName(string user, string last)
{ {
try try
@ -508,7 +508,7 @@ namespace OpenSim.Data.MySQL
} }
/// <summary> /// <summary>
/// See IUserData /// See IUserDataPlugin
/// </summary> /// </summary>
/// <param name="uuid">User UUID</param> /// <param name="uuid">User UUID</param>
/// <returns>User profile data</returns> /// <returns>User profile data</returns>

View File

@ -133,7 +133,7 @@ namespace OpenSim.Data.SQLite
public override void Dispose () {} public override void Dispose () {}
/// <summary> /// <summary>
/// see IUserData, /// see IUserDataPlugin,
/// Get user data profile by UUID /// Get user data profile by UUID
/// </summary> /// </summary>
/// <param name="uuid">User UUID</param> /// <param name="uuid">User UUID</param>
@ -161,7 +161,7 @@ namespace OpenSim.Data.SQLite
} }
/// <summary> /// <summary>
/// see IUserData, /// see IUserDataPlugin,
/// Get user data profile by name /// Get user data profile by name
/// </summary> /// </summary>
/// <param name="fname">first name</param> /// <param name="fname">first name</param>

View File

@ -33,7 +33,7 @@ using OpenSim.Framework;
namespace OpenSim.Data namespace OpenSim.Data
{ {
public abstract class UserDataBase : IUserData public abstract class UserDataBase : IUserDataPlugin
{ {
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -47,7 +47,7 @@ namespace OpenSim.Framework.Communications
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public UserConfig _config; public UserConfig _config;
private List<IUserData> _plugins = new List<IUserData>(); private List<IUserDataPlugin> _plugins = new List<IUserDataPlugin>();
/// <summary> /// <summary>
/// Adds a new user server plugin - user servers will be requested in the order they were loaded. /// Adds a new user server plugin - user servers will be requested in the order they were loaded.
@ -55,8 +55,8 @@ namespace OpenSim.Framework.Communications
/// <param name="provider">The filename to the user server plugin DLL</param> /// <param name="provider">The filename to the user server plugin DLL</param>
public void AddPlugin(string provider, string connect) public void AddPlugin(string provider, string connect)
{ {
PluginLoader<IUserData> loader = PluginLoader<IUserDataPlugin> loader =
new PluginLoader<IUserData> (new UserDataInitialiser (connect)); new PluginLoader<IUserDataPlugin> (new UserDataInitialiser (connect));
// 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
@ -71,7 +71,7 @@ namespace OpenSim.Framework.Communications
// see IUserService // see IUserService
public UserProfileData GetUserProfile(string fname, string lname) public UserProfileData GetUserProfile(string fname, string lname)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
UserProfileData profile = plugin.GetUserByName(fname, lname); UserProfileData profile = plugin.GetUserByName(fname, lname);
@ -86,7 +86,7 @@ namespace OpenSim.Framework.Communications
} }
public UserAgentData GetAgentByUUID(LLUUID userId) public UserAgentData GetAgentByUUID(LLUUID userId)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
UserAgentData agent = plugin.GetAgentByUUID(userId); UserAgentData agent = plugin.GetAgentByUUID(userId);
@ -101,7 +101,7 @@ namespace OpenSim.Framework.Communications
// see IUserService // see IUserService
public UserProfileData GetUserProfile(LLUUID uuid) public UserProfileData GetUserProfile(LLUUID uuid)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
UserProfileData profile = plugin.GetUserByUUID(uuid); UserProfileData profile = plugin.GetUserByUUID(uuid);
@ -118,7 +118,7 @@ namespace OpenSim.Framework.Communications
public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query) public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query)
{ {
List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>();
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -140,7 +140,7 @@ namespace OpenSim.Framework.Communications
/// <returns></returns> /// <returns></returns>
public bool UpdateUserProfile(UserProfileData data) public bool UpdateUserProfile(UserProfileData data)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -167,7 +167,7 @@ namespace OpenSim.Framework.Communications
/// <returns>Agent profiles</returns> /// <returns>Agent profiles</returns>
public UserAgentData GetUserAgent(LLUUID uuid) public UserAgentData GetUserAgent(LLUUID uuid)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -189,7 +189,7 @@ namespace OpenSim.Framework.Communications
/// <returns>A user agent</returns> /// <returns>A user agent</returns>
public UserAgentData GetUserAgent(string name) public UserAgentData GetUserAgent(string name)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -212,7 +212,7 @@ namespace OpenSim.Framework.Communications
/// <returns>A user agent</returns> /// <returns>A user agent</returns>
public UserAgentData GetUserAgent(string fname, string lname) public UserAgentData GetUserAgent(string fname, string lname)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -229,7 +229,7 @@ namespace OpenSim.Framework.Communications
public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle) public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -249,7 +249,7 @@ namespace OpenSim.Framework.Communications
/// <returns>A List of FriendListItems that contains info about the user's friends</returns> /// <returns>A List of FriendListItems that contains info about the user's friends</returns>
public List<FriendListItem> GetUserFriendList(LLUUID ownerID) public List<FriendListItem> GetUserFriendList(LLUUID ownerID)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -266,7 +266,7 @@ namespace OpenSim.Framework.Communications
public void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) public void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -281,7 +281,7 @@ namespace OpenSim.Framework.Communications
public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -296,7 +296,7 @@ namespace OpenSim.Framework.Communications
public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -311,7 +311,7 @@ namespace OpenSim.Framework.Communications
public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -545,7 +545,7 @@ namespace OpenSim.Framework.Communications
user.HomeRegionX = regX; user.HomeRegionX = regX;
user.HomeRegionY = regY; user.HomeRegionY = regY;
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -567,7 +567,7 @@ namespace OpenSim.Framework.Communications
m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.ID.ToString()); m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.ID.ToString());
return false; return false;
} }
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -593,7 +593,7 @@ namespace OpenSim.Framework.Communications
/// <param name="agentdata">The agent data to be added</param> /// <param name="agentdata">The agent data to be added</param>
public bool AddUserAgent(UserAgentData agentdata) public bool AddUserAgent(UserAgentData agentdata)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -612,7 +612,7 @@ namespace OpenSim.Framework.Communications
/// TODO: stubs for now to get us to a compiling state gently /// TODO: stubs for now to get us to a compiling state gently
public AvatarAppearance GetUserAppearance(LLUUID user) public AvatarAppearance GetUserAppearance(LLUUID user)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -628,7 +628,7 @@ namespace OpenSim.Framework.Communications
public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -643,7 +643,7 @@ namespace OpenSim.Framework.Communications
public void AddAttachment(LLUUID user, LLUUID item) public void AddAttachment(LLUUID user, LLUUID item)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -658,7 +658,7 @@ namespace OpenSim.Framework.Communications
public void RemoveAttachment(LLUUID user, LLUUID item) public void RemoveAttachment(LLUUID user, LLUUID item)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {
@ -673,7 +673,7 @@ namespace OpenSim.Framework.Communications
public List<LLUUID> GetAttachments(LLUUID user) public List<LLUUID> GetAttachments(LLUUID user)
{ {
foreach (IUserData plugin in _plugins) foreach (IUserDataPlugin plugin in _plugins)
{ {
try try
{ {

View File

@ -33,7 +33,7 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// An interface for connecting to user storage servers. /// An interface for connecting to user storage servers.
/// </summary> /// </summary>
public interface IUserData : IPlugin public interface IUserDataPlugin : IPlugin
{ {
/// <summary> /// <summary>
/// Returns a user profile from a database via their UUID /// Returns a user profile from a database via their UUID
@ -177,7 +177,7 @@ namespace OpenSim.Framework
public UserDataInitialiser (string s) { connect = s; } public UserDataInitialiser (string s) { connect = s; }
public override void Initialise (IPlugin plugin) public override void Initialise (IPlugin plugin)
{ {
IUserData p = plugin as IUserData; IUserDataPlugin p = plugin as IUserDataPlugin;
p.Initialise (connect); p.Initialise (connect);
} }
} }

View File

@ -52,6 +52,7 @@ using OpenSim.Region.Environment.Scenes;
namespace OpenSim.ApplicationPlugins.LoadBalancer namespace OpenSim.ApplicationPlugins.LoadBalancer
{ {
[Extension("/OpenSim/Startup")] [Extension("/OpenSim/Startup")]
[ExtensionNode ("Plugin")]
public class LoadBalancerPlugin : IApplicationPlugin public class LoadBalancerPlugin : IApplicationPlugin
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -20,6 +20,6 @@
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IInventoryDataPlugin"/> <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IInventoryDataPlugin"/>
</ExtensionPoint> </ExtensionPoint>
<ExtensionPoint path = "/OpenSim/UserData"> <ExtensionPoint path = "/OpenSim/UserData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IUserData"/> <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IUserDataPlugin"/>
</ExtensionPoint> </ExtensionPoint>
</Addin> </Addin>