aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorlbsa712007-09-24 02:41:13 +0000
committerlbsa712007-09-24 02:41:13 +0000
commit5818958a9a6c5a10743928973172d255632af6de (patch)
tree16076d3c3dd65f303ba74ddbbdaa1ca3e3b6e67c
parentlong-lost fixes to physics -- proper physical avatar management on crossings, TP (diff)
downloadopensim-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
-rw-r--r--OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs32
-rw-r--r--OpenSim/Framework/UserManager/UserManagerBase.cs41
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs4
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs26
4 files changed, 47 insertions, 56 deletions
diff --git a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
index dc66bd4..d76fac5 100644
--- a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
+++ b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
@@ -23,28 +23,28 @@ namespace OpenSim.Framework.InventoryServiceBase
23 /// <param name="FileName">The filename to the user server plugin DLL</param> 23 /// <param name="FileName">The filename to the user server plugin DLL</param>
24 public void AddPlugin(string FileName) 24 public void AddPlugin(string FileName)
25 { 25 {
26 MainLog.Instance.Verbose("Inventory", "Inventorystorage: Attempting to load " + FileName); 26 if (!String.IsNullOrEmpty(FileName))
27 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
28
29 foreach (Type pluginType in pluginAssembly.GetTypes())
30 { 27 {
31 if (!pluginType.IsAbstract) 28 MainLog.Instance.Verbose("Inventory", "Inventorystorage: Attempting to load " + FileName);
32 { 29 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
33 Type typeInterface = pluginType.GetInterface("IInventoryData", true);
34 30
35 if (typeInterface != null) 31 foreach (Type pluginType in pluginAssembly.GetTypes())
32 {
33 if (!pluginType.IsAbstract)
36 { 34 {
37 IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 35 Type typeInterface = pluginType.GetInterface("IInventoryData", true);
38 plug.Initialise(); 36
39 this.m_plugins.Add(plug.getName(), plug); 37 if (typeInterface != null)
40 MainLog.Instance.Verbose("Inventorystorage: Added IInventoryData Interface"); 38 {
39 IInventoryData plug =
40 (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
41 plug.Initialise();
42 this.m_plugins.Add(plug.getName(), plug);
43 MainLog.Instance.Verbose("Inventorystorage: Added IInventoryData Interface");
44 }
41 } 45 }
42
43 typeInterface = null;
44 } 46 }
45 } 47 }
46
47 pluginAssembly = null;
48 } 48 }
49 49
50 /// <summary> 50 /// <summary>
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
28using System; 29using System;
29using System.Collections; 30using System.Collections;
30using System.Collections.Generic; 31using System.Collections.Generic;
@@ -32,15 +33,11 @@ using System.Reflection;
32using System.Security.Cryptography; 33using System.Security.Cryptography;
33using libsecondlife; 34using libsecondlife;
34using Nwc.XmlRpc; 35using Nwc.XmlRpc;
36using OpenSim.Framework.Configuration;
35using OpenSim.Framework.Console; 37using OpenSim.Framework.Console;
36using OpenSim.Framework.Data; 38using OpenSim.Framework.Data;
37using OpenSim.Framework.Interfaces;
38using OpenSim.Framework.Inventory;
39using OpenSim.Framework.Utilities; 39using OpenSim.Framework.Utilities;
40 40
41using OpenSim.Framework.Configuration;
42using InventoryFolder = OpenSim.Framework.Inventory.InventoryFolder;
43
44namespace OpenSim.Framework.UserManagement 41namespace 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 }
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 161e73f..c28025b 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -79,8 +79,8 @@ namespace OpenSim
79 79
80 private bool standaloneAuthenticate = false; 80 private bool standaloneAuthenticate = false;
81 private string standaloneWelcomeMessage = null; 81 private string standaloneWelcomeMessage = null;
82 private string standaloneInventoryPlugin = ""; 82 private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
83 private string standaloneUserPlugin = ""; 83 private string standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll";
84 84
85 private string m_assetStorage = "db4o"; 85 private string m_assetStorage = "db4o";
86 86
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index 1f54310..3031b8a 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -44,13 +44,13 @@ namespace OpenSim.Region.Communications.Local
44 public LocalUserServices UserServices; 44 public LocalUserServices UserServices;
45 public LocalLoginService LoginServices; 45 public LocalLoginService LoginServices;
46 public LocalInventoryService InvenServices; 46 public LocalInventoryService InvenServices;
47 47
48 protected LocalSettings m_settings; 48 protected LocalSettings m_settings;
49 49
50 protected CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) 50 protected CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache)
51 : base(serversInfo, httpServer, assetCache) 51 : base(serversInfo, httpServer, assetCache)
52 { 52 {
53 53
54 } 54 }
55 55
56 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings) 56 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings)
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Communications.Local
94 94
95 if (cmmdParams.Length < 2) 95 if (cmmdParams.Length < 2)
96 { 96 {
97 97
98 firstName = MainLog.Instance.CmdPrompt("First name", "Default"); 98 firstName = MainLog.Instance.CmdPrompt("First name", "Default");
99 lastName = MainLog.Instance.CmdPrompt("Last name", "User"); 99 lastName = MainLog.Instance.CmdPrompt("Last name", "User");
100 password = MainLog.Instance.PasswdPrompt("Password"); 100 password = MainLog.Instance.PasswdPrompt("Password");
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Communications.Local
126 { 126 {
127 return LLUUID.Zero; 127 return LLUUID.Zero;
128 } 128 }
129 else 129 else
130 { 130 {
131 this.InvenServices.CreateNewUserInventory(userProf.UUID); 131 this.InvenServices.CreateNewUserInventory(userProf.UUID);
132 Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); 132 Console.WriteLine("Created new inventory set for " + firstName + " " + lastName);
@@ -136,23 +136,17 @@ namespace OpenSim.Region.Communications.Local
136 136
137 public class LocalSettings 137 public class LocalSettings
138 { 138 {
139 public string WelcomeMessage = ""; 139 public string WelcomeMessage;
140 public bool AccountAuthentication = false; 140 public bool AccountAuthentication = false;
141 public string InventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; 141 public string InventoryPlugin;
142 public string UserDatabasePlugin = "OpenSim.Framework.Data.DB4o.dll"; 142 public string UserDatabasePlugin;
143 143
144 public LocalSettings(string welcomeMessage, bool accountsAuthenticate, string inventoryPlugin, string userPlugin) 144 public LocalSettings(string welcomeMessage, bool accountsAuthenticate, string inventoryPlugin, string userPlugin)
145 { 145 {
146 WelcomeMessage = welcomeMessage; 146 WelcomeMessage = welcomeMessage;
147 AccountAuthentication = accountsAuthenticate; 147 AccountAuthentication = accountsAuthenticate;
148 if (inventoryPlugin != "") 148 InventoryPlugin = inventoryPlugin;
149 { 149 UserDatabasePlugin = userPlugin;
150 InventoryPlugin = inventoryPlugin;
151 }
152 if (userPlugin != "")
153 {
154 UserDatabasePlugin = userPlugin;
155 }
156 } 150 }
157 } 151 }
158 152