The new secure inventory server mode (in r5590) can now be disabled from OpenSim.ini. Default is to use the new mode.
parent
003487631d
commit
ce4bcb5065
|
@ -335,8 +335,14 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
createdBaseFolder.Type = createdFolder.Type;
|
||||
createdBaseFolder.Version = createdFolder.Version;
|
||||
|
||||
if (m_commsManager.SecureInventoryService != null)
|
||||
{
|
||||
m_commsManager.SecureInventoryService.AddFolder(createdBaseFolder, m_session_id);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_commsManager.InventoryService.AddFolder(createdBaseFolder);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -389,7 +395,14 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
baseFolder.Type = (short)type;
|
||||
baseFolder.Version = RootFolder.Version;
|
||||
|
||||
if (m_commsManager.SecureInventoryService != null)
|
||||
{
|
||||
m_commsManager.SecureInventoryService.UpdateFolder(baseFolder, m_session_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_commsManager.InventoryService.UpdateFolder(baseFolder);
|
||||
}
|
||||
|
||||
InventoryFolderImpl folder = RootFolder.FindFolder(folderID);
|
||||
if (folder != null)
|
||||
|
@ -431,7 +444,14 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
baseFolder.ID = folderID;
|
||||
baseFolder.ParentID = parentID;
|
||||
|
||||
if (m_commsManager.SecureInventoryService != null)
|
||||
{
|
||||
m_commsManager.SecureInventoryService.MoveFolder(baseFolder, m_session_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_commsManager.InventoryService.MoveFolder(baseFolder);
|
||||
}
|
||||
|
||||
InventoryFolderImpl folder = RootFolder.FindFolder(folderID);
|
||||
if (folder != null)
|
||||
|
@ -478,7 +498,14 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
purgedBaseFolder.Type = purgedFolder.Type;
|
||||
purgedBaseFolder.Version = purgedFolder.Version;
|
||||
|
||||
if (m_commsManager.SecureInventoryService != null)
|
||||
{
|
||||
m_commsManager.SecureInventoryService.PurgeFolder(purgedBaseFolder, m_session_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder);
|
||||
}
|
||||
|
||||
purgedFolder.Purge();
|
||||
|
||||
|
@ -515,9 +542,16 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
item.Folder = RootFolder.ID;
|
||||
}
|
||||
ItemReceive(item);
|
||||
if (m_commsManager.SecureInventoryService != null)
|
||||
{
|
||||
m_commsManager.SecureInventoryService.AddItem(item, m_session_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_commsManager.InventoryService.AddItem(item);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddRequest(
|
||||
new InventoryRequest(
|
||||
|
@ -534,10 +568,17 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
public void UpdateItem(InventoryItemBase item)
|
||||
{
|
||||
if (HasInventory)
|
||||
{
|
||||
if (m_commsManager.SecureInventoryService != null)
|
||||
{
|
||||
m_commsManager.SecureInventoryService.UpdateItem(item, m_session_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_commsManager.InventoryService.UpdateItem(item);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddRequest(
|
||||
new InventoryRequest(
|
||||
|
@ -573,9 +614,16 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
}
|
||||
|
||||
if (RootFolder.DeleteItem(item.ID))
|
||||
{
|
||||
if (m_commsManager.SecureInventoryService != null)
|
||||
{
|
||||
return m_commsManager.SecureInventoryService.DeleteItem(item, m_session_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_commsManager.InventoryService.DeleteItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -145,8 +145,15 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
{
|
||||
CachedUserInfo userInfo = GetUserDetails(userID);
|
||||
if (userInfo != null)
|
||||
{
|
||||
if (m_commsManager.SecureInventoryService != null)
|
||||
{
|
||||
m_commsManager.SecureInventoryService.RequestInventoryForUser(userID, userInfo.SessionID, userInfo.InventoryReceive);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive);
|
||||
}
|
||||
//IInventoryServices invService = userInfo.GetInventoryService();
|
||||
//if (invService != null)
|
||||
//{
|
||||
|
|
|
@ -112,11 +112,23 @@ namespace OpenSim.Framework.Communications
|
|||
|
||||
protected List<IInventoryServices> m_inventoryServices = new List<IInventoryServices>();
|
||||
// protected IInventoryServices m_inventoryService;
|
||||
protected ISecureInventoryService m_secureinventoryServices;
|
||||
protected List<ISecureInventoryService> m_secureinventoryServices = new List<ISecureInventoryService>();
|
||||
|
||||
public ISecureInventoryService SecureInventoryService
|
||||
{
|
||||
get { return m_secureinventoryServices; }
|
||||
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
|
||||
|
@ -136,6 +148,29 @@ namespace OpenSim.Framework.Communications
|
|||
}
|
||||
}
|
||||
|
||||
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"))
|
||||
|
@ -164,6 +199,19 @@ namespace OpenSim.Framework.Communications
|
|||
|
||||
}
|
||||
|
||||
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)
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace OpenSim.Framework
|
|||
public string GridURL = String.Empty;
|
||||
public uint HttpListenerPort = DefaultHttpListenerPort;
|
||||
public string InventoryURL = String.Empty;
|
||||
public bool secureInventoryServer = false;
|
||||
public bool isSandbox;
|
||||
private uint? m_defaultHomeLocX;
|
||||
private uint? m_defaultHomeLocY;
|
||||
|
@ -93,6 +94,7 @@ namespace OpenSim.Framework
|
|||
InventoryURL = config.Configs["Network"].GetString("inventory_server_url",
|
||||
"http://127.0.0.1:" +
|
||||
InventoryConfig.DefaultHttpPort.ToString());
|
||||
secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -254,6 +254,7 @@ namespace OpenSim
|
|||
config.Set("user_recv_key", "null");
|
||||
config.Set("asset_server_url", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString());
|
||||
config.Set("inventory_server_url", "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString());
|
||||
config.Set("secure_inventory_server", "true");
|
||||
}
|
||||
|
||||
if (DefaultConfig.Configs["RemoteAdmin"] == null)
|
||||
|
|
|
@ -41,10 +41,18 @@ namespace OpenSim.Region.Communications.OGS1
|
|||
m_gridService = gridInterComms;
|
||||
m_interRegion = gridInterComms;
|
||||
|
||||
m_secureinventoryServices = new OGS1SecureInventoryService(serversInfo.InventoryURL);
|
||||
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;
|
||||
}
|
||||
|
||||
m_userService = new OGS1UserServices(this);
|
||||
m_avatarService = (IAvatarService)m_userService;
|
||||
|
@ -55,5 +63,11 @@ namespace OpenSim.Region.Communications.OGS1
|
|||
OGS1InventoryService invService = new OGS1InventoryService(hostUrl);
|
||||
AddInventoryService(invService);
|
||||
}
|
||||
|
||||
public override void AddSecureInventoryService(string hostUrl)
|
||||
{
|
||||
OGS1SecureInventoryService invService = new OGS1SecureInventoryService(hostUrl);
|
||||
AddSecureInventoryService(invService);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue