From 280a5cba8b6ab1566b1f5d2dae96e2f8402c8ab4 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 24 Dec 2007 22:35:01 +0000 Subject: Prim inventory script saving phase 1. Create necessary CAPS structures for correctly accepting prim inventory script updates. No user functionality yet. Refactoring to follow. --- .../Region/Environment/Scenes/Scene.Inventory.cs | 41 +++++++++++++++++++++- OpenSim/Region/Environment/Scenes/Scene.cs | 5 ++- 2 files changed, 44 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 2d0ffd8..531e8de 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -74,6 +74,13 @@ namespace OpenSim.Region.Environment.Scenes return LLUUID.Zero; } + /// + /// Capability originating call to update the asset of an item in an agent's inventory + /// + /// + /// + /// + /// public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); @@ -106,6 +113,39 @@ namespace OpenSim.Region.Environment.Scenes } return LLUUID.Zero; } + + /// + /// Capability originating call to update the asset of a script in a prim's (task's) inventory + /// + /// + /// + /// The prim which contains the item to update + /// Indicates whether the script to update is currently running + /// + /// Asset LLUID created + public LLUUID CapsUpdateTaskInventoryScriptAsset(LLUUID avatarID, LLUUID itemID, + LLUUID primID, bool isScriptRunning, byte[] data) + { + // TODO Not currently doing anything with the isScriptRunning bool + + MainLog.Instance.Verbose( + "PRIMINVENTORY", + "Prim inventory script save functionality not yet implemented." + + " remoteClient: {0}, itemID: {1}, primID: {2}, isScriptRunning: {3}", + avatarID, itemID, primID, isScriptRunning); + + // TODO + // Retrieve client LLUID + // Retrieve sog containing primID + // Retrieve item + // Create new asset and add to cache + // Update item with new asset + // Trigger SOG update (see RezScript) + // Trigger rerunning of script (use TriggerRezScript event, see RezScript) + // return new asset id + + return null; + } /// /// Update an item which is either already in the client's inventory or is within @@ -470,7 +510,6 @@ namespace OpenSim.Region.Environment.Scenes if (rezAsset != null) { string script = Util.FieldToString(rezAsset.Data); - //Console.WriteLine("rez script "+script); EventManager.TriggerRezScript(localID, copyID, script); rezzed = true; } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index cf17686..2a25316 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1350,10 +1350,13 @@ namespace OpenSim.Region.Environment.Scenes agent.CapsPath, agent.AgentID, m_dumpAssetsToFile); Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + - "/CAPS/" + agent.CapsPath + "0000/"); + "/CAPS/" + agent.CapsPath + "0000/"); cap.RegisterHandlers(); + cap.AddNewInventoryItem = AddInventoryItem; cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset; + cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset; + if (m_capsHandlers.ContainsKey(agent.AgentID)) { //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " + -- cgit v1.1