diff options
author | Justin Clarke Casey | 2009-04-22 22:19:43 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-04-22 22:19:43 +0000 |
commit | 342126b7b9ca386f9160daecb51ecc14487a5f9f (patch) | |
tree | a485a50aebead411fa2f38528b4c0b7ba19e91db /OpenSim/Region/Communications | |
parent | * Resolve http://opensimulator.org/mantis/view.php?id=3509 by passing up the ... (diff) | |
download | opensim-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
Diffstat (limited to 'OpenSim/Region/Communications')
5 files changed, 48 insertions, 32 deletions
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 | |||
29 | using OpenSim.Framework; | 28 | using OpenSim.Framework; |
30 | using OpenSim.Framework.Communications; | 29 | using OpenSim.Framework.Communications; |
31 | using OpenSim.Framework.Communications.Cache; | 30 | using OpenSim.Framework.Communications.Cache; |
32 | using OpenSim.Framework.Servers; | 31 | using OpenSim.Framework.Servers; |
33 | using OpenSim.Region.Communications.Local; | 32 | using OpenSim.Region.Communications.Local; |
33 | using OpenSim.Region.Communications.OGS1; | ||
34 | 34 | ||
35 | namespace OpenSim.Region.Communications.Hypergrid | 35 | namespace 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) |