aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-04-22 22:19:43 +0000
committerJustin Clarke Casey2009-04-22 22:19:43 +0000
commit342126b7b9ca386f9160daecb51ecc14487a5f9f (patch)
treea485a50aebead411fa2f38528b4c0b7ba19e91db
parent* Resolve http://opensimulator.org/mantis/view.php?id=3509 by passing up the ... (diff)
downloadopensim-SC_OLD-342126b7b9ca386f9160daecb51ecc14487a5f9f.zip
opensim-SC_OLD-342126b7b9ca386f9160daecb51ecc14487a5f9f.tar.gz
opensim-SC_OLD-342126b7b9ca386f9160daecb51ecc14487a5f9f.tar.bz2
opensim-SC_OLD-342126b7b9ca386f9160daecb51ecc14487a5f9f.tar.xz
* Resolve http://opensimulator.org/mantis/view.php?id=3509 by putting some service initialization into CommsManager
* What is really needed is a plugin and interface request system as being done for region modules
-rw-r--r--OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs36
-rw-r--r--OpenSim/Data/IUserData.cs3
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs6
-rw-r--r--OpenSim/Framework/Communications/IUserService.cs7
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs45
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs16
-rw-r--r--OpenSim/Grid/UserServer/Main.cs11
-rw-r--r--OpenSim/Grid/UserServer/UserServerCommsManager.cs40
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs37
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGUserServices.cs8
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs24
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs6
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs5
-rw-r--r--OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs2
14 files changed, 148 insertions, 98 deletions
diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
index 41ad386..c5aabc6 100644
--- a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
+++ b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
@@ -181,21 +181,14 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
181 inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, 181 inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin,
182 m_openSim.ConfigurationSettings.StandaloneInventorySource); 182 m_openSim.ConfigurationSettings.StandaloneInventorySource);
183 183
184 LocalUserServices userService =
185 new LocalUserServices(
186 m_openSim.NetServersInfo.DefaultHomeLocX, m_openSim.NetServersInfo.DefaultHomeLocY, inventoryService);
187 userService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneUserPlugin,
188 m_openSim.ConfigurationSettings.StandaloneUserSource);
189
190 LocalBackEndServices backendService = new LocalBackEndServices(); 184 LocalBackEndServices backendService = new LocalBackEndServices();
191 185
192 //LocalLoginService loginService = CreateLoginService(libraryRootFolder, inventoryService, userService, backendService); 186 //LocalLoginService loginService = CreateLoginService(libraryRootFolder, inventoryService, userService, backendService);
193 187
194 m_commsManager 188 m_commsManager
195 = new CommunicationsLocal( 189 = new CommunicationsLocal(
196 m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, userService, userService, 190 m_openSim.ConfigurationSettings, m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache,
197 inventoryService, backendService, userService, 191 inventoryService, backendService, libraryRootFolder, m_openSim.ConfigurationSettings.DumpAssetsToFile);
198 libraryRootFolder, m_openSim.ConfigurationSettings.DumpAssetsToFile);
199 192
200 CreateGridInfoService(); 193 CreateGridInfoService();
201 } 194 }
@@ -207,7 +200,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
207 200
208 m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler()); 201 m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler());
209 m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim)); 202 m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim));
210
211 } 203 }
212 204
213 protected virtual void InitialiseHGStandaloneServices(LibraryRootFolder libraryRootFolder) 205 protected virtual void InitialiseHGStandaloneServices(LibraryRootFolder libraryRootFolder)
@@ -215,30 +207,20 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
215 // Standalone mode 207 // Standalone mode
216 208
217 HGInventoryServiceClient inventoryService = new HGInventoryServiceClient(m_openSim.NetServersInfo.InventoryURL, null, false); 209 HGInventoryServiceClient inventoryService = new HGInventoryServiceClient(m_openSim.NetServersInfo.InventoryURL, null, false);
218 inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, m_openSim.ConfigurationSettings.StandaloneInventorySource); 210 inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, m_openSim.ConfigurationSettings.StandaloneInventorySource);
219
220 LocalUserServices localuserService =
221 new LocalUserServices(
222 m_openSim.NetServersInfo.DefaultHomeLocX, m_openSim.NetServersInfo.DefaultHomeLocY,
223 inventoryService);
224 localuserService.AddPlugin(
225 m_openSim.ConfigurationSettings.StandaloneUserPlugin,
226 m_openSim.ConfigurationSettings.StandaloneUserSource);
227
228 HGUserServices userService = new HGUserServices(m_commsManager, localuserService);
229 // This plugin arrangement could eventually be configurable rather than hardcoded here.
230 userService.AddPlugin(new OGS1UserDataPlugin(m_commsManager));
231 211
232 HGGridServicesStandalone gridService 212 HGGridServicesStandalone gridService
233 = new HGGridServicesStandalone( 213 = new HGGridServicesStandalone(
234 m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, m_openSim.SceneManager); 214 m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, m_openSim.SceneManager);
235 215
236 m_commsManager = new HGCommunicationsStandalone(m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache, 216 m_commsManager
237 userService, localuserService, inventoryService, gridService, userService, libraryRootFolder, m_openSim.ConfigurationSettings.DumpAssetsToFile); 217 = new HGCommunicationsStandalone(
218 m_openSim.ConfigurationSettings, m_openSim.NetServersInfo, m_httpServer, m_openSim.AssetCache,
219 inventoryService, gridService,
220 libraryRootFolder, m_openSim.ConfigurationSettings.DumpAssetsToFile);
238 221
239 inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService; 222 inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService;
240 HGServices = gridService; 223 HGServices = gridService;
241 userService.SetCommunicationsManager(m_commsManager);
242 224
243 CreateGridInfoService(); 225 CreateGridInfoService();
244 } 226 }
diff --git a/OpenSim/Data/IUserData.cs b/OpenSim/Data/IUserData.cs
index 573355b..d3631d5 100644
--- a/OpenSim/Data/IUserData.cs
+++ b/OpenSim/Data/IUserData.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Data
64 /// </summary> 64 /// </summary>
65 /// <param name="queryID">ID associated with the user's query. This must match what the client sent</param> 65 /// <param name="queryID">ID associated with the user's query. This must match what the client sent</param>
66 /// <param name="query">The filtered contents of the search box when the user hit search.</param> 66 /// <param name="query">The filtered contents of the search box when the user hit search.</param>
67 /// <returns>A list of user details. If there are no results than either an empty list or null can be returned</returns> 67 /// <returns>A list of user details. If there are no results than either an empty list or null</returns>
68 List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query); 68 List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query);
69 69
70 /// <summary> 70 /// <summary>
@@ -140,6 +140,7 @@ namespace OpenSim.Data
140 /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship for UUID friendslistowner 140 /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship for UUID friendslistowner
141 /// </summary> 141 /// </summary>
142 /// <param name="friendlistowner">The agent that we're retreiving the friends Data.</param> 142 /// <param name="friendlistowner">The agent that we're retreiving the friends Data.</param>
143 /// <returns>The user's friends. If there are no results than either an empty list or null</returns>
143 List<FriendListItem> GetUserFriendList(UUID friendlistowner); 144 List<FriendListItem> GetUserFriendList(UUID friendlistowner);
144 145
145 /// <summary> 146 /// <summary>
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index b4078fd..1df1f48 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -36,6 +36,12 @@ namespace OpenSim.Framework.Communications
36 /// <summary> 36 /// <summary>
37 /// This class manages references to OpenSim non-region services (asset, inventory, user, etc.) 37 /// This class manages references to OpenSim non-region services (asset, inventory, user, etc.)
38 /// </summary> 38 /// </summary>
39 ///
40 /// TODO: Service retrieval needs to be managed via plugin and interfaces requests, as happens for region
41 /// modules from scene. Among other things, this will allow this class to be used in many different contexts
42 /// (from a grid service executable, to provide services on a region) without lots of messy nulls and confusion.
43 /// Also, a post initialize step on the plugins will be needed so that we don't get tortuous problems with
44 /// circular dependencies between plugins.
39 public class CommunicationsManager 45 public class CommunicationsManager
40 { 46 {
41 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs
index 3a56d35..fb24c15 100644
--- a/OpenSim/Framework/Communications/IUserService.cs
+++ b/OpenSim/Framework/Communications/IUserService.cs
@@ -117,7 +117,12 @@ namespace OpenSim.Framework.Communications
117 /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship 117 /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship
118 /// for UUID friendslistowner 118 /// for UUID friendslistowner
119 /// </summary> 119 /// </summary>
120 /// <param name="friendlistowner">The agent that we're retreiving the friends Data.</param> 120 ///
121 /// <param name="friendlistowner">The agent for whom we're retreiving the friends Data.</param>
122 /// <returns>
123 /// A List of FriendListItems that contains info about the user's friends.
124 /// Always returns a list even if the user has no friends
125 /// </returns>
121 List<FriendListItem> GetUserFriendList(UUID friendlistowner); 126 List<FriendListItem> GetUserFriendList(UUID friendlistowner);
122 127
123 // This probably shouldn't be here, it belongs to IAuthentication 128 // This probably shouldn't be here, it belongs to IAuthentication
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index a269b59..2d0bf63 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -35,6 +35,7 @@ using Nwc.XmlRpc;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenMetaverse.StructuredData; 36using OpenMetaverse.StructuredData;
37using OpenSim.Data; 37using OpenSim.Data;
38using OpenSim.Framework.Communications;
38using OpenSim.Framework.Statistics; 39using OpenSim.Framework.Statistics;
39 40
40namespace OpenSim.Framework.Communications 41namespace OpenSim.Framework.Communications
@@ -52,15 +53,15 @@ namespace OpenSim.Framework.Communications
52 /// </value> 53 /// </value>
53 private List<IUserDataPlugin> m_plugins = new List<IUserDataPlugin>(); 54 private List<IUserDataPlugin> m_plugins = new List<IUserDataPlugin>();
54 55
55 protected IInterServiceInventoryServices m_interServiceInventoryService; 56 protected CommunicationsManager m_commsManager;
56 57
57 /// <summary> 58 /// <summary>
58 /// Constructor 59 /// Constructor
59 /// </summary> 60 /// </summary>
60 /// <param name="interServiceInventoryService"></param> 61 /// <param name="commsManager"></param>
61 public UserManagerBase(IInterServiceInventoryServices interServiceInventoryService) 62 public UserManagerBase(CommunicationsManager commsManager)
62 { 63 {
63 m_interServiceInventoryService = interServiceInventoryService; 64 m_commsManager = commsManager;
64 } 65 }
65 66
66 /// <summary> 67 /// <summary>
@@ -296,48 +297,48 @@ namespace OpenSim.Framework.Communications
296 return null; 297 return null;
297 } 298 }
298 299
299 /// <summary>
300 /// Loads a user's friend list
301 /// </summary>
302 /// <param name="name">the UUID of the friend list owner</param>
303 /// <returns>A List of FriendListItems that contains info about the user's friends</returns>
304 public virtual List<FriendListItem> GetUserFriendList(UUID ownerID) 300 public virtual List<FriendListItem> GetUserFriendList(UUID ownerID)
305 { 301 {
302 List<FriendListItem> allFriends = new List<FriendListItem>();
303
306 foreach (IUserDataPlugin plugin in m_plugins) 304 foreach (IUserDataPlugin plugin in m_plugins)
307 { 305 {
308 try 306 try
309 { 307 {
310 List<FriendListItem> result = plugin.GetUserFriendList(ownerID); 308 List<FriendListItem> friends = plugin.GetUserFriendList(ownerID);
311 309
312 if (result != null) 310 if (friends != null)
313 return result; 311 allFriends.AddRange(friends);
314 } 312 }
315 catch (Exception e) 313 catch (Exception e)
316 { 314 {
317 m_log.Info("[USERSTORAGE]: Unable to GetUserFriendList via " + plugin.Name + "(" + e.ToString() + ")"); 315 m_log.Error("[USERSTORAGE]: Unable to GetUserFriendList via " + plugin.Name + "(" + e.ToString() + ")");
318 } 316 }
319 } 317 }
320 318
321 return null; 319 return allFriends;
322 } 320 }
323 321
324 public virtual Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids) 322 public virtual Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids)
325 { 323 {
324 //Dictionary<UUID, FriendRegionInfo> allFriendRegions = new Dictionary<UUID, FriendRegionInfo>();
325
326 foreach (IUserDataPlugin plugin in m_plugins) 326 foreach (IUserDataPlugin plugin in m_plugins)
327 { 327 {
328 try 328 try
329 { 329 {
330 Dictionary<UUID, FriendRegionInfo> result = plugin.GetFriendRegionInfos(uuids); 330 Dictionary<UUID, FriendRegionInfo> friendRegions = plugin.GetFriendRegionInfos(uuids);
331 331
332 if (result != null) 332 if (friendRegions != null)
333 return result; 333 return friendRegions;
334 } 334 }
335 catch (Exception e) 335 catch (Exception e)
336 { 336 {
337 m_log.Info("[USERSTORAGE]: Unable to GetFriendRegionInfos via " + plugin.Name + "(" + e.ToString() + ")"); 337 m_log.Info("[USERSTORAGE]: Unable to GetFriendRegionInfos via " + plugin.Name + "(" + e.ToString() + ")");
338 } 338 }
339 } 339 }
340 return null; 340
341 return new Dictionary<UUID, FriendRegionInfo>();
341 } 342 }
342 343
343 public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) 344 public void StoreWebLoginKey(UUID agentID, UUID webLoginKey)
@@ -662,7 +663,7 @@ namespace OpenSim.Framework.Communications
662 } 663 }
663 else 664 else
664 { 665 {
665 m_interServiceInventoryService.CreateNewUserInventory(userProf.ID); 666 m_commsManager.InterServiceInventoryService.CreateNewUserInventory(userProf.ID);
666 667
667 return userProf.ID; 668 return userProf.ID;
668 } 669 }
@@ -731,13 +732,17 @@ namespace OpenSim.Framework.Communications
731 { 732 {
732 try 733 try
733 { 734 {
734 return plugin.GetUserAppearance(user); 735 AvatarAppearance appearance = plugin.GetUserAppearance(user);
736
737 if (appearance != null)
738 return appearance;
735 } 739 }
736 catch (Exception e) 740 catch (Exception e)
737 { 741 {
738 m_log.InfoFormat("[USERSTORAGE]: Unable to find user appearance {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString()); 742 m_log.InfoFormat("[USERSTORAGE]: Unable to find user appearance {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString());
739 } 743 }
740 } 744 }
745
741 return null; 746 return null;
742 } 747 }
743 748
diff --git a/OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs b/OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs
index 485dd46..51f9708 100644
--- a/OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs
@@ -43,13 +43,8 @@ namespace OpenSim.Grid.UserServer.Modules
43 { 43 {
44 protected IGridServiceCore m_core; 44 protected IGridServiceCore m_core;
45 45
46 public UserDataBaseService() 46 public UserDataBaseService(CommunicationsManager commsManager)
47 : base(null) 47 : base(commsManager)
48 {
49 }
50
51 public UserDataBaseService(IInterServiceInventoryServices interServiceInventoryService)
52 : base(interServiceInventoryService)
53 { 48 {
54 } 49 }
55 50
@@ -57,13 +52,6 @@ namespace OpenSim.Grid.UserServer.Modules
57 { 52 {
58 m_core = core; 53 m_core = core;
59 54
60 //we only need core components so we can request them from here
61 IInterServiceInventoryServices inventoryService;
62 if (m_core.TryGet<IInterServiceInventoryServices>(out inventoryService))
63 {
64 m_interServiceInventoryService = inventoryService;
65 }
66
67 UserConfig cfg; 55 UserConfig cfg;
68 if (m_core.TryGet<UserConfig>(out cfg)) 56 if (m_core.TryGet<UserConfig>(out cfg))
69 { 57 {
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index c0cba4a..0a5abd3 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -145,9 +145,16 @@ namespace OpenSim.Grid.UserServer
145 /// <param name="inventoryService"></param> 145 /// <param name="inventoryService"></param>
146 protected virtual void StartupUserServerModules() 146 protected virtual void StartupUserServerModules()
147 { 147 {
148 m_log.Info("[STARTUP]: Establishing data connection"); 148 m_log.Info("[STARTUP]: Establishing data connection");
149
150 //we only need core components so we can request them from here
151 IInterServiceInventoryServices inventoryService;
152 TryGet<IInterServiceInventoryServices>(out inventoryService);
153
154 CommunicationsManager commsManager = new UserServerCommsManager(inventoryService);
155
149 //setup database access service, for now this has to be created before the other modules. 156 //setup database access service, for now this has to be created before the other modules.
150 m_userDataBaseService = new UserDataBaseService(); 157 m_userDataBaseService = new UserDataBaseService(commsManager);
151 m_userDataBaseService.Initialise(this); 158 m_userDataBaseService.Initialise(this);
152 159
153 //TODO: change these modules so they fetch the databaseService class in the PostInitialise method 160 //TODO: change these modules so they fetch the databaseService class in the PostInitialise method
diff --git a/OpenSim/Grid/UserServer/UserServerCommsManager.cs b/OpenSim/Grid/UserServer/UserServerCommsManager.cs
new file mode 100644
index 0000000..519dfbc
--- /dev/null
+++ b/OpenSim/Grid/UserServer/UserServerCommsManager.cs
@@ -0,0 +1,40 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenSim.Framework.Communications;
29
30namespace OpenSim.Grid.UserServer
31{
32 public class UserServerCommsManager : CommunicationsManager
33 {
34 public UserServerCommsManager(IInterServiceInventoryServices interServiceInventoryService)
35 : base(null, null, null, false, null)
36 {
37 m_interServiceInventoryService = interServiceInventoryService;
38 }
39 }
40}
diff --git a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
index b649a91..126f42b 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
@@ -25,32 +25,53 @@
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
29using OpenSim.Framework; 28using OpenSim.Framework;
30using OpenSim.Framework.Communications; 29using OpenSim.Framework.Communications;
31using OpenSim.Framework.Communications.Cache; 30using OpenSim.Framework.Communications.Cache;
32using OpenSim.Framework.Servers; 31using OpenSim.Framework.Servers;
33using OpenSim.Region.Communications.Local; 32using OpenSim.Region.Communications.Local;
33using OpenSim.Region.Communications.OGS1;
34 34
35namespace OpenSim.Region.Communications.Hypergrid 35namespace OpenSim.Region.Communications.Hypergrid
36{ 36{
37 public class HGCommunicationsStandalone : CommunicationsLocal 37 public class HGCommunicationsStandalone : CommunicationsManager
38 { 38 {
39 public HGCommunicationsStandalone( 39 public HGCommunicationsStandalone(
40 ConfigSettings configSettings,
40 NetworkServersInfo serversInfo, 41 NetworkServersInfo serversInfo,
41 BaseHttpServer httpServer, 42 BaseHttpServer httpServer,
42 IAssetCache assetCache, 43 IAssetCache assetCache,
43 IUserService userService,
44 IUserAdminService userServiceAdmin,
45 LocalInventoryService inventoryService, 44 LocalInventoryService inventoryService,
46 HGGridServices gridService, IMessagingService messageService, LibraryRootFolder libraryRootFolder, bool dumpAssetsToFile) 45 HGGridServices gridService,
47 : base(serversInfo, httpServer, assetCache, userService, userServiceAdmin, inventoryService, gridService, messageService, libraryRootFolder, dumpAssetsToFile) 46 LibraryRootFolder libraryRootFolder,
48 { 47 bool dumpAssetsToFile)
49 gridService.UserProfileCache = m_userProfileCacheService; 48 : base(serversInfo, httpServer, assetCache, dumpAssetsToFile, libraryRootFolder)
49 {
50 LocalUserServices localUserService =
51 new LocalUserServices(
52 serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
53 localUserService.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
54
55 AddInventoryService(inventoryService);
56 m_defaultInventoryHost = inventoryService.Host;
57 m_interServiceInventoryService = inventoryService;
58
50 m_assetCache = assetCache; 59 m_assetCache = assetCache;
51 // Let's swap to always be secure access to inventory 60 // Let's swap to always be secure access to inventory
52 AddSecureInventoryService((ISecureInventoryService)inventoryService); 61 AddSecureInventoryService((ISecureInventoryService)inventoryService);
53 m_inventoryServices = null; 62 m_inventoryServices = null;
63
64 HGUserServices hgUserService = new HGUserServices(this, localUserService);
65 // This plugin arrangement could eventually be configurable rather than hardcoded here.
66 hgUserService.AddPlugin(new OGS1UserDataPlugin(this));
67
68 m_userService = hgUserService;
69 m_userAdminService = hgUserService;
70 m_avatarService = hgUserService;
71 m_messageService = hgUserService;
72
73 gridService.UserProfileCache = m_userProfileCacheService;
74 m_gridService = gridService;
54 } 75 }
55 } 76 }
56} 77}
diff --git a/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs b/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
index 25c6341..93d5434 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
@@ -47,7 +47,6 @@ namespace OpenSim.Region.Communications.Hypergrid
47 { 47 {
48 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 //private CommunicationsManager m_parent;
51 //private OGS1UserServices m_remoteUserServices; 50 //private OGS1UserServices m_remoteUserServices;
52 private LocalUserServices m_localUserServices; 51 private LocalUserServices m_localUserServices;
53 52
@@ -64,12 +63,6 @@ namespace OpenSim.Region.Communications.Hypergrid
64 m_localUserServices = local; 63 m_localUserServices = local;
65 } 64 }
66 65
67 // Called for standalone mode only, to set up the communications manager
68 public void SetCommunicationsManager(CommunicationsManager parent)
69 {
70 m_commsManager = parent;
71 }
72
73 /// <summary> 66 /// <summary>
74 /// Get a user agent from the user server 67 /// Get a user agent from the user server
75 /// </summary> 68 /// </summary>
@@ -84,7 +77,6 @@ namespace OpenSim.Region.Communications.Hypergrid
84 return base.GetAgentByUUID(userId); 77 return base.GetAgentByUUID(userId);
85 } 78 }
86 79
87
88 /// <summary> 80 /// <summary>
89 /// Logs off a user on the user server 81 /// Logs off a user on the user server
90 /// </summary> 82 /// </summary>
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index 59a1293..c17f799 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -35,24 +35,30 @@ namespace OpenSim.Region.Communications.Local
35 public class CommunicationsLocal : CommunicationsManager 35 public class CommunicationsLocal : CommunicationsManager
36 { 36 {
37 public CommunicationsLocal( 37 public CommunicationsLocal(
38 ConfigSettings configSettings,
38 NetworkServersInfo serversInfo, 39 NetworkServersInfo serversInfo,
39 BaseHttpServer httpServer, 40 BaseHttpServer httpServer,
40 IAssetCache assetCache, 41 IAssetCache assetCache,
41 IUserService userService,
42 IUserAdminService userServiceAdmin,
43 LocalInventoryService inventoryService, 42 LocalInventoryService inventoryService,
44 IGridServices gridService, IMessagingService messageService, 43 IGridServices gridService,
45 LibraryRootFolder libraryRootFolder, bool dumpAssetsToFile) 44 LibraryRootFolder libraryRootFolder,
45 bool dumpAssetsToFile)
46 : base(serversInfo, httpServer, assetCache, dumpAssetsToFile, libraryRootFolder) 46 : base(serversInfo, httpServer, assetCache, dumpAssetsToFile, libraryRootFolder)
47 { 47 {
48 AddInventoryService(inventoryService); 48 AddInventoryService(inventoryService);
49 m_defaultInventoryHost = inventoryService.Host; 49 m_defaultInventoryHost = inventoryService.Host;
50 m_interServiceInventoryService = inventoryService; 50 m_interServiceInventoryService = inventoryService;
51 m_userService = userService; 51
52 m_userAdminService = userServiceAdmin; 52 LocalUserServices lus
53 m_avatarService = (IAvatarService)userService; 53 = new LocalUserServices(
54 m_gridService = gridService; 54 serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
55 m_messageService = messageService; 55 lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
56 m_userService = lus;
57 m_userAdminService = lus;
58 m_avatarService = lus;
59 m_messageService = lus;
60
61 m_gridService = gridService;
56 } 62 }
57 } 63 }
58} 64}
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index eb60610..7412500 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -45,10 +45,10 @@ namespace OpenSim.Region.Communications.Local
45 /// </summary> 45 /// </summary>
46 /// <param name="defaultHomeLocX"></param> 46 /// <param name="defaultHomeLocX"></param>
47 /// <param name="defaultHomeLocY"></param> 47 /// <param name="defaultHomeLocY"></param>
48 /// <param name="inventoryService"></param> 48 /// <param name="commsManager"></param>
49 public LocalUserServices( 49 public LocalUserServices(
50 uint defaultHomeLocX, uint defaultHomeLocY, IInterServiceInventoryServices interServiceInventoryService) 50 uint defaultHomeLocX, uint defaultHomeLocY, CommunicationsManager commsManager)
51 : base(interServiceInventoryService) 51 : base(commsManager)
52 { 52 {
53 m_defaultHomeX = defaultHomeLocX; 53 m_defaultHomeX = defaultHomeLocX;
54 m_defaultHomeY = defaultHomeLocY; 54 m_defaultHomeY = defaultHomeLocY;
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 5f77107..fee17ac 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -46,12 +46,9 @@ namespace OpenSim.Region.Communications.OGS1
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 protected CommunicationsManager m_commsManager;
50
51 public OGS1UserServices(CommunicationsManager commsManager) 49 public OGS1UserServices(CommunicationsManager commsManager)
52 : base(commsManager.InterServiceInventoryService) 50 : base(commsManager)
53 { 51 {
54 m_commsManager = commsManager;
55 } 52 }
56 53
57 public override void ClearUserAgent(UUID avatarID) 54 public override void ClearUserAgent(UUID avatarID)
diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
index 93891c0..4ade40d 100644
--- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
+++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Tests.Common.Mock
67 m_interServiceInventoryService = lis; 67 m_interServiceInventoryService = lis;
68 AddInventoryService(lis); 68 AddInventoryService(lis);
69 69
70 LocalUserServices lus = new LocalUserServices(991, 992, lis); 70 LocalUserServices lus = new LocalUserServices(991, 992, this);
71 lus.AddPlugin(m_userDataPlugin); 71 lus.AddPlugin(m_userDataPlugin);
72 m_userService = lus; 72 m_userService = lus;
73 m_userAdminService = lus; 73 m_userAdminService = lus;