First pass at cleaning up old OGS1 and Local Inventory: removed everything-inventory in CommsManager, which wasn't actively used anymore.
parent
d12c173a70
commit
5d2a157e64
|
@ -109,120 +109,6 @@ namespace OpenSim.Framework.Communications
|
||||||
m_userProfileCacheService = new UserProfileCacheService(this, libraryRootFolder);
|
m_userProfileCacheService = new UserProfileCacheService(this, libraryRootFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Inventory
|
|
||||||
protected string m_defaultInventoryHost = "default";
|
|
||||||
|
|
||||||
protected List<IInventoryServices> m_inventoryServices = new List<IInventoryServices>();
|
|
||||||
// protected IInventoryServices m_inventoryService;
|
|
||||||
protected List<ISecureInventoryService> m_secureinventoryServices = new List<ISecureInventoryService>();
|
|
||||||
|
|
||||||
public ISecureInventoryService SecureInventoryService
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (m_secureinventoryServices.Count > 0)
|
|
||||||
{
|
|
||||||
// return m_inventoryServices[0];
|
|
||||||
ISecureInventoryService invService;
|
|
||||||
if (TryGetSecureInventoryService(m_defaultInventoryHost, out invService))
|
|
||||||
{
|
|
||||||
return invService;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IInventoryServices InventoryService
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (m_inventoryServices.Count > 0)
|
|
||||||
{
|
|
||||||
// return m_inventoryServices[0];
|
|
||||||
IInventoryServices invService;
|
|
||||||
if (TryGetInventoryService(m_defaultInventoryHost, out invService))
|
|
||||||
{
|
|
||||||
return invService;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool TryGetSecureInventoryService(string host, out ISecureInventoryService inventoryService)
|
|
||||||
{
|
|
||||||
if ((host == string.Empty) || (host == "default"))
|
|
||||||
{
|
|
||||||
host = m_defaultInventoryHost;
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (m_secureinventoryServices)
|
|
||||||
{
|
|
||||||
foreach (ISecureInventoryService service in m_secureinventoryServices)
|
|
||||||
{
|
|
||||||
if (service.Host == host)
|
|
||||||
{
|
|
||||||
inventoryService = service;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inventoryService = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool TryGetInventoryService(string host, out IInventoryServices inventoryService)
|
|
||||||
{
|
|
||||||
if ((host == string.Empty) || (host == "default"))
|
|
||||||
{
|
|
||||||
host = m_defaultInventoryHost;
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (m_inventoryServices)
|
|
||||||
{
|
|
||||||
foreach (IInventoryServices service in m_inventoryServices)
|
|
||||||
{
|
|
||||||
if (service.Host == host)
|
|
||||||
{
|
|
||||||
inventoryService = service;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inventoryService = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void AddInventoryService(string hostUrl)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void AddSecureInventoryService(string hostUrl)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void AddSecureInventoryService(ISecureInventoryService service)
|
|
||||||
{
|
|
||||||
lock (m_secureinventoryServices)
|
|
||||||
{
|
|
||||||
m_secureinventoryServices.Add(service);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void AddInventoryService(IInventoryServices service)
|
|
||||||
{
|
|
||||||
lock (m_inventoryServices)
|
|
||||||
{
|
|
||||||
m_inventoryServices.Add(service);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Friend Methods
|
#region Friend Methods
|
||||||
|
|
||||||
|
|
|
@ -656,7 +656,7 @@ namespace OpenSim
|
||||||
case "Add-InventoryHost":
|
case "Add-InventoryHost":
|
||||||
if (cmdparams.Length > 0)
|
if (cmdparams.Length > 0)
|
||||||
{
|
{
|
||||||
m_commsManager.AddInventoryService(cmdparams[0]);
|
m_log.Info("Not implemented.");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -59,16 +59,6 @@ namespace OpenSim.Region.Communications.Hypergrid
|
||||||
m_gridService = gridInterComms;
|
m_gridService = gridInterComms;
|
||||||
m_osw = gridInterComms;
|
m_osw = gridInterComms;
|
||||||
|
|
||||||
// The HG InventoryService always uses secure handlers
|
|
||||||
HGInventoryServiceClient invService = new HGInventoryServiceClient(serversInfo.InventoryURL, this.m_userProfileCacheService, true);
|
|
||||||
invService.UserProfileCache = m_userProfileCacheService;
|
|
||||||
AddSecureInventoryService(invService);
|
|
||||||
m_defaultInventoryHost = invService.Host;
|
|
||||||
if (SecureInventoryService != null)
|
|
||||||
m_log.Info("[HG]: SecureInventoryService.");
|
|
||||||
else
|
|
||||||
m_log.Info("[HG]: Non-secureInventoryService.");
|
|
||||||
|
|
||||||
HGUserServices userServices = new HGUserServices(this);
|
HGUserServices userServices = new HGUserServices(this);
|
||||||
// This plugin arrangement could eventually be configurable rather than hardcoded here.
|
// This plugin arrangement could eventually be configurable rather than hardcoded here.
|
||||||
userServices.AddPlugin(new TemporaryUserProfilePlugin());
|
userServices.AddPlugin(new TemporaryUserProfilePlugin());
|
||||||
|
|
|
@ -53,28 +53,6 @@ namespace OpenSim.Region.Communications.Hypergrid
|
||||||
new LocalUserServices(
|
new LocalUserServices(
|
||||||
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
|
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
|
||||||
localUserService.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
|
localUserService.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
|
||||||
|
|
||||||
HGInventoryServiceClient inventoryService
|
|
||||||
= new HGInventoryServiceClient(serversInfo.InventoryURL, null, false);
|
|
||||||
List<IInventoryDataPlugin> plugins
|
|
||||||
= DataPluginFactory.LoadDataPlugins<IInventoryDataPlugin>(
|
|
||||||
configSettings.StandaloneInventoryPlugin,
|
|
||||||
configSettings.StandaloneInventorySource);
|
|
||||||
|
|
||||||
foreach (IInventoryDataPlugin plugin in plugins)
|
|
||||||
{
|
|
||||||
// Using the OSP wrapper plugin should be made configurable at some point
|
|
||||||
inventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this));
|
|
||||||
}
|
|
||||||
|
|
||||||
AddInventoryService(inventoryService);
|
|
||||||
m_defaultInventoryHost = inventoryService.Host;
|
|
||||||
m_interServiceInventoryService = inventoryService;
|
|
||||||
inventoryService.UserProfileCache = UserProfileCacheService;
|
|
||||||
|
|
||||||
// Let's swap to always be secure access to inventory
|
|
||||||
AddSecureInventoryService((ISecureInventoryService)inventoryService);
|
|
||||||
m_inventoryServices = null;
|
|
||||||
|
|
||||||
HGUserServices hgUserService = new HGUserServices(this, localUserService);
|
HGUserServices hgUserService = new HGUserServices(this, localUserService);
|
||||||
// This plugin arrangement could eventually be configurable rather than hardcoded here.
|
// This plugin arrangement could eventually be configurable rather than hardcoded here.
|
||||||
|
|
|
@ -42,22 +42,7 @@ namespace OpenSim.Region.Communications.Local
|
||||||
LibraryRootFolder libraryRootFolder)
|
LibraryRootFolder libraryRootFolder)
|
||||||
: base(serversInfo, libraryRootFolder)
|
: base(serversInfo, libraryRootFolder)
|
||||||
{
|
{
|
||||||
LocalInventoryService inventoryService = new LocalInventoryService();
|
|
||||||
List<IInventoryDataPlugin> plugins
|
|
||||||
= DataPluginFactory.LoadDataPlugins<IInventoryDataPlugin>(
|
|
||||||
configSettings.StandaloneInventoryPlugin,
|
|
||||||
configSettings.StandaloneInventorySource);
|
|
||||||
|
|
||||||
foreach (IInventoryDataPlugin plugin in plugins)
|
|
||||||
{
|
|
||||||
// Using the OSP wrapper plugin for database plugins should be made configurable at some point
|
|
||||||
inventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this));
|
|
||||||
}
|
|
||||||
|
|
||||||
AddInventoryService(inventoryService);
|
|
||||||
m_defaultInventoryHost = inventoryService.Host;
|
|
||||||
m_interServiceInventoryService = inventoryService;
|
|
||||||
|
|
||||||
LocalUserServices lus
|
LocalUserServices lus
|
||||||
= new LocalUserServices(
|
= new LocalUserServices(
|
||||||
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
|
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
|
||||||
|
|
|
@ -42,19 +42,6 @@ namespace OpenSim.Region.Communications.OGS1
|
||||||
OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo);
|
OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo);
|
||||||
m_gridService = gridInterComms;
|
m_gridService = gridInterComms;
|
||||||
|
|
||||||
if (serversInfo.secureInventoryServer)
|
|
||||||
{
|
|
||||||
OGS1SecureInventoryService invService = new OGS1SecureInventoryService(serversInfo.InventoryURL);
|
|
||||||
AddSecureInventoryService(invService);
|
|
||||||
m_defaultInventoryHost = invService.Host;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OGS1InventoryService invService = new OGS1InventoryService(serversInfo.InventoryURL);
|
|
||||||
AddInventoryService(invService);
|
|
||||||
m_defaultInventoryHost = invService.Host;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This plugin arrangement could eventually be configurable rather than hardcoded here.
|
// This plugin arrangement could eventually be configurable rather than hardcoded here.
|
||||||
OGS1UserServices userServices = new OGS1UserServices(this);
|
OGS1UserServices userServices = new OGS1UserServices(this);
|
||||||
userServices.AddPlugin(new TemporaryUserProfilePlugin());
|
userServices.AddPlugin(new TemporaryUserProfilePlugin());
|
||||||
|
@ -65,16 +52,5 @@ namespace OpenSim.Region.Communications.OGS1
|
||||||
m_avatarService = (IAvatarService)m_userService;
|
m_avatarService = (IAvatarService)m_userService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddInventoryService(string hostUrl)
|
|
||||||
{
|
|
||||||
OGS1InventoryService invService = new OGS1InventoryService(hostUrl);
|
|
||||||
AddInventoryService(invService);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void AddSecureInventoryService(string hostUrl)
|
|
||||||
{
|
|
||||||
OGS1SecureInventoryService invService = new OGS1SecureInventoryService(hostUrl);
|
|
||||||
AddSecureInventoryService(invService);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,11 +57,6 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
public TestCommunicationsManager(NetworkServersInfo serversInfo)
|
public TestCommunicationsManager(NetworkServersInfo serversInfo)
|
||||||
: base(serversInfo, null)
|
: base(serversInfo, null)
|
||||||
{
|
{
|
||||||
LocalInventoryService lis = new LocalInventoryService();
|
|
||||||
m_inventoryDataPlugin = new TestInventoryDataPlugin();
|
|
||||||
lis.AddPlugin(m_inventoryDataPlugin);
|
|
||||||
m_interServiceInventoryService = lis;
|
|
||||||
AddInventoryService(lis);
|
|
||||||
|
|
||||||
LocalUserServices lus = new LocalUserServices(991, 992, this);
|
LocalUserServices lus = new LocalUserServices(991, 992, this);
|
||||||
lus.AddPlugin(new TemporaryUserProfilePlugin());
|
lus.AddPlugin(new TemporaryUserProfilePlugin());
|
||||||
|
|
Loading…
Reference in New Issue