diff options
author | Justin Clarke Casey | 2008-01-21 15:06:49 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-01-21 15:06:49 +0000 |
commit | 504ae63669e5c57cd89e8213b853c27506012f79 (patch) | |
tree | 0d12e5baa7b7e5ec29676398629e56f3c93b98d5 /OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |
parent | Small bug in ResetScript (diff) | |
download | opensim-SC_OLD-504ae63669e5c57cd89e8213b853c27506012f79.zip opensim-SC_OLD-504ae63669e5c57cd89e8213b853c27506012f79.tar.gz opensim-SC_OLD-504ae63669e5c57cd89e8213b853c27506012f79.tar.bz2 opensim-SC_OLD-504ae63669e5c57cd89e8213b853c27506012f79.tar.xz |
* Make object persistence more granular by separating prim and prim inventory persistence
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 1a9e6c4..c0297cf 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |||
@@ -82,6 +82,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
82 | } | 82 | } |
83 | 83 | ||
84 | /// <summary> | 84 | /// <summary> |
85 | /// Tracks whether inventory has changed since the last persistent backup | ||
86 | /// </summary> | ||
87 | private bool HasInventoryChanged; | ||
88 | |||
89 | /// <summary> | ||
85 | /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating | 90 | /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating |
86 | /// new ones or setting existing UUIDs to the correct parent UUIDs | 91 | /// new ones or setting existing UUIDs to the correct parent UUIDs |
87 | /// </summary> | 92 | /// </summary> |
@@ -207,6 +212,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
207 | } | 212 | } |
208 | 213 | ||
209 | m_inventorySerial++; | 214 | m_inventorySerial++; |
215 | HasInventoryChanged = true; | ||
210 | } | 216 | } |
211 | 217 | ||
212 | /// <summary> | 218 | /// <summary> |
@@ -224,7 +230,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
224 | TriggerScriptChangedEvent(Changed.INVENTORY); | 230 | TriggerScriptChangedEvent(Changed.INVENTORY); |
225 | } | 231 | } |
226 | } | 232 | } |
227 | 233 | ||
228 | m_inventorySerial++; | 234 | m_inventorySerial++; |
229 | } | 235 | } |
230 | 236 | ||
@@ -268,6 +274,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
268 | m_taskInventory[item.ItemID] = item; | 274 | m_taskInventory[item.ItemID] = item; |
269 | m_inventorySerial++; | 275 | m_inventorySerial++; |
270 | TriggerScriptChangedEvent(Changed.INVENTORY); | 276 | TriggerScriptChangedEvent(Changed.INVENTORY); |
277 | |||
278 | HasInventoryChanged = true; | ||
271 | 279 | ||
272 | return true; | 280 | return true; |
273 | } | 281 | } |
@@ -300,6 +308,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
300 | m_inventorySerial++; | 308 | m_inventorySerial++; |
301 | TriggerScriptChangedEvent(Changed.INVENTORY); | 309 | TriggerScriptChangedEvent(Changed.INVENTORY); |
302 | 310 | ||
311 | HasInventoryChanged = true; | ||
312 | |||
303 | return type; | 313 | return type; |
304 | } | 314 | } |
305 | else | 315 | else |
@@ -380,6 +390,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
380 | xferManager.AddNewFile(m_inventoryFileName, fileData); | 390 | xferManager.AddNewFile(m_inventoryFileName, fileData); |
381 | } | 391 | } |
382 | } | 392 | } |
393 | |||
394 | /// <summary> | ||
395 | /// Process inventory backup | ||
396 | /// </summary> | ||
397 | /// <param name="datastore"></param> | ||
398 | public void ProcessInventoryBackup(IRegionDataStore datastore) | ||
399 | { | ||
400 | if (HasInventoryChanged) | ||
401 | { | ||
402 | datastore.StorePrimInventory(UUID, TaskInventory); | ||
403 | |||
404 | HasInventoryChanged = false; | ||
405 | } | ||
406 | } | ||
383 | 407 | ||
384 | public class InventoryStringBuilder | 408 | public class InventoryStringBuilder |
385 | { | 409 | { |