Some work to prepare for inventory server.
parent
e34f5edb70
commit
82f8ecf673
|
@ -418,6 +418,31 @@ namespace OpenSim.Framework.UserManagement
|
||||||
return inventoryLibOwner;
|
return inventoryLibOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual AgentInventory GetUsersInventory(LLUUID agentID)
|
||||||
|
{
|
||||||
|
AgentInventory userInventory = new AgentInventory();
|
||||||
|
userInventory.CreateRootFolder(agentID, false);
|
||||||
|
|
||||||
|
return userInventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual ArrayList CreateInventoryArray(AgentInventory userInventory)
|
||||||
|
{
|
||||||
|
ArrayList AgentInventoryArray = new ArrayList();
|
||||||
|
Hashtable TempHash;
|
||||||
|
foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
|
||||||
|
{
|
||||||
|
TempHash = new Hashtable();
|
||||||
|
TempHash["name"] = InvFolder.FolderName;
|
||||||
|
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
|
||||||
|
TempHash["version"] = (Int32)InvFolder.Version;
|
||||||
|
TempHash["type_default"] = (Int32)InvFolder.DefaultType;
|
||||||
|
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
|
||||||
|
AgentInventoryArray.Add(TempHash);
|
||||||
|
}
|
||||||
|
return AgentInventoryArray;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Customises the login response and fills in missing values.
|
/// Customises the login response and fills in missing values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -481,39 +506,24 @@ namespace OpenSim.Framework.UserManagement
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
LLUUID agentID = userProfile.UUID;
|
||||||
LLUUID AgentID = userProfile.UUID;
|
|
||||||
|
|
||||||
// Inventory Library Section
|
// Inventory Library Section
|
||||||
ArrayList AgentInventoryArray = new ArrayList();
|
AgentInventory userInventory = this.GetUsersInventory(agentID);
|
||||||
Hashtable TempHash;
|
ArrayList AgentInventoryArray = this.CreateInventoryArray(userInventory);
|
||||||
|
|
||||||
AgentInventory Library = new AgentInventory();
|
|
||||||
Library.CreateRootFolder(AgentID, false);
|
|
||||||
|
|
||||||
foreach (InventoryFolder InvFolder in Library.InventoryFolders.Values)
|
|
||||||
{
|
|
||||||
TempHash = new Hashtable();
|
|
||||||
TempHash["name"] = InvFolder.FolderName;
|
|
||||||
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
|
|
||||||
TempHash["version"] = (Int32)InvFolder.Version;
|
|
||||||
TempHash["type_default"] = (Int32)InvFolder.DefaultType;
|
|
||||||
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
|
|
||||||
AgentInventoryArray.Add(TempHash);
|
|
||||||
}
|
|
||||||
|
|
||||||
Hashtable InventoryRootHash = new Hashtable();
|
Hashtable InventoryRootHash = new Hashtable();
|
||||||
InventoryRootHash["folder_id"] = Library.InventoryRoot.FolderID.ToStringHyphenated();
|
InventoryRootHash["folder_id"] = userInventory.InventoryRoot.FolderID.ToStringHyphenated();
|
||||||
ArrayList InventoryRoot = new ArrayList();
|
ArrayList InventoryRoot = new ArrayList();
|
||||||
InventoryRoot.Add(InventoryRootHash);
|
InventoryRoot.Add(InventoryRootHash);
|
||||||
userProfile.rootInventoryFolderID = Library.InventoryRoot.FolderID;
|
userProfile.rootInventoryFolderID = userInventory.InventoryRoot.FolderID;
|
||||||
|
|
||||||
// Circuit Code
|
// Circuit Code
|
||||||
uint circode = (uint)(Util.RandomClass.Next());
|
uint circode = (uint)(Util.RandomClass.Next());
|
||||||
|
|
||||||
logResponse.Lastname = userProfile.surname;
|
logResponse.Lastname = userProfile.surname;
|
||||||
logResponse.Firstname = userProfile.username;
|
logResponse.Firstname = userProfile.username;
|
||||||
logResponse.AgentID = AgentID.ToStringHyphenated();
|
logResponse.AgentID = agentID.ToStringHyphenated();
|
||||||
logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated();
|
logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated();
|
||||||
logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated();
|
logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated();
|
||||||
logResponse.InventoryRoot = InventoryRoot;
|
logResponse.InventoryRoot = InventoryRoot;
|
||||||
|
|
Loading…
Reference in New Issue