Fixed so Inventory structure is correct after a log out and re-login (in Sandbox accounts)
parent
546d9dfdc5
commit
f673b73471
|
@ -33,7 +33,7 @@ namespace OpenSim.Framework.Inventory
|
||||||
|
|
||||||
InventoryRoot = new InventoryFolder();
|
InventoryRoot = new InventoryFolder();
|
||||||
InventoryRoot.FolderID = LLUUID.Random();
|
InventoryRoot.FolderID = LLUUID.Random();
|
||||||
InventoryRoot.ParentID = new LLUUID();
|
InventoryRoot.ParentID = LLUUID.Zero;
|
||||||
InventoryRoot.Version = 1;
|
InventoryRoot.Version = 1;
|
||||||
InventoryRoot.DefaultType = 8;
|
InventoryRoot.DefaultType = 8;
|
||||||
InventoryRoot.OwnerID = this.AgentID;
|
InventoryRoot.OwnerID = this.AgentID;
|
||||||
|
@ -84,6 +84,7 @@ namespace OpenSim.Framework.Inventory
|
||||||
|
|
||||||
public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent)
|
public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
|
||||||
InventoryFolder Folder = new InventoryFolder();
|
InventoryFolder Folder = new InventoryFolder();
|
||||||
Folder.FolderID = folderID;
|
Folder.FolderID = folderID;
|
||||||
Folder.OwnerID = this.AgentID;
|
Folder.OwnerID = this.AgentID;
|
||||||
|
|
|
@ -287,9 +287,11 @@ namespace OpenSim.Framework.User
|
||||||
ClassifiedCategories.Add(ClassifiedCategoriesHash);
|
ClassifiedCategories.Add(ClassifiedCategoriesHash);
|
||||||
|
|
||||||
ArrayList AgentInventory = new ArrayList();
|
ArrayList AgentInventory = new ArrayList();
|
||||||
|
Console.WriteLine("adding inventory to response");
|
||||||
foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
|
foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
|
||||||
{
|
{
|
||||||
Hashtable TempHash = new Hashtable();
|
Hashtable TempHash = new Hashtable();
|
||||||
|
Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated());
|
||||||
TempHash["name"] = InvFolder.FolderName;
|
TempHash["name"] = InvFolder.FolderName;
|
||||||
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
|
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
|
||||||
TempHash["version"] = (Int32)InvFolder.Version;
|
TempHash["version"] = (Int32)InvFolder.Version;
|
||||||
|
|
|
@ -112,6 +112,19 @@ namespace OpenSim.Assets
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CreateNewInventoryFolder(SimClient remoteClient, LLUUID folderID, ushort type, string folderName, LLUUID parent)
|
||||||
|
{
|
||||||
|
bool res = false;
|
||||||
|
if (folderID != LLUUID.Zero) //don't create a folder with a zero id
|
||||||
|
{
|
||||||
|
if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
|
||||||
|
{
|
||||||
|
res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID, type, folderName, parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public LLUUID AddNewInventoryItem(SimClient remoteClient, LLUUID folderID, OpenSim.Framework.Assets.AssetBase asset)
|
public LLUUID AddNewInventoryItem(SimClient remoteClient, LLUUID folderID, OpenSim.Framework.Assets.AssetBase asset)
|
||||||
{
|
{
|
||||||
LLUUID newItem = null;
|
LLUUID newItem = null;
|
||||||
|
|
|
@ -332,7 +332,7 @@ namespace OpenSim
|
||||||
break;
|
break;
|
||||||
case PacketType.CreateInventoryFolder:
|
case PacketType.CreateInventoryFolder:
|
||||||
CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
|
CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
|
||||||
m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type);
|
m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Helpers.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID);
|
||||||
Console.WriteLine(Pack.ToString());
|
Console.WriteLine(Pack.ToString());
|
||||||
break;
|
break;
|
||||||
case PacketType.CreateInventoryItem:
|
case PacketType.CreateInventoryItem:
|
||||||
|
@ -361,6 +361,7 @@ namespace OpenSim
|
||||||
AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID));
|
AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID));
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache");
|
||||||
m_inventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset);
|
m_inventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -368,8 +369,13 @@ namespace OpenSim
|
||||||
asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID);
|
asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID);
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToStringHyphenated() + " to cache");
|
||||||
m_inventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset);
|
m_inventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("trying to update inventory item, but asset is null");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -712,6 +718,7 @@ namespace OpenSim
|
||||||
if (this.m_userServer != null)
|
if (this.m_userServer != null)
|
||||||
{
|
{
|
||||||
// a user server is set so request the inventory from it
|
// a user server is set so request the inventory from it
|
||||||
|
Console.WriteLine("getting inventory from user server");
|
||||||
inventory = m_inventoryCache.FetchAgentsInventory(this.AgentID, m_userServer);
|
inventory = m_inventoryCache.FetchAgentsInventory(this.AgentID, m_userServer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue