aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-01-21 15:06:49 +0000
committerJustin Clarke Casey2008-01-21 15:06:49 +0000
commit504ae63669e5c57cd89e8213b853c27506012f79 (patch)
tree0d12e5baa7b7e5ec29676398629e56f3c93b98d5 /OpenSim
parentSmall bug in ResetScript (diff)
downloadopensim-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')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLDataStore.cs162
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs19
-rw-r--r--OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs20
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs23
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs26
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs6
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs7
8 files changed, 141 insertions, 131 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
index a314d2e..698569a 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
@@ -156,9 +156,9 @@ namespace OpenSim.Framework.Data.MySQL
156 // MainLog.Instance.Verbose("DATASTORE", "Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID); 156 // MainLog.Instance.Verbose("DATASTORE", "Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID);
157 } 157 }
158 } 158 }
159 }
159 160
160 Commit(); 161 Commit();
161 }
162 } 162 }
163 163
164 public void RemoveObject(LLUUID obj, LLUUID regionUUID) 164 public void RemoveObject(LLUUID obj, LLUUID regionUUID)
@@ -198,9 +198,9 @@ namespace OpenSim.Framework.Data.MySQL
198 // Remove prim row 198 // Remove prim row
199 row.Delete(); 199 row.Delete();
200 } 200 }
201 }
201 202
202 Commit(); 203 Commit();
203 }
204 } 204 }
205 205
206 /// <summary> 206 /// <summary>
@@ -215,84 +215,77 @@ namespace OpenSim.Framework.Data.MySQL
215 DataTable prims = m_primTable; 215 DataTable prims = m_primTable;
216 DataTable shapes = m_shapeTable; 216 DataTable shapes = m_shapeTable;
217 217
218 try 218 string byRegion = "RegionUUID = '" + Util.ToRawUuidString(regionUUID) + "'";
219 string orderByParent = "ParentID ASC";
220
221 lock (m_dataSet)
219 { 222 {
220 string byRegion = "RegionUUID = '" + Util.ToRawUuidString(regionUUID) + "'"; 223 DataRow[] primsForRegion = prims.Select(byRegion, orderByParent);
221 string orderByParent = "ParentID ASC"; 224 MainLog.Instance.Verbose("DATASTORE",
225 "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
222 226
223 lock (m_dataSet) 227 foreach (DataRow primRow in primsForRegion)
224 { 228 {
225 DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); 229 try
226 MainLog.Instance.Verbose("DATASTORE",
227 "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
228
229 foreach (DataRow primRow in primsForRegion)
230 { 230 {
231 try 231 string uuid = (string) primRow["UUID"];
232 string objID = (string) primRow["SceneGroupID"];
233
234 SceneObjectPart prim = buildPrim(primRow);
235
236 if (uuid == objID) //is new SceneObjectGroup ?
232 { 237 {
233 string uuid = (string)primRow["UUID"]; 238 SceneObjectGroup group = new SceneObjectGroup();
234 string objID = (string)primRow["SceneGroupID"]; 239
235 240 DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID));
236 SceneObjectPart prim = buildPrim(primRow); 241 if (shapeRow != null)
237
238 if (uuid == objID) //is new SceneObjectGroup ?
239 { 242 {
240 SceneObjectGroup group = new SceneObjectGroup(); 243 prim.Shape = buildShape(shapeRow);
241
242 DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID));
243 if (shapeRow != null)
244 {
245 prim.Shape = buildShape(shapeRow);
246 }
247 else
248 {
249 MainLog.Instance.Notice(
250 "No shape found for prim in storage, so setting default box shape");
251 prim.Shape = PrimitiveBaseShape.Default;
252 }
253 group.AddPart(prim);
254 group.RootPart = prim;
255
256 createdObjects.Add(group.UUID, group);
257 retvals.Add(group);
258 } 244 }
259 else 245 else
260 { 246 {
261 DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID)); 247 MainLog.Instance.Notice(
262 if (shapeRow != null) 248 "No shape found for prim in storage, so setting default box shape");
263 { 249 prim.Shape = PrimitiveBaseShape.Default;
264 prim.Shape = buildShape(shapeRow);
265 }
266 else
267 {
268 MainLog.Instance.Notice(
269 "No shape found for prim in storage, so setting default box shape");
270 prim.Shape = PrimitiveBaseShape.Default;
271 }
272 createdObjects[new LLUUID(objID)].AddPart(prim);
273 } 250 }
251 group.AddPart(prim);
252 group.RootPart = prim;
274 253
275 if (persistPrimInventories) 254 createdObjects.Add(group.UUID, group);
276 { 255 retvals.Add(group);
277 LoadItems(prim);
278 }
279 } 256 }
280 catch (Exception e) 257 else
281 { 258 {
282 MainLog.Instance.Error("DATASTORE", "Failed create prim object, exception and data follows"); 259 DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID));
283 MainLog.Instance.Verbose("DATASTORE", e.ToString()); 260 if (shapeRow != null)
284 foreach (DataColumn col in prims.Columns)
285 { 261 {
286 MainLog.Instance.Verbose("DATASTORE", "Col: " + col.ColumnName + " => " + primRow[col]); 262 prim.Shape = buildShape(shapeRow);
287 } 263 }
264 else
265 {
266 MainLog.Instance.Notice(
267 "No shape found for prim in storage, so setting default box shape");
268 prim.Shape = PrimitiveBaseShape.Default;
269 }
270 createdObjects[new LLUUID(objID)].AddPart(prim);
271 }
272
273 if (persistPrimInventories)
274 {
275 LoadItems(prim);
276 }
277 }
278 catch (Exception e)
279 {
280 MainLog.Instance.Error("DATASTORE", "Failed create prim object, exception and data follows");
281 MainLog.Instance.Verbose("DATASTORE", e.ToString());
282 foreach (DataColumn col in prims.Columns)
283 {
284 MainLog.Instance.Verbose("DATASTORE", "Col: " + col.ColumnName + " => " + primRow[col]);
288 } 285 }
289 } 286 }
290 } 287 }
291 } 288 }
292 catch (Exception ex)
293 {
294 MainLog.Instance.Error("DATASTORE", "Exception trying to load prim objects for region " + regionUUID + ": " + ex.ToString());
295 }
296 return retvals; 289 return retvals;
297 } 290 }
298 291
@@ -416,8 +409,6 @@ namespace OpenSim.Framework.Data.MySQL
416 409
417 public void StoreLandObject(Land parcel, LLUUID regionUUID) 410 public void StoreLandObject(Land parcel, LLUUID regionUUID)
418 { 411 {
419 MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))");
420 System.Threading.Thread.Sleep(3000);
421 lock (m_dataSet) 412 lock (m_dataSet)
422 { 413 {
423 DataTable land = m_landTable; 414 DataTable land = m_landTable;
@@ -449,9 +440,9 @@ namespace OpenSim.Framework.Data.MySQL
449 fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); 440 fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID);
450 landaccesslist.Rows.Add(newAccessRow); 441 landaccesslist.Rows.Add(newAccessRow);
451 } 442 }
443 }
452 444
453 Commit(); 445 Commit();
454 }
455 } 446 }
456 447
457 public List<LandData> LoadLandObjects(LLUUID regionUUID) 448 public List<LandData> LoadLandObjects(LLUUID regionUUID)
@@ -519,6 +510,8 @@ namespace OpenSim.Framework.Data.MySQL
519 m_connection.Open(); 510 m_connection.Open();
520 } 511 }
521 512
513 lock (m_dataSet)
514 {
522 // DisplayDataSet(m_dataSet, "Region DataSet"); 515 // DisplayDataSet(m_dataSet, "Region DataSet");
523 516
524 m_primDataAdapter.Update(m_primTable); 517 m_primDataAdapter.Update(m_primTable);
@@ -528,20 +521,18 @@ namespace OpenSim.Framework.Data.MySQL
528 { 521 {
529 m_itemsDataAdapter.Update(m_itemsTable); 522 m_itemsDataAdapter.Update(m_itemsTable);
530 } 523 }
531 524
532 m_terrainDataAdapter.Update(m_terrainTable); 525 m_terrainDataAdapter.Update(m_terrainTable);
533 m_landDataAdapter.Update(m_landTable); 526 m_landDataAdapter.Update(m_landTable);
534 m_landAccessListDataAdapter.Update(m_landAccessListTable); 527 m_landAccessListDataAdapter.Update(m_landAccessListTable);
535 528
536 m_dataSet.AcceptChanges(); 529 m_dataSet.AcceptChanges();
530 }
537 } 531 }
538 532
539 public void Shutdown() 533 public void Shutdown()
540 { 534 {
541 lock (m_dataSet) 535 Commit();
542 {
543 Commit();
544 }
545 } 536 }
546 537
547 /*********************************************************************** 538 /***********************************************************************
@@ -1201,23 +1192,16 @@ namespace OpenSim.Framework.Data.MySQL
1201 else 1192 else
1202 { 1193 {
1203 fillShapeRow(shapeRow, prim); 1194 fillShapeRow(shapeRow, prim);
1204 } 1195 }
1205
1206 if (persistPrimInventories)
1207 {
1208 addPrimInventory(prim.UUID, prim.TaskInventory);
1209 }
1210 } 1196 }
1211 1197
1212 /// <summary> 1198 // see IRegionDatastore
1213 /// Persist prim inventory. Deletes, updates and inserts rows. 1199 public void StorePrimInventory(LLUUID primID, IDictionary<LLUUID, TaskInventoryItem> items)
1214 /// </summary>
1215 /// <param name="primID"></param>
1216 /// <param name="items"></param>
1217 /// <returns></returns>
1218 private void addPrimInventory(LLUUID primID, IDictionary<LLUUID, TaskInventoryItem> items)
1219 { 1200 {
1220 MainLog.Instance.Verbose("DATASTORE", "Entered addPrimInventory with prim ID {0}", primID); 1201 if (!persistPrimInventories)
1202 return;
1203
1204 MainLog.Instance.Verbose("DATASTORE", "Entered StorePrimInventory with prim ID {0}", primID);
1221 1205
1222 // Find all existing inventory rows for this prim 1206 // Find all existing inventory rows for this prim
1223 DataTable dbItems = m_itemsTable; 1207 DataTable dbItems = m_itemsTable;
@@ -1585,12 +1569,10 @@ namespace OpenSim.Framework.Data.MySQL
1585 { 1569 {
1586 pDa.Fill(tmpDS, "prims"); 1570 pDa.Fill(tmpDS, "prims");
1587 sDa.Fill(tmpDS, "primshapes"); 1571 sDa.Fill(tmpDS, "primshapes");
1588 1572
1589 if (persistPrimInventories) 1573 if (persistPrimInventories)
1590 {
1591 iDa.Fill(tmpDS, "primitems"); 1574 iDa.Fill(tmpDS, "primitems");
1592 } 1575
1593
1594 tDa.Fill(tmpDS, "terrain"); 1576 tDa.Fill(tmpDS, "terrain");
1595 lDa.Fill(tmpDS, "land"); 1577 lDa.Fill(tmpDS, "land");
1596 lalDa.Fill(tmpDS, "landaccesslist"); 1578 lalDa.Fill(tmpDS, "landaccesslist");
@@ -1603,12 +1585,10 @@ namespace OpenSim.Framework.Data.MySQL
1603 1585
1604 pDa.Fill(tmpDS, "prims"); 1586 pDa.Fill(tmpDS, "prims");
1605 sDa.Fill(tmpDS, "primshapes"); 1587 sDa.Fill(tmpDS, "primshapes");
1606 1588
1607 if (persistPrimInventories) 1589 if (persistPrimInventories)
1608 {
1609 iDa.Fill(tmpDS, "primitems"); 1590 iDa.Fill(tmpDS, "primitems");
1610 } 1591
1611
1612 tDa.Fill(tmpDS, "terrain"); 1592 tDa.Fill(tmpDS, "terrain");
1613 lDa.Fill(tmpDS, "land"); 1593 lDa.Fill(tmpDS, "land");
1614 lalDa.Fill(tmpDS, "landaccesslist"); 1594 lalDa.Fill(tmpDS, "landaccesslist");
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
index 1364d3e..76848cf 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
@@ -1248,22 +1248,15 @@ namespace OpenSim.Framework.Data.SQLite
1248 { 1248 {
1249 fillShapeRow(shapeRow, prim); 1249 fillShapeRow(shapeRow, prim);
1250 } 1250 }
1251
1252 if (persistPrimInventories)
1253 {
1254 addPrimInventory(prim.UUID, prim.TaskInventory);
1255 }
1256 } 1251 }
1257 1252
1258 /// <summary> 1253 // see IRegionDatastore
1259 /// Persist prim inventory. Deletes, updates and inserts rows. 1254 public void StorePrimInventory(LLUUID primID, IDictionary<LLUUID, TaskInventoryItem> items)
1260 /// </summary>
1261 /// <param name="primID"></param>
1262 /// <param name="items"></param>
1263 /// <returns></returns>
1264 private void addPrimInventory(LLUUID primID, IDictionary<LLUUID, TaskInventoryItem> items)
1265 { 1255 {
1266 MainLog.Instance.Verbose("DATASTORE", "Entered addPrimInventory with prim ID {0}", primID); 1256 if (!persistPrimInventories)
1257 return;
1258
1259 MainLog.Instance.Verbose("DATASTORE", "Entered StorePrimInventory with prim ID {0}", primID);
1267 1260
1268 // Find all existing inventory rows for this prim 1261 // Find all existing inventory rows for this prim
1269 DataTable dbItems = ds.Tables["primitems"]; 1262 DataTable dbItems = ds.Tables["primitems"];
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
index 78ad428..47768b7 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -44,8 +44,26 @@ namespace OpenSim.Region.Environment.Interfaces
44 /// <param name="persistPrimInventories">Temporary switch while this option is immature</param> 44 /// <param name="persistPrimInventories">Temporary switch while this option is immature</param>
45 void Initialise(string filename, bool persistPrimInventories); 45 void Initialise(string filename, bool persistPrimInventories);
46 46
47 /// <summary>
48 /// Stores all object's details apart from inventory
49 /// </summary>
50 /// <param name="obj"></param>
51 /// <param name="regionUUID"></param>
47 void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); 52 void StoreObject(SceneObjectGroup obj, LLUUID regionUUID);
53
54 /// <summary>
55 /// Entirely removes the object, including inventory
56 /// </summary>
57 /// <param name="uuid"></param>
58 /// <param name="regionUUID"></param>
59 /// <returns></returns>
48 void RemoveObject(LLUUID uuid, LLUUID regionUUID); 60 void RemoveObject(LLUUID uuid, LLUUID regionUUID);
61
62 /// <summary>
63 /// Store a prim's inventory
64 /// </summary>
65 /// <returns></returns>
66 void StorePrimInventory(LLUUID primID, IDictionary<LLUUID, TaskInventoryItem> items);
49 67
50 List<SceneObjectGroup> LoadObjects(LLUUID regionUUID); 68 List<SceneObjectGroup> LoadObjects(LLUUID regionUUID);
51 69
@@ -58,4 +76,4 @@ namespace OpenSim.Region.Environment.Interfaces
58 76
59 void Shutdown(); 77 void Shutdown();
60 } 78 }
61} \ No newline at end of file 79}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 59ffded..1bddf25 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -179,13 +179,6 @@ namespace OpenSim.Region.Environment.Scenes
179 taskItem.InvType = item.invType; 179 taskItem.InvType = item.invType;
180 part.AddInventoryItem(taskItem); 180 part.AddInventoryItem(taskItem);
181 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 HasGroupChanged = true;
188
189 return true; 182 return true;
190 } 183 }
191 else 184 else
@@ -234,14 +227,7 @@ namespace OpenSim.Region.Environment.Scenes
234 SceneObjectPart part = GetChildPart(item.ParentPartID); 227 SceneObjectPart part = GetChildPart(item.ParentPartID);
235 if (part != null) 228 if (part != null)
236 { 229 {
237 part.UpdateInventoryItem(item); 230 part.UpdateInventoryItem(item);
238
239 // It might seem somewhat crude to update the whole group for a single prim inventory change,
240 // but it's possible that other prim inventory changes will take place before the region
241 // persistence thread visits this object. In the future, changes can be signalled at a more
242 // granular level, or we could let the datastore worry about whether prims have really
243 // changed since they were last persisted.
244 HasGroupChanged = true;
245 231
246 return true; 232 return true;
247 } 233 }
@@ -263,13 +249,6 @@ namespace OpenSim.Region.Environment.Scenes
263 { 249 {
264 int type = part.RemoveInventoryItem(itemID); 250 int type = part.RemoveInventoryItem(itemID);
265 251
266 // It might seem somewhat crude to update the whole group for a single prim inventory change,
267 // but it's possible that other prim inventory changes will take place before the region
268 // persistence thread visits this object. In the future, changes can be signalled at a more
269 // granular level, or we could let the datastore worry about whether prims have really
270 // changed since they were last persisted.
271 HasGroupChanged = true;
272
273 return type; 252 return type;
274 } 253 }
275 254
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index be24f66..12176af 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1492,6 +1492,8 @@ namespace OpenSim.Region.Environment.Scenes
1492 datastore.StoreObject(this, m_scene.RegionInfo.RegionID); 1492 datastore.StoreObject(this, m_scene.RegionInfo.RegionID);
1493 HasGroupChanged = false; 1493 HasGroupChanged = false;
1494 } 1494 }
1495
1496 ForEachPart(delegate(SceneObjectPart part) { part.ProcessInventoryBackup(datastore); });
1495 } 1497 }
1496 1498
1497 #endregion 1499 #endregion
@@ -1704,9 +1706,12 @@ namespace OpenSim.Region.Environment.Scenes
1704 1706
1705 public void ForEachPart(Action<SceneObjectPart> whatToDo) 1707 public void ForEachPart(Action<SceneObjectPart> whatToDo)
1706 { 1708 {
1707 foreach (SceneObjectPart part in m_parts.Values) 1709 lock (m_parts)
1708 { 1710 {
1709 whatToDo(part); 1711 foreach (SceneObjectPart part in m_parts.Values)
1712 {
1713 whatToDo(part);
1714 }
1710 } 1715 }
1711 } 1716 }
1712 } 1717 }
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 {
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
index 7884277..6aeb808 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
@@ -752,6 +752,12 @@ namespace OpenSim.DataStore.MSSQL
752 fillShapeRow(shapeRow, prim); 752 fillShapeRow(shapeRow, prim);
753 } 753 }
754 } 754 }
755
756 // see IRegionDatastore
757 public void StorePrimInventory(LLUUID primID, IDictionary<LLUUID, TaskInventoryItem> items)
758 {
759 // No implementation yet
760 }
755 761
756 /*********************************************************************** 762 /***********************************************************************
757 * 763 *
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
index 035c3ba..8039e51 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
@@ -49,6 +49,11 @@ namespace OpenSim.DataStore.NullStorage
49 public void RemoveObject(LLUUID obj, LLUUID regionUUID) 49 public void RemoveObject(LLUUID obj, LLUUID regionUUID)
50 { 50 {
51 } 51 }
52
53 // see IRegionDatastore
54 public void StorePrimInventory(LLUUID primID, IDictionary<LLUUID, TaskInventoryItem> items)
55 {
56 }
52 57
53 public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID) 58 public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
54 { 59 {
@@ -81,4 +86,4 @@ namespace OpenSim.DataStore.NullStorage
81 { 86 {
82 } 87 }
83 } 88 }
84} \ No newline at end of file 89}