From 863556f2cc545c56599aab9d28373aa4ed83288d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 19 Feb 2009 03:09:56 +0000 Subject: Thank you, Snowdrop, for a patch that makes the callback ID parameter usable. Applied with formatting changes, please don't introduce K&R style indentations into OpenSim Fixes Mantis #3190 --- OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 3 ++- .../CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | 8 ++++---- OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 13 +++++++------ OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 2 +- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 673810e..bfc70a4 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -878,7 +878,7 @@ namespace OpenSim.Framework /// Tell the client that we have created the item it requested. /// /// - void SendInventoryItemCreateUpdate(InventoryItemBase Item); + void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId); void SendRemoveInventoryItem(UUID itemID); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 3565e5a..34ad0f1 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -2062,7 +2062,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } /// IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase) - public void SendInventoryItemCreateUpdate(InventoryItemBase Item) + public void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId) { const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; @@ -2088,6 +2088,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP InventoryReply.InventoryData[0].OwnerID = Item.Owner; InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions; InventoryReply.InventoryData[0].Type = (sbyte)Item.AssetType; + InventoryReply.InventoryData[0].CallbackID = callbackId; InventoryReply.InventoryData[0].GroupID = Item.GroupID; InventoryReply.InventoryData[0].GroupOwned = Item.GroupOwned; diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index b71c2a6..7803209 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction m_finished = true; if (m_createItem) { - DoCreateItem(); + DoCreateItem(0); } else if (m_storeLocal) { @@ -200,7 +200,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction if (m_finished) { - DoCreateItem(); + DoCreateItem(callbackID); } else { @@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction } - private void DoCreateItem() + private void DoCreateItem(uint callbackID) { m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); CachedUserInfo userInfo = @@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction item.CreationDate = Util.UnixTimeSinceEpoch(); userInfo.AddItem(item); - ourClient.SendInventoryItemCreateUpdate(item); + ourClient.SendInventoryItemCreateUpdate(item, callbackID); } else { diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 4e11759..3d461e7 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -540,7 +540,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item) + public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackID) { } diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 2800e9e..f5d7b32 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -140,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes if (userInfo != null) { AddInventoryItem(remoteClient.AgentId, item); - remoteClient.SendInventoryItemCreateUpdate(item); + remoteClient.SendInventoryItemCreateUpdate(item, 0); } else { @@ -846,7 +846,7 @@ namespace OpenSim.Region.Framework.Scenes item.CreationDate = creationDate; userInfo.AddItem(item); - remoteClient.SendInventoryItemCreateUpdate(item); + remoteClient.SendInventoryItemCreateUpdate(item, callbackID); } else { @@ -1379,6 +1379,7 @@ namespace OpenSim.Region.Framework.Scenes if (part != null) { + TaskInventoryItem currentItem = part.Inventory.GetInventoryItem(itemID); bool allowInventoryDrop = (part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0; @@ -2003,14 +2004,14 @@ namespace OpenSim.Region.Framework.Scenes if (remoteClient != null && item.Owner == remoteClient.AgentId) { - remoteClient.SendInventoryItemCreateUpdate(item); + remoteClient.SendInventoryItemCreateUpdate(item, 0); } else { ScenePresence notifyUser = GetScenePresence(item.Owner); if (notifyUser != null) { - notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); + notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0); } } } @@ -2092,7 +2093,7 @@ namespace OpenSim.Region.Framework.Scenes // this gets called when the agent loggs off! if (remoteClient != null) { - remoteClient.SendInventoryItemCreateUpdate(item); + remoteClient.SendInventoryItemCreateUpdate(item, 0); } } } @@ -2151,7 +2152,7 @@ namespace OpenSim.Region.Framework.Scenes grp.SetFromAssetID(item.ID); userInfo.AddItem(item); - remoteClient.SendInventoryItemCreateUpdate(item); + remoteClient.SendInventoryItemCreateUpdate(item, 0); itemID = item.ID; return item.AssetID; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 1d2f37a..23c4478 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3581,7 +3581,7 @@ namespace OpenSim.Region.Framework.Scenes item.CreationDate = Util.UnixTimeSinceEpoch(); userInfo.AddItem(item); - remoteClient.SendInventoryItemCreateUpdate(item); + remoteClient.SendInventoryItemCreateUpdate(item, 0); } else { diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index c84ede8..871a581 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -628,7 +628,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } - public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item) + public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackID) { } diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 373ee13..ee4aaa8 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -619,7 +619,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item) + public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackID) { } -- cgit v1.1