mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
* 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
This commit is contained in:
@@ -25,32 +25,53 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Region.Communications.Local;
|
||||
using OpenSim.Region.Communications.OGS1;
|
||||
|
||||
namespace OpenSim.Region.Communications.Hypergrid
|
||||
{
|
||||
public class HGCommunicationsStandalone : CommunicationsLocal
|
||||
public class HGCommunicationsStandalone : CommunicationsManager
|
||||
{
|
||||
public HGCommunicationsStandalone(
|
||||
ConfigSettings configSettings,
|
||||
NetworkServersInfo serversInfo,
|
||||
BaseHttpServer httpServer,
|
||||
IAssetCache assetCache,
|
||||
IUserService userService,
|
||||
IUserAdminService userServiceAdmin,
|
||||
LocalInventoryService inventoryService,
|
||||
HGGridServices gridService, IMessagingService messageService, LibraryRootFolder libraryRootFolder, bool dumpAssetsToFile)
|
||||
: base(serversInfo, httpServer, assetCache, userService, userServiceAdmin, inventoryService, gridService, messageService, libraryRootFolder, dumpAssetsToFile)
|
||||
{
|
||||
gridService.UserProfileCache = m_userProfileCacheService;
|
||||
HGGridServices gridService,
|
||||
LibraryRootFolder libraryRootFolder,
|
||||
bool dumpAssetsToFile)
|
||||
: base(serversInfo, httpServer, assetCache, dumpAssetsToFile, libraryRootFolder)
|
||||
{
|
||||
LocalUserServices localUserService =
|
||||
new LocalUserServices(
|
||||
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
|
||||
localUserService.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
|
||||
|
||||
AddInventoryService(inventoryService);
|
||||
m_defaultInventoryHost = inventoryService.Host;
|
||||
m_interServiceInventoryService = inventoryService;
|
||||
|
||||
m_assetCache = assetCache;
|
||||
// Let's swap to always be secure access to inventory
|
||||
AddSecureInventoryService((ISecureInventoryService)inventoryService);
|
||||
m_inventoryServices = null;
|
||||
|
||||
HGUserServices hgUserService = new HGUserServices(this, localUserService);
|
||||
// This plugin arrangement could eventually be configurable rather than hardcoded here.
|
||||
hgUserService.AddPlugin(new OGS1UserDataPlugin(this));
|
||||
|
||||
m_userService = hgUserService;
|
||||
m_userAdminService = hgUserService;
|
||||
m_avatarService = hgUserService;
|
||||
m_messageService = hgUserService;
|
||||
|
||||
gridService.UserProfileCache = m_userProfileCacheService;
|
||||
m_gridService = gridService;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace OpenSim.Region.Communications.Hypergrid
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
//private CommunicationsManager m_parent;
|
||||
//private OGS1UserServices m_remoteUserServices;
|
||||
private LocalUserServices m_localUserServices;
|
||||
|
||||
@@ -64,12 +63,6 @@ namespace OpenSim.Region.Communications.Hypergrid
|
||||
m_localUserServices = local;
|
||||
}
|
||||
|
||||
// Called for standalone mode only, to set up the communications manager
|
||||
public void SetCommunicationsManager(CommunicationsManager parent)
|
||||
{
|
||||
m_commsManager = parent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a user agent from the user server
|
||||
/// </summary>
|
||||
@@ -84,7 +77,6 @@ namespace OpenSim.Region.Communications.Hypergrid
|
||||
return base.GetAgentByUUID(userId);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Logs off a user on the user server
|
||||
/// </summary>
|
||||
|
||||
@@ -35,24 +35,30 @@ namespace OpenSim.Region.Communications.Local
|
||||
public class CommunicationsLocal : CommunicationsManager
|
||||
{
|
||||
public CommunicationsLocal(
|
||||
ConfigSettings configSettings,
|
||||
NetworkServersInfo serversInfo,
|
||||
BaseHttpServer httpServer,
|
||||
IAssetCache assetCache,
|
||||
IUserService userService,
|
||||
IUserAdminService userServiceAdmin,
|
||||
LocalInventoryService inventoryService,
|
||||
IGridServices gridService, IMessagingService messageService,
|
||||
LibraryRootFolder libraryRootFolder, bool dumpAssetsToFile)
|
||||
IGridServices gridService,
|
||||
LibraryRootFolder libraryRootFolder,
|
||||
bool dumpAssetsToFile)
|
||||
: base(serversInfo, httpServer, assetCache, dumpAssetsToFile, libraryRootFolder)
|
||||
{
|
||||
AddInventoryService(inventoryService);
|
||||
m_defaultInventoryHost = inventoryService.Host;
|
||||
m_interServiceInventoryService = inventoryService;
|
||||
m_userService = userService;
|
||||
m_userAdminService = userServiceAdmin;
|
||||
m_avatarService = (IAvatarService)userService;
|
||||
m_gridService = gridService;
|
||||
m_messageService = messageService;
|
||||
|
||||
LocalUserServices lus
|
||||
= new LocalUserServices(
|
||||
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
|
||||
lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
|
||||
m_userService = lus;
|
||||
m_userAdminService = lus;
|
||||
m_avatarService = lus;
|
||||
m_messageService = lus;
|
||||
|
||||
m_gridService = gridService;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ namespace OpenSim.Region.Communications.Local
|
||||
/// </summary>
|
||||
/// <param name="defaultHomeLocX"></param>
|
||||
/// <param name="defaultHomeLocY"></param>
|
||||
/// <param name="inventoryService"></param>
|
||||
/// <param name="commsManager"></param>
|
||||
public LocalUserServices(
|
||||
uint defaultHomeLocX, uint defaultHomeLocY, IInterServiceInventoryServices interServiceInventoryService)
|
||||
: base(interServiceInventoryService)
|
||||
uint defaultHomeLocX, uint defaultHomeLocY, CommunicationsManager commsManager)
|
||||
: base(commsManager)
|
||||
{
|
||||
m_defaultHomeX = defaultHomeLocX;
|
||||
m_defaultHomeY = defaultHomeLocY;
|
||||
|
||||
@@ -46,12 +46,9 @@ namespace OpenSim.Region.Communications.OGS1
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected CommunicationsManager m_commsManager;
|
||||
|
||||
public OGS1UserServices(CommunicationsManager commsManager)
|
||||
: base(commsManager.InterServiceInventoryService)
|
||||
: base(commsManager)
|
||||
{
|
||||
m_commsManager = commsManager;
|
||||
}
|
||||
|
||||
public override void ClearUserAgent(UUID avatarID)
|
||||
|
||||
Reference in New Issue
Block a user