aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorJustin Clarke Casey2007-12-24 22:35:01 +0000
committerJustin Clarke Casey2007-12-24 22:35:01 +0000
commit280a5cba8b6ab1566b1f5d2dae96e2f8402c8ab4 (patch)
tree961f90ecf615e01e2263dacafec293ee66f1f1d0 /OpenSim/Region/Environment/Scenes
parentAgain, great thanks to Alondria for: (diff)
downloadopensim-SC_OLD-280a5cba8b6ab1566b1f5d2dae96e2f8402c8ab4.zip
opensim-SC_OLD-280a5cba8b6ab1566b1f5d2dae96e2f8402c8ab4.tar.gz
opensim-SC_OLD-280a5cba8b6ab1566b1f5d2dae96e2f8402c8ab4.tar.bz2
opensim-SC_OLD-280a5cba8b6ab1566b1f5d2dae96e2f8402c8ab4.tar.xz
Prim inventory script saving phase 1. Create necessary CAPS structures for correctly accepting prim inventory script updates.
No user functionality yet. Refactoring to follow.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs41
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs5
2 files changed, 44 insertions, 2 deletions
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
74 return LLUUID.Zero; 74 return LLUUID.Zero;
75 } 75 }
76 76
77 /// <summary>
78 /// Capability originating call to update the asset of an item in an agent's inventory
79 /// </summary>
80 /// <param name="remoteClient"></param>
81 /// <param name="itemID"></param>
82 /// <param name="data"></param>
83 /// <returns></returns>
77 public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data) 84 public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data)
78 { 85 {
79 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 86 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -106,6 +113,39 @@ namespace OpenSim.Region.Environment.Scenes
106 } 113 }
107 return LLUUID.Zero; 114 return LLUUID.Zero;
108 } 115 }
116
117 /// <summary>
118 /// Capability originating call to update the asset of a script in a prim's (task's) inventory
119 /// </summary>
120 /// <param name="remoteClient"></param>
121 /// <param name="itemID"></param>
122 /// <param name="primID">The prim which contains the item to update</param>
123 /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param>
124 /// <param name="data"></param>
125 /// <returns>Asset LLUID created</returns>
126 public LLUUID CapsUpdateTaskInventoryScriptAsset(LLUUID avatarID, LLUUID itemID,
127 LLUUID primID, bool isScriptRunning, byte[] data)
128 {
129 // TODO Not currently doing anything with the isScriptRunning bool
130
131 MainLog.Instance.Verbose(
132 "PRIMINVENTORY",
133 "Prim inventory script save functionality not yet implemented."
134 + " remoteClient: {0}, itemID: {1}, primID: {2}, isScriptRunning: {3}",
135 avatarID, itemID, primID, isScriptRunning);
136
137 // TODO
138 // Retrieve client LLUID
139 // Retrieve sog containing primID
140 // Retrieve item
141 // Create new asset and add to cache
142 // Update item with new asset
143 // Trigger SOG update (see RezScript)
144 // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
145 // return new asset id
146
147 return null;
148 }
109 149
110 /// <summary> 150 /// <summary>
111 /// Update an item which is either already in the client's inventory or is within 151 /// Update an item which is either already in the client's inventory or is within
@@ -470,7 +510,6 @@ namespace OpenSim.Region.Environment.Scenes
470 if (rezAsset != null) 510 if (rezAsset != null)
471 { 511 {
472 string script = Util.FieldToString(rezAsset.Data); 512 string script = Util.FieldToString(rezAsset.Data);
473 //Console.WriteLine("rez script "+script);
474 EventManager.TriggerRezScript(localID, copyID, script); 513 EventManager.TriggerRezScript(localID, copyID, script);
475 rezzed = true; 514 rezzed = true;
476 } 515 }
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
1350 agent.CapsPath, agent.AgentID, m_dumpAssetsToFile); 1350 agent.CapsPath, agent.AgentID, m_dumpAssetsToFile);
1351 1351
1352 Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + 1352 Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() +
1353 "/CAPS/" + agent.CapsPath + "0000/"); 1353 "/CAPS/" + agent.CapsPath + "0000/");
1354 cap.RegisterHandlers(); 1354 cap.RegisterHandlers();
1355
1355 cap.AddNewInventoryItem = AddInventoryItem; 1356 cap.AddNewInventoryItem = AddInventoryItem;
1356 cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset; 1357 cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
1358 cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
1359
1357 if (m_capsHandlers.ContainsKey(agent.AgentID)) 1360 if (m_capsHandlers.ContainsKey(agent.AgentID))
1358 { 1361 {
1359 //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " + 1362 //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +