more work on the support for multiple inventory servers.

The Login service should now read/create new inventory on the inventory server that is set in a users profile.
Also added "Add-InventoryHost" console command to add a support for a new server to a region.
So it would be good if someone could test this. Set up the grid as normal, but then also run extra inventory server on a different computer (well actually it just has to be on a different network hostname, so one using "http://localhost:8004" and one using "http://127.0.0.1:8005" should work) then you need to manually edit the user profile database to set the new servers url in a user's "userInventoryURI" field. 
Then on a region server, use the Add-InventoryHost to add the new server url (always include the full url, including http, but don't add a final /)
Login with that account and see if the inventory works.
Of course these needs to be made more user friendly.
0.6.0-stable
MW 2008-06-28 17:52:06 +00:00
parent 590df180a4
commit 5cfc468d95
4 changed files with 21 additions and 8 deletions

View File

@ -94,7 +94,7 @@ namespace OpenSim.Framework.Communications
/// <param name="userID"></param> /// <param name="userID"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref='System.Exception'>This will be thrown if there is a problem with the inventory service</exception> /// <exception cref='System.Exception'>This will be thrown if there is a problem with the inventory service</exception>
protected abstract InventoryData GetInventorySkeleton(LLUUID userID); protected abstract InventoryData GetInventorySkeleton(LLUUID userID, string inventoryServerUrl);
/// <summary> /// <summary>
/// Called when we receive the client's initial XMLRPC login_to_simulator request message /// Called when we receive the client's initial XMLRPC login_to_simulator request message
@ -230,7 +230,7 @@ namespace OpenSim.Framework.Communications
try try
{ {
inventData = GetInventorySkeleton(agentID); inventData = GetInventorySkeleton(agentID, userProfile.UserInventoryURI);
} }
catch (Exception e) catch (Exception e)
{ {
@ -386,7 +386,7 @@ namespace OpenSim.Framework.Communications
LLUUID agentID = userProfile.ID; LLUUID agentID = userProfile.ID;
// Inventory Library Section // Inventory Library Section
InventoryData inventData = GetInventorySkeleton(agentID); InventoryData inventData = GetInventorySkeleton(agentID, userProfile.UserInventoryURI);
ArrayList AgentInventoryArray = inventData.InventoryArray; ArrayList AgentInventoryArray = inventData.InventoryArray;
Hashtable InventoryRootHash = new Hashtable(); Hashtable InventoryRootHash = new Hashtable();

View File

@ -419,15 +419,21 @@ namespace OpenSim.Grid.UserServer
} }
// See LoginService // See LoginService
protected override InventoryData GetInventorySkeleton(LLUUID userID) protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl)
{ {
string invUrl = m_config.InventoryUrl;
if (serverUrl != String.Empty)
{
invUrl = serverUrl;
}
m_log.DebugFormat( m_log.DebugFormat(
"[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}",
m_config.InventoryUrl, userID); m_config.InventoryUrl, userID);
List<InventoryFolderBase> folders List<InventoryFolderBase> folders
= SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>(
"POST", m_config.InventoryUrl + "RootFolders/", userID.UUID); "POST", invUrl + "RootFolders/", userID.UUID);
if (null == folders || folders.Count == 0) if (null == folders || folders.Count == 0)
{ {
@ -440,7 +446,7 @@ namespace OpenSim.Grid.UserServer
// exist. // exist.
bool created = bool created =
SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( SynchronousRestObjectPoster.BeginPostObject<Guid, bool>(
"POST", m_config.InventoryUrl + "CreateInventory/", userID.UUID); "POST", invUrl + "CreateInventory/", userID.UUID);
if (!created) if (!created)
{ {
@ -456,7 +462,7 @@ namespace OpenSim.Grid.UserServer
} }
folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>(
"POST", m_config.InventoryUrl + "RootFolders/", userID.UUID); "POST", invUrl + "RootFolders/", userID.UUID);
} }
if (folders != null && folders.Count > 0) if (folders != null && folders.Count > 0)

View File

@ -602,6 +602,13 @@ namespace OpenSim
} }
break; break;
case "Add-InventoryHost":
if (cmdparams.Length > 0)
{
m_commsManager.AddInventoryService(cmdparams[0]);
}
break;
default: default:
string[] tmpPluginArgs = new string[cmdparams.Length + 1]; string[] tmpPluginArgs = new string[cmdparams.Length + 1];
cmdparams.CopyTo(tmpPluginArgs, 1); cmdparams.CopyTo(tmpPluginArgs, 1);

View File

@ -258,7 +258,7 @@ namespace OpenSim.Region.Communications.Local
} }
// See LoginService // See LoginService
protected override InventoryData GetInventorySkeleton(LLUUID userID) protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl)
{ {
List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID); List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID);