Start of Inventory service, currently only (partially) functional in standalone mode and using sqlite).

In standalone mode, if you have account authenticate turned on (setting in opensim.ini) then when you create a new account, a set of inventory is created for that account and stored in database (currently only a set of empty folders). Then during login the database is search for that set and sent to the client in the login response.
More functions will be added soon, like creating new folders (and a bit later items) from the client inventory window.
This commit is contained in:
MW
2007-08-14 13:54:46 +00:00
parent 7b2663a41e
commit a228b5984e
14 changed files with 663 additions and 30 deletions

View File

@@ -89,14 +89,14 @@ namespace OpenSim.Framework.UserManagement
LLUUID agentID = userProfile.UUID;
// Inventory Library Section
AgentInventory userInventory = this.GetUsersInventory(agentID);
ArrayList AgentInventoryArray = this.CreateInventoryArray(userInventory);
InventoryData inventData = this.CreateInventoryData(agentID);
ArrayList AgentInventoryArray = inventData.InventoryArray;
Hashtable InventoryRootHash = new Hashtable();
InventoryRootHash["folder_id"] = userInventory.InventoryRoot.FolderID.ToStringHyphenated();
InventoryRootHash["folder_id"] = inventData.RootFolderID.ToStringHyphenated();
ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash);
userProfile.rootInventoryFolderID = userInventory.InventoryRoot.FolderID;
userProfile.rootInventoryFolderID = inventData.RootFolderID;
// Circuit Code
uint circode = (uint)(Util.RandomClass.Next());
@@ -253,16 +253,11 @@ namespace OpenSim.Framework.UserManagement
return inventoryLibOwner;
}
protected virtual AgentInventory GetUsersInventory(LLUUID agentID)
protected virtual InventoryData CreateInventoryData(LLUUID userID)
{
AgentInventory userInventory = new AgentInventory();
userInventory.CreateRootFolder(agentID, false);
userInventory.CreateRootFolder(userID, false);
return userInventory;
}
protected virtual ArrayList CreateInventoryArray(AgentInventory userInventory)
{
ArrayList AgentInventoryArray = new ArrayList();
Hashtable TempHash;
foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
@@ -275,7 +270,20 @@ namespace OpenSim.Framework.UserManagement
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
AgentInventoryArray.Add(TempHash);
}
return AgentInventoryArray;
return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
}
public class InventoryData
{
public ArrayList InventoryArray = null;
public LLUUID RootFolderID = LLUUID.Zero;
public InventoryData(ArrayList invList, LLUUID rootID)
{
InventoryArray = invList;
RootFolderID = rootID;
}
}
}
}