From b2ae86dd6adfc41925040905f01cec7078b77353 Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 29 Mar 2007 20:55:44 +0000 Subject: When you change the name of a inventory item, it should no longer revert after a logout / login --- OpenSim.RegionServer/AgentAssetUpload.cs | 1 + OpenSim.RegionServer/Assets/InventoryCache.cs | 20 ++++++++++++++++++-- OpenSim.RegionServer/CAPS/AdminWebFront.cs | 2 +- OpenSim.RegionServer/SimClient.cs | 10 +++++++--- 4 files changed, 27 insertions(+), 6 deletions(-) (limited to 'OpenSim.RegionServer') diff --git a/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim.RegionServer/AgentAssetUpload.cs index dae2191..bf8531a 100644 --- a/OpenSim.RegionServer/AgentAssetUpload.cs +++ b/OpenSim.RegionServer/AgentAssetUpload.cs @@ -197,6 +197,7 @@ namespace OpenSim trans.Asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description); trans.Asset.Name = Helpers.FieldToString(packet.InventoryBlock.Name); trans.Asset.Type = packet.InventoryBlock.Type; + trans.Asset.InvType = packet.InventoryBlock.InvType; if (trans.UploadComplete) { //already complete so we can add it to the inventory diff --git a/OpenSim.RegionServer/Assets/InventoryCache.cs b/OpenSim.RegionServer/Assets/InventoryCache.cs index cc7cc29..c62975a 100644 --- a/OpenSim.RegionServer/Assets/InventoryCache.cs +++ b/OpenSim.RegionServer/Assets/InventoryCache.cs @@ -141,11 +141,27 @@ namespace OpenSim.Assets return newItem; } - public bool UpdateInventoryItem(SimClient remoteClient, LLUUID itemID, OpenSim.Framework.Assets.AssetBase asset) + public bool UpdateInventoryItemAsset(SimClient remoteClient, LLUUID itemID, OpenSim.Framework.Assets.AssetBase asset) { if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) { - bool res = _agentsInventory[remoteClient.AgentID].UpdateItem(itemID, asset); + bool res = _agentsInventory[remoteClient.AgentID].UpdateItemAsset(itemID, asset); + if (res) + { + InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID]; + this.SendItemUpdateCreate(remoteClient, Item); + } + return res; + } + + return false; + } + + public bool UpdateInventoryItemDetails(SimClient remoteClient, LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) + { + if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) + { + bool res = _agentsInventory[remoteClient.AgentID].UpdateItemDetails(itemID, packet); if (res) { InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID]; diff --git a/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim.RegionServer/CAPS/AdminWebFront.cs index 6473878..4995e54 100644 --- a/OpenSim.RegionServer/CAPS/AdminWebFront.cs +++ b/OpenSim.RegionServer/CAPS/AdminWebFront.cs @@ -78,7 +78,7 @@ namespace OpenSim.CAPS //Console.WriteLine(requestBody); comp = requestBody.Split(delimiter); passw = comp[3].Split(delimiter2); - if (passw[1] == passWord) + if (passw[1] == passWord) // check admin password is correct { line = comp[0].Split(delimiter2); //split firstname diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index 068e148..ec6d3dc 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs @@ -49,7 +49,6 @@ namespace OpenSim /// public class SimClient { - public LLUUID AgentID; public LLUUID SessionID; public LLUUID SecureSessionID = LLUUID.Zero; @@ -354,6 +353,7 @@ namespace OpenSim break; case PacketType.UpdateInventoryItem: UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; + Console.WriteLine(Pack.ToString()); for (int i = 0; i < update.InventoryData.Length; i++) { if (update.InventoryData[i].TransactionID != LLUUID.Zero) @@ -362,7 +362,7 @@ namespace OpenSim 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.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); } else { @@ -370,7 +370,7 @@ namespace OpenSim 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.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); } else { @@ -378,6 +378,10 @@ namespace OpenSim } } } + else + { + m_inventoryCache.UpdateInventoryItemDetails(this, update.InventoryData[i].ItemID, update.InventoryData[i]); ; + } } break; case PacketType.ViewerEffect: -- cgit v1.1