aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-27 19:28:04 +0000
committerJustin Clarke Casey2008-11-27 19:28:04 +0000
commit7c6c776ff783b30dfc26a065e63c267e46edc53b (patch)
tree3bd8b995d16d038e01de2d2167faee38488b0e1c /OpenSim/Framework/Communications
parent* minor: remove the ability to change the client in ScenePresence to reduce t... (diff)
downloadopensim-SC-7c6c776ff783b30dfc26a065e63c267e46edc53b.zip
opensim-SC-7c6c776ff783b30dfc26a065e63c267e46edc53b.tar.gz
opensim-SC-7c6c776ff783b30dfc26a065e63c267e46edc53b.tar.bz2
opensim-SC-7c6c776ff783b30dfc26a065e63c267e46edc53b.tar.xz
* test: Add the ability to add a plugin directory to the user and inventory services in order to extend unit tests for user and inventory information
* I can't spend any longer in trying to get Mono.Addins to work with the unit tests, so this is not a proper plugin at this time
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs1
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs19
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs32
3 files changed, 40 insertions, 12 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 3f46776..bcf9bed 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -110,7 +110,6 @@ namespace OpenSim.Framework.Communications
110 /// </summary> 110 /// </summary>
111 protected IUserServiceAdmin m_userServiceAdmin; 111 protected IUserServiceAdmin m_userServiceAdmin;
112 112
113
114 public BaseHttpServer HttpServer 113 public BaseHttpServer HttpServer
115 { 114 {
116 get { return m_httpServer; } 115 get { return m_httpServer; }
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 5841151..777e15b 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -48,20 +48,29 @@ namespace OpenSim.Framework.Communications
48 #region Plugin methods 48 #region Plugin methods
49 49
50 /// <summary> 50 /// <summary>
51 /// Adds a new user server plugin - plugins will be requested in the order they were loaded. 51 /// Add a new inventory data plugin - plugins will be requested in the order they were added.
52 /// </summary> 52 /// </summary>
53 /// <param name="provider">The filename to the user server plugin DLL</param> 53 /// <param name="plugin">The plugin that will provide data</param>
54 public void AddPlugin(IInventoryDataPlugin plugin)
55 {
56 m_plugins.Add(plugin);
57 }
58
59 /// <summary>
60 /// Adds a new inventory data plugin - plugins will be requested in the order they were loaded.
61 /// </summary>
62 /// <param name="provider">The filename of the inventory server plugin DLL</param>
54 public void AddPlugin(string provider, string connect) 63 public void AddPlugin(string provider, string connect)
55 { 64 {
56 PluginLoader<IInventoryDataPlugin> loader = 65 PluginLoader<IInventoryDataPlugin> loader =
57 new PluginLoader<IInventoryDataPlugin> (new InventoryDataInitialiser (connect)); 66 new PluginLoader<IInventoryDataPlugin> (new InventoryDataInitialiser(connect));
58 67
59 // loader will try to load all providers (MySQL, MSSQL, etc) 68 // loader will try to load all providers (MySQL, MSSQL, etc)
60 // unless it is constrainted to the correct "Provider" entry in the addin.xml 69 // unless it is constrainted to the correct "Provider" entry in the addin.xml
61 loader.Add ("/OpenSim/InventoryData", new PluginProviderFilter (provider)); 70 loader.Add ("/OpenSim/InventoryData", new PluginProviderFilter(provider));
62 loader.Load(); 71 loader.Load();
63 72
64 m_plugins = loader.Plugins; 73 m_plugins.AddRange(loader.Plugins);
65 } 74 }
66 75
67 #endregion 76 #endregion
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 2a66260..a929317 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -48,12 +48,24 @@ namespace OpenSim.Framework.Communications
48 private static readonly ILog m_log 48 private static readonly ILog m_log
49 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 /// <value>
52 /// List of plugins to search for user data
53 /// </value>
51 private List<IUserDataPlugin> _plugins = new List<IUserDataPlugin>(); 54 private List<IUserDataPlugin> _plugins = new List<IUserDataPlugin>();
55
56 /// <summary>
57 /// Add a new user data plugin - plugins will be requested in the order they were added.
58 /// </summary>
59 /// <param name="plugin">The plugin that will provide user data</param>
60 public void AddPlugin(IUserDataPlugin plugin)
61 {
62 _plugins.Add(plugin);
63 }
52 64
53 /// <summary> 65 /// <summary>
54 /// Adds a new user server plugin - user servers will be requested in the order they were loaded. 66 /// Add a new user data plugin - plugins will be requested in the order they were added.
55 /// </summary> 67 /// </summary>
56 /// <param name="provider">The filename to the user server plugin DLL</param> 68 /// <param name="provider">The filename to the user data plugin DLL</param>
57 /// <param name="connect"></param> 69 /// <param name="connect"></param>
58 public void AddPlugin(string provider, string connect) 70 public void AddPlugin(string provider, string connect)
59 { 71 {
@@ -65,7 +77,7 @@ namespace OpenSim.Framework.Communications
65 loader.Add("/OpenSim/UserData", new PluginProviderFilter(provider)); 77 loader.Add("/OpenSim/UserData", new PluginProviderFilter(provider));
66 loader.Load(); 78 loader.Load();
67 79
68 _plugins = loader.Plugins; 80 _plugins.AddRange(loader.Plugins);
69 } 81 }
70 82
71 #region Get UserProfile 83 #region Get UserProfile
@@ -637,7 +649,7 @@ namespace OpenSim.Framework.Communications
637 } 649 }
638 catch (Exception e) 650 catch (Exception e)
639 { 651 {
640 m_log.Info("[USERSTORAGE]: Unable to add user via " + plugin.Name + "(" + e.ToString() + ")"); 652 m_log.Error("[USERSTORAGE]: Unable to add user via " + plugin.Name + "(" + e.ToString() + ")");
641 } 653 }
642 } 654 }
643 655
@@ -696,8 +708,11 @@ namespace OpenSim.Framework.Communications
696 return false; 708 return false;
697 } 709 }
698 710
699 /// Appearance 711 /// <summary>
700 /// TODO: stubs for now to get us to a compiling state gently 712 /// Get avatar appearance information
713 /// </summary>
714 /// <param name="user"></param>
715 /// <returns></returns>
701 public AvatarAppearance GetUserAppearance(UUID user) 716 public AvatarAppearance GetUserAppearance(UUID user)
702 { 717 {
703 foreach (IUserDataPlugin plugin in _plugins) 718 foreach (IUserDataPlugin plugin in _plugins)
@@ -714,6 +729,11 @@ namespace OpenSim.Framework.Communications
714 return null; 729 return null;
715 } 730 }
716 731
732 /// <summary>
733 /// Update avatar appearance information
734 /// </summary>
735 /// <param name="user"></param>
736 /// <param name="appearance"></param>
717 public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) 737 public void UpdateUserAppearance(UUID user, AvatarAppearance appearance)
718 { 738 {
719 foreach (IUserDataPlugin plugin in _plugins) 739 foreach (IUserDataPlugin plugin in _plugins)