From f673b73471dd450881006a5281c15b4b70c96b2d Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 29 Mar 2007 17:04:24 +0000 Subject: Fixed so Inventory structure is correct after a log out and re-login (in Sandbox accounts) --- OpenSim.RegionServer/Assets/InventoryCache.cs | 13 +++++++++++++ OpenSim.RegionServer/SimClient.cs | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'OpenSim.RegionServer') diff --git a/OpenSim.RegionServer/Assets/InventoryCache.cs b/OpenSim.RegionServer/Assets/InventoryCache.cs index 1090940..cc7cc29 100644 --- a/OpenSim.RegionServer/Assets/InventoryCache.cs +++ b/OpenSim.RegionServer/Assets/InventoryCache.cs @@ -112,6 +112,19 @@ namespace OpenSim.Assets 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) { LLUUID newItem = null; diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index 6eb48fb..068e148 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs @@ -332,7 +332,7 @@ namespace OpenSim break; case PacketType.CreateInventoryFolder: 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()); break; case PacketType.CreateInventoryItem: @@ -361,6 +361,7 @@ namespace OpenSim AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); 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); } else @@ -368,8 +369,13 @@ namespace OpenSim asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); if (asset != null) { + Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToStringHyphenated() + " to cache"); 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) { // 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); } else -- cgit v1.1