diff options
author | lbsa71 | 2007-09-24 02:41:13 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-24 02:41:13 +0000 |
commit | 5818958a9a6c5a10743928973172d255632af6de (patch) | |
tree | 16076d3c3dd65f303ba74ddbbdaa1ca3e3b6e67c /OpenSim/Framework/UserManager | |
parent | long-lost fixes to physics -- proper physical avatar management on crossings, TP (diff) | |
download | opensim-SC_OLD-5818958a9a6c5a10743928973172d255632af6de.zip opensim-SC_OLD-5818958a9a6c5a10743928973172d255632af6de.tar.gz opensim-SC_OLD-5818958a9a6c5a10743928973172d255632af6de.tar.bz2 opensim-SC_OLD-5818958a9a6c5a10743928973172d255632af6de.tar.xz |
*** CHANGED CONFIG BEHAVIOUR ***
* Changed really strange LocalSettings behaviour with enforcing hard-coded plugin names if none supplied
* UserServices and InventoryPlugin will only load if supplied with filename
Diffstat (limited to 'OpenSim/Framework/UserManager')
-rw-r--r-- | OpenSim/Framework/UserManager/UserManagerBase.cs | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index e11204b..4a2870b 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | |||
28 | using System; | 29 | using System; |
29 | using System.Collections; | 30 | using System.Collections; |
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
@@ -32,15 +33,11 @@ using System.Reflection; | |||
32 | using System.Security.Cryptography; | 33 | using System.Security.Cryptography; |
33 | using libsecondlife; | 34 | using libsecondlife; |
34 | using Nwc.XmlRpc; | 35 | using Nwc.XmlRpc; |
36 | using OpenSim.Framework.Configuration; | ||
35 | using OpenSim.Framework.Console; | 37 | using OpenSim.Framework.Console; |
36 | using OpenSim.Framework.Data; | 38 | using OpenSim.Framework.Data; |
37 | using OpenSim.Framework.Interfaces; | ||
38 | using OpenSim.Framework.Inventory; | ||
39 | using OpenSim.Framework.Utilities; | 39 | using OpenSim.Framework.Utilities; |
40 | 40 | ||
41 | using OpenSim.Framework.Configuration; | ||
42 | using InventoryFolder = OpenSim.Framework.Inventory.InventoryFolder; | ||
43 | |||
44 | namespace OpenSim.Framework.UserManagement | 41 | namespace OpenSim.Framework.UserManagement |
45 | { | 42 | { |
46 | public abstract class UserManagerBase | 43 | public abstract class UserManagerBase |
@@ -54,32 +51,32 @@ namespace OpenSim.Framework.UserManagement | |||
54 | /// <param name="FileName">The filename to the user server plugin DLL</param> | 51 | /// <param name="FileName">The filename to the user server plugin DLL</param> |
55 | public void AddPlugin(string FileName) | 52 | public void AddPlugin(string FileName) |
56 | { | 53 | { |
57 | MainLog.Instance.Verbose( "Userstorage: Attempting to load " + FileName); | 54 | if (!String.IsNullOrEmpty(FileName)) |
58 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | ||
59 | |||
60 | MainLog.Instance.Verbose( "Userstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); | ||
61 | foreach (Type pluginType in pluginAssembly.GetTypes()) | ||
62 | { | 55 | { |
63 | if (!pluginType.IsAbstract) | 56 | MainLog.Instance.Verbose("Userstorage: Attempting to load " + FileName); |
64 | { | 57 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
65 | Type typeInterface = pluginType.GetInterface("IUserData", true); | ||
66 | 58 | ||
67 | if (typeInterface != null) | 59 | MainLog.Instance.Verbose("Userstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); |
60 | foreach (Type pluginType in pluginAssembly.GetTypes()) | ||
61 | { | ||
62 | if (!pluginType.IsAbstract) | ||
68 | { | 63 | { |
69 | IUserData plug = (IUserData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 64 | Type typeInterface = pluginType.GetInterface("IUserData", true); |
70 | plug.Initialise(); | 65 | |
71 | AddPlugin(plug); | 66 | if (typeInterface != null) |
67 | { | ||
68 | IUserData plug = | ||
69 | (IUserData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
70 | AddPlugin(plug); | ||
71 | } | ||
72 | } | 72 | } |
73 | |||
74 | typeInterface = null; | ||
75 | } | 73 | } |
76 | } | 74 | } |
77 | |||
78 | pluginAssembly = null; | ||
79 | } | 75 | } |
80 | 76 | ||
81 | private void AddPlugin(IUserData plug) | 77 | public void AddPlugin(IUserData plug) |
82 | { | 78 | { |
79 | plug.Initialise(); | ||
83 | this._plugins.Add(plug.getName(), plug); | 80 | this._plugins.Add(plug.getName(), plug); |
84 | MainLog.Instance.Verbose( "Userstorage: Added IUserData Interface"); | 81 | MainLog.Instance.Verbose( "Userstorage: Added IUserData Interface"); |
85 | } | 82 | } |