diff options
author | Justin Clarke Casey | 2008-10-17 16:44:05 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-17 16:44:05 +0000 |
commit | 138bcf6fffdb16e3962c03f995aff7cda15a7800 (patch) | |
tree | 0e229194378b71199b999fc126b3775b53f500ff | |
parent | * Adds a lot of stability and performance to the physics engine. The avata... (diff) | |
download | opensim-SC_OLD-138bcf6fffdb16e3962c03f995aff7cda15a7800.zip opensim-SC_OLD-138bcf6fffdb16e3962c03f995aff7cda15a7800.tar.gz opensim-SC_OLD-138bcf6fffdb16e3962c03f995aff7cda15a7800.tar.bz2 opensim-SC_OLD-138bcf6fffdb16e3962c03f995aff7cda15a7800.tar.xz |
* Apply a modified version of http://opensimulator.org/mantis/view.php?id=2290
* This allows multiple user profile providers to be specified in OpenSim.ini separated by commas
* If multiple providers are specified then a request for a user profile will query each in turn until the profile is either found or all have been queried
* Unfortunately I don't believe this order can currently be specified, which if true is something that will need to be fixed.
* Thanks to smeans for the original patch.
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 20 | ||||
-rw-r--r-- | OpenSim/Framework/PluginLoader.cs | 37 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs | 1 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 9 |
5 files changed, 56 insertions, 14 deletions
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index aa68367..32bfed7 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -56,11 +56,11 @@ namespace OpenSim.Framework.Communications | |||
56 | public void AddPlugin(string provider, string connect) | 56 | public void AddPlugin(string provider, string connect) |
57 | { | 57 | { |
58 | PluginLoader<IUserDataPlugin> loader = | 58 | PluginLoader<IUserDataPlugin> loader = |
59 | new PluginLoader<IUserDataPlugin> (new UserDataInitialiser (connect)); | 59 | new PluginLoader<IUserDataPlugin>(new UserDataInitialiser(connect)); |
60 | 60 | ||
61 | // loader will try to load all providers (MySQL, MSSQL, etc) | 61 | // loader will try to load all providers (MySQL, MSSQL, etc) |
62 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | 62 | // unless it is constrainted to the correct "Provider" entry in the addin.xml |
63 | loader.Add ("/OpenSim/UserData", new PluginProviderFilter (provider)); | 63 | loader.Add("/OpenSim/UserData", new PluginProviderFilter(provider)); |
64 | loader.Load(); | 64 | loader.Load(); |
65 | 65 | ||
66 | _plugins = loader.Plugins; | 66 | _plugins = loader.Plugins; |
@@ -178,7 +178,12 @@ namespace OpenSim.Framework.Communications | |||
178 | { | 178 | { |
179 | try | 179 | try |
180 | { | 180 | { |
181 | return plugin.GetAgentByUUID(uuid); | 181 | UserAgentData result = plugin.GetAgentByUUID(uuid); |
182 | |||
183 | if (result != null) | ||
184 | { | ||
185 | return result; | ||
186 | } | ||
182 | } | 187 | } |
183 | catch (Exception e) | 188 | catch (Exception e) |
184 | { | 189 | { |
@@ -260,7 +265,12 @@ namespace OpenSim.Framework.Communications | |||
260 | { | 265 | { |
261 | try | 266 | try |
262 | { | 267 | { |
263 | return plugin.GetUserFriendList(ownerID); | 268 | List<FriendListItem> result = plugin.GetUserFriendList(ownerID); |
269 | |||
270 | if (result != null) | ||
271 | { | ||
272 | return result; | ||
273 | } | ||
264 | } | 274 | } |
265 | catch (Exception e) | 275 | catch (Exception e) |
266 | { | 276 | { |
@@ -331,7 +341,6 @@ namespace OpenSim.Framework.Communications | |||
331 | } | 341 | } |
332 | } | 342 | } |
333 | 343 | ||
334 | |||
335 | /// <summary> | 344 | /// <summary> |
336 | /// Resets the currentAgent in the user profile | 345 | /// Resets the currentAgent in the user profile |
337 | /// </summary> | 346 | /// </summary> |
@@ -344,6 +353,7 @@ namespace OpenSim.Framework.Communications | |||
344 | { | 353 | { |
345 | return; | 354 | return; |
346 | } | 355 | } |
356 | |||
347 | profile.CurrentAgent = null; | 357 | profile.CurrentAgent = null; |
348 | 358 | ||
349 | UpdateUserProfile(profile); | 359 | UpdateUserProfile(profile); |
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index ab4e217..a39f787 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs | |||
@@ -342,20 +342,45 @@ namespace OpenSim.Framework | |||
342 | } | 342 | } |
343 | 343 | ||
344 | /// <summary> | 344 | /// <summary> |
345 | /// Filters out which plugin to load based on its "Provider", which is name given by in the addin.xml | 345 | /// Filters out which plugin to load based on its the plugin name or names given. Plugin names are contained in |
346 | /// their addin.xml | ||
346 | /// </summary> | 347 | /// </summary> |
347 | public class PluginProviderFilter : IPluginFilter | 348 | public class PluginProviderFilter : IPluginFilter |
348 | { | 349 | { |
349 | private string provider; | 350 | private string[] m_filters; |
350 | 351 | ||
351 | public PluginProviderFilter (string p) | 352 | /// <summary> |
353 | /// Constructor. | ||
354 | /// </summary> | ||
355 | /// <param name="p"> | ||
356 | /// Plugin name or names on which to filter. Multiple names should be separated by commas. | ||
357 | /// </param> | ||
358 | public PluginProviderFilter(string p) | ||
352 | { | 359 | { |
353 | provider = p; | 360 | m_filters = p.Split(','); |
361 | |||
362 | for (int i = 0; i < m_filters.Length; i++) | ||
363 | { | ||
364 | m_filters[i] = m_filters[i].Trim(); | ||
365 | } | ||
354 | } | 366 | } |
355 | 367 | ||
368 | /// <summary> | ||
369 | /// Apply this filter to the given plugin. | ||
370 | /// </summary> | ||
371 | /// <param name="plugin"></param> | ||
372 | /// <returns>true if the plugin's name matched one of the filters, false otherwise.</returns> | ||
356 | public bool Apply (PluginExtensionNode plugin) | 373 | public bool Apply (PluginExtensionNode plugin) |
357 | { | 374 | { |
358 | return (plugin.Provider == provider); | 375 | for (int i = 0; i < m_filters.Length; i++) |
376 | { | ||
377 | if (m_filters[i] == plugin.Provider) | ||
378 | { | ||
379 | return true; | ||
380 | } | ||
381 | } | ||
382 | |||
383 | return false; | ||
359 | } | 384 | } |
360 | } | 385 | } |
361 | } | 386 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 20452e0..1f1f88b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
60 | /// <value> | 60 | /// <value> |
61 | /// The endpoint of a sender of a particular packet. The port is changed by the various socket receive methods | 61 | /// The endpoint of a sender of a particular packet. The port is changed by the various socket receive methods |
62 | /// </value> | 62 | /// </value> |
63 | protected EndPoint epSender; | 63 | protected EndPoint epSender = new IPEndPoint(IPAddress.Any, 0); |
64 | 64 | ||
65 | protected EndPoint epProxy; | 65 | protected EndPoint epProxy; |
66 | protected int proxyPortOffset; | 66 | protected int proxyPortOffset; |
@@ -175,7 +175,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
175 | /// <param name="result"></param> | 175 | /// <param name="result"></param> |
176 | protected virtual void OnReceivedData(IAsyncResult result) | 176 | protected virtual void OnReceivedData(IAsyncResult result) |
177 | { | 177 | { |
178 | epSender = new IPEndPoint(listenIP, 0); | ||
179 | Packet packet = null; | 178 | Packet packet = null; |
180 | 179 | ||
181 | int numBytes = 1; | 180 | int numBytes = 1; |
diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs index ab86d10..cec2ec1 100644 --- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -34,7 +34,6 @@ using OpenMetaverse; | |||
34 | using log4net; | 34 | using log4net; |
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | using OpenSim.Data.Base; | 36 | using OpenSim.Data.Base; |
37 | using OpenSim.Data.MapperFactory; | ||
38 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications.Cache; | 38 | using OpenSim.Framework.Communications.Cache; |
40 | using OpenSim.Region.Environment.Interfaces; | 39 | using OpenSim.Region.Environment.Interfaces; |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index c9d97a5..5457af2 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -144,6 +144,7 @@ asset_plugin = "OpenSim.Data.SQLite.dll" | |||
144 | inventory_plugin = "OpenSim.Data.SQLite.dll" | 144 | inventory_plugin = "OpenSim.Data.SQLite.dll" |
145 | ; inventory_plugin = "OpenSim.Data.MySQL.dll" | 145 | ; inventory_plugin = "OpenSim.Data.MySQL.dll" |
146 | ; inventory_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate | 146 | ; inventory_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate |
147 | |||
147 | ; Inventory Source NHibernate example (DIALECT;DRIVER;CONNECTSTRING) | 148 | ; Inventory Source NHibernate example (DIALECT;DRIVER;CONNECTSTRING) |
148 | ; inventory_source = "SQLiteDialect;SqliteClientDriver;URI=file:Inventory.db,version=3" | 149 | ; inventory_source = "SQLiteDialect;SqliteClientDriver;URI=file:Inventory.db,version=3" |
149 | ; Inventory Source MySQL example | 150 | ; Inventory Source MySQL example |
@@ -151,9 +152,17 @@ inventory_plugin = "OpenSim.Data.SQLite.dll" | |||
151 | 152 | ||
152 | 153 | ||
153 | ; User Data Database provider | 154 | ; User Data Database provider |
155 | ; | ||
156 | ; Multiple providers can be specified by separating them with commas (whitespace is unimportant) | ||
157 | ; If multiple providers are specified then if a profile is requested, each is queried until one | ||
158 | ; provides a valid profile, or until all providers have been queried. | ||
159 | ; Unfortunately the order of querying is currently undefined (it may not be the order in which | ||
160 | ; providers are specified here). This needs to be fixed | ||
161 | ; | ||
154 | userDatabase_plugin = "OpenSim.Data.SQLite.dll" | 162 | userDatabase_plugin = "OpenSim.Data.SQLite.dll" |
155 | ; userDatabase_plugin = "OpenSim.Data.MySQL.dll" | 163 | ; userDatabase_plugin = "OpenSim.Data.MySQL.dll" |
156 | ; userDatabase_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate | 164 | ; userDatabase_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate |
165 | |||
157 | ; User Source NHibernate Example (DIALECT;DRIVER;CONNECTSTRING) | 166 | ; User Source NHibernate Example (DIALECT;DRIVER;CONNECTSTRING) |
158 | ; user_source = "SQLiteDialect;SqliteClientDriver;URI=file:User.db,version=3" | 167 | ; user_source = "SQLiteDialect;SqliteClientDriver;URI=file:User.db,version=3" |
159 | ; User Source MySQL example | 168 | ; User Source MySQL example |