From 181a90967ee9084676f84e74b2393855218c5723 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 14 Aug 2007 17:29:15 +0000 Subject: Start of inventory items, when you upload a texture the data will now be stored in the inventory database and you will still have that texture in inventory on later logins (Again only in standalone mode with authentication.) Also there might be some problems if you upload textures in other regions to the start one (due to us not updating the CAPS url properly). --- .../Communications/Cache/AssetTransactions.cs | 4 ++-- .../Communications/Cache/CachedUserInfo.cs | 21 ++++++++++++++++++++- .../Communications/Cache/UserProfileCache.cs | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/Communications/Cache') diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index c906b76..e12d234 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs @@ -128,7 +128,7 @@ namespace OpenSim.Framework.Communications.Caches } if (this.OnUpLoad != null) { - this.OnUpLoad(this.m_assetName, this.newAssetID, inventoryItemID, data); + this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data); } return text; } @@ -266,7 +266,7 @@ namespace OpenSim.Framework.Communications.Caches } if (this.OnUpLoad != null) { - this.OnUpLoad(this.m_assetName, this.newAssetID, inventoryItemID, data); + this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data); } return text; } diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index fc2f948..123e692 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -40,10 +40,16 @@ namespace OpenSim.Framework.Communications.Caches { public class CachedUserInfo { + private CommunicationsManager m_parentCommsManager; // Fields public InventoryFolder RootFolder = null; public UserProfileData UserProfile = null; + public CachedUserInfo(CommunicationsManager commsManager) + { + m_parentCommsManager = commsManager; + } + // Methods public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) { @@ -73,6 +79,7 @@ namespace OpenSim.Framework.Communications.Caches public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) { + Console.WriteLine("received new inventory item " + itemInfo.inventoryID + " with asset id of " + itemInfo.assetID); if ((userID == this.UserProfile.UUID) && (this.RootFolder != null)) { if (itemInfo.parentFolderID == this.RootFolder.folderID) @@ -84,11 +91,23 @@ namespace OpenSim.Framework.Communications.Caches InventoryFolder folder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID); if (folder != null) { - folder.Items.Add(itemInfo.inventoryID, itemInfo); + folder.Items.Add(itemInfo.inventoryID, itemInfo); } } } } + + public void AddItem(LLUUID userID, InventoryItemBase itemInfo) + { + if ((userID == this.UserProfile.UUID) && (this.RootFolder != null)) + { + this.ItemReceive(userID, itemInfo); + Console.WriteLine("now adding inventory item to database"); + this.m_parentCommsManager.InventoryServer.AddNewInventoryItem(userID, itemInfo); + } + } } + + } diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs index e65b6b2..02c5f65 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs @@ -61,7 +61,7 @@ namespace OpenSim.Framework.Communications.Caches { if (!this.UserProfiles.ContainsKey(userID)) { - CachedUserInfo userInfo = new CachedUserInfo(); + CachedUserInfo userInfo = new CachedUserInfo(this.m_parent); userInfo.UserProfile = this.RequestUserProfileForUser(userID); if (userInfo.UserProfile != null) { -- cgit v1.1