aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-01-07 22:11:26 +0000
committerJustin Clarke Casey2008-01-07 22:11:26 +0000
commit348b79d801a44086413fcf4a781ffa8c4f4b36b6 (patch)
tree6384f92a4e7eb0606fe9af1d322b20edfcecdf6b /OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
parent* Added Tribal Media to CONTRIBUTORS.txt (diff)
downloadopensim-SC_OLD-348b79d801a44086413fcf4a781ffa8c4f4b36b6.zip
opensim-SC_OLD-348b79d801a44086413fcf4a781ffa8c4f4b36b6.tar.gz
opensim-SC_OLD-348b79d801a44086413fcf4a781ffa8c4f4b36b6.tar.bz2
opensim-SC_OLD-348b79d801a44086413fcf4a781ffa8c4f4b36b6.tar.xz
Trigger persistence of the scripts in a prim's inventory when that inventory is changed/updated/deleted (before the trigger only happened if the prim was moved).
This is still development code - experimental prim inventory persistence cannot yet be enabled by users.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs30
1 files changed, 28 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 1d382fa..fb09932 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -124,6 +124,14 @@ namespace OpenSim.Region.Environment.Scenes
124 taskItem.type = TaskInventoryItem.Types[item.assetType]; 124 taskItem.type = TaskInventoryItem.Types[item.assetType];
125 taskItem.inv_type = TaskInventoryItem.Types[item.invType]; 125 taskItem.inv_type = TaskInventoryItem.Types[item.invType];
126 part.AddInventoryItem(taskItem); 126 part.AddInventoryItem(taskItem);
127
128 // It might seem somewhat crude to update the whole group for a single prim inventory change,
129 // but it's possible that other prim inventory changes will take place before the region
130 // persistence thread visits this object. In the future, changes can be signalled at a more
131 // granular level, or we could let the datastore worry about whether prims have really
132 // changed since they were last persisted.
133 HasChanged = true;
134
127 return true; 135 return true;
128 } 136 }
129 return false; 137 return false;
@@ -146,6 +154,14 @@ namespace OpenSim.Region.Environment.Scenes
146 taskItem.type = TaskInventoryItem.Types[item.assetType]; 154 taskItem.type = TaskInventoryItem.Types[item.assetType];
147 taskItem.inv_type = TaskInventoryItem.InvTypes[item.invType]; 155 taskItem.inv_type = TaskInventoryItem.InvTypes[item.invType];
148 part.AddInventoryItem(taskItem); 156 part.AddInventoryItem(taskItem);
157
158 // It might seem somewhat crude to update the whole group for a single prim inventory change,
159 // but it's possible that other prim inventory changes will take place before the region
160 // persistence thread visits this object. In the future, changes can be signalled at a more
161 // granular level, or we could let the datastore worry about whether prims have really
162 // changed since they were last persisted.
163 HasChanged = true;
164
149 return true; 165 return true;
150 } 166 }
151 } 167 }
@@ -160,9 +176,19 @@ namespace OpenSim.Region.Environment.Scenes
160 { 176 {
161 SceneObjectPart part = GetChildPart(localID); 177 SceneObjectPart part = GetChildPart(localID);
162 if (part != null) 178 if (part != null)
163 { 179 {
164 return part.RemoveInventoryItem(remoteClient, localID, itemID); 180 int type = part.RemoveInventoryItem(remoteClient, localID, itemID);
181
182 // It might seem somewhat crude to update the whole group for a single prim inventory change,
183 // but it's possible that other prim inventory changes will take place before the region
184 // persistence thread visits this object. In the future, changes can be signalled at a more
185 // granular level, or we could let the datastore worry about whether prims have really
186 // changed since they were last persisted.
187 HasChanged = true;
188
189 return type;
165 } 190 }
191
166 return -1; 192 return -1;
167 } 193 }
168 } 194 }