diff options
author | MW | 2007-08-29 15:32:48 +0000 |
---|---|---|
committer | MW | 2007-08-29 15:32:48 +0000 |
commit | 1a33582c05cdbec32d925ff214b50997ecce51a6 (patch) | |
tree | 68042a209bfc48ce0a491f63b63ed4ef0c181065 /OpenSim | |
parent | Attempt to fix bug on linux where estate_settings.xml gets wiped. (diff) | |
download | opensim-SC_OLD-1a33582c05cdbec32d925ff214b50997ecce51a6.zip opensim-SC_OLD-1a33582c05cdbec32d925ff214b50997ecce51a6.tar.gz opensim-SC_OLD-1a33582c05cdbec32d925ff214b50997ecce51a6.tar.bz2 opensim-SC_OLD-1a33582c05cdbec32d925ff214b50997ecce51a6.tar.xz |
Attempt to cut down how often objects are backed up to the database.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 4 |
2 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 9fa2c6c..eead762 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -27,6 +27,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
27 | 27 | ||
28 | public event PrimCountTaintedDelegate OnPrimCountTainted; | 28 | public event PrimCountTaintedDelegate OnPrimCountTainted; |
29 | 29 | ||
30 | public bool HasChanged = false; | ||
31 | |||
30 | #region Properties | 32 | #region Properties |
31 | /// <summary> | 33 | /// <summary> |
32 | /// | 34 | /// |
@@ -339,6 +341,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
339 | /// </summary> | 341 | /// </summary> |
340 | public void ScheduleGroupForFullUpdate() | 342 | public void ScheduleGroupForFullUpdate() |
341 | { | 343 | { |
344 | HasChanged = true; | ||
342 | foreach (SceneObjectPart part in this.m_parts.Values) | 345 | foreach (SceneObjectPart part in this.m_parts.Values) |
343 | { | 346 | { |
344 | part.ScheduleFullUpdate(); | 347 | part.ScheduleFullUpdate(); |
@@ -350,6 +353,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
350 | /// </summary> | 353 | /// </summary> |
351 | public void ScheduleGroupForTerseUpdate() | 354 | public void ScheduleGroupForTerseUpdate() |
352 | { | 355 | { |
356 | HasChanged = true; | ||
353 | foreach (SceneObjectPart part in this.m_parts.Values) | 357 | foreach (SceneObjectPart part in this.m_parts.Values) |
354 | { | 358 | { |
355 | part.ScheduleTerseUpdate(); | 359 | part.ScheduleTerseUpdate(); |
@@ -361,6 +365,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
361 | /// </summary> | 365 | /// </summary> |
362 | public void SendGroupFullUpdate() | 366 | public void SendGroupFullUpdate() |
363 | { | 367 | { |
368 | HasChanged = true; | ||
364 | foreach (SceneObjectPart part in this.m_parts.Values) | 369 | foreach (SceneObjectPart part in this.m_parts.Values) |
365 | { | 370 | { |
366 | part.SendFullUpdateToAllClients(); | 371 | part.SendFullUpdateToAllClients(); |
@@ -372,6 +377,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
372 | /// </summary> | 377 | /// </summary> |
373 | public void SendGroupTerseUpdate() | 378 | public void SendGroupTerseUpdate() |
374 | { | 379 | { |
380 | HasChanged = true; | ||
375 | foreach (SceneObjectPart part in this.m_parts.Values) | 381 | foreach (SceneObjectPart part in this.m_parts.Values) |
376 | { | 382 | { |
377 | part.SendTerseUpdateToAllClients(); | 383 | part.SendTerseUpdateToAllClients(); |
@@ -642,7 +648,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
642 | return false; | 648 | return false; |
643 | } | 649 | } |
644 | 650 | ||
645 | public string RequestInventoryFile(uint localID, ModuleAPIMethod<bool, string, byte[]> addXferFile) | 651 | public string RequestInventoryFile(uint localID, ModuleAPIMethod2<bool, string, byte[]> addXferFile) |
646 | { | 652 | { |
647 | SceneObjectPart part = this.GetChildPart(localID); | 653 | SceneObjectPart part = this.GetChildPart(localID); |
648 | if (part != null) | 654 | if (part != null) |
@@ -969,7 +975,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
969 | /// <param name="datastore"></param> | 975 | /// <param name="datastore"></param> |
970 | public void ProcessBackup(OpenSim.Region.Environment.Interfaces.IRegionDataStore datastore) | 976 | public void ProcessBackup(OpenSim.Region.Environment.Interfaces.IRegionDataStore datastore) |
971 | { | 977 | { |
972 | datastore.StoreObject(this, m_scene.RegionInfo.SimUUID); | 978 | if (HasChanged) |
979 | { | ||
980 | datastore.StoreObject(this, m_scene.RegionInfo.SimUUID); | ||
981 | HasChanged = false; | ||
982 | } | ||
973 | } | 983 | } |
974 | #endregion | 984 | #endregion |
975 | 985 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 80d702b..cb6355f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -363,6 +363,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
363 | /// </summary> | 363 | /// </summary> |
364 | public void ScheduleFullUpdate() | 364 | public void ScheduleFullUpdate() |
365 | { | 365 | { |
366 | m_parentGroup.HasChanged = true; | ||
366 | m_updateFlag = 2; | 367 | m_updateFlag = 2; |
367 | } | 368 | } |
368 | 369 | ||
@@ -373,6 +374,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
373 | { | 374 | { |
374 | if (m_updateFlag < 1) | 375 | if (m_updateFlag < 1) |
375 | { | 376 | { |
377 | m_parentGroup.HasChanged = true; | ||
376 | m_updateFlag = 1; | 378 | m_updateFlag = 1; |
377 | } | 379 | } |
378 | } | 380 | } |
@@ -482,7 +484,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
482 | return false; | 484 | return false; |
483 | } | 485 | } |
484 | 486 | ||
485 | public string RequestInventoryFile(ModuleAPIMethod<bool, string, byte[]> addXferFile) | 487 | public string RequestInventoryFile(ModuleAPIMethod2<bool, string, byte[]> addXferFile) |
486 | { | 488 | { |
487 | byte[] fileData = new byte[0]; | 489 | byte[] fileData = new byte[0]; |
488 | InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, this.UUID); | 490 | InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, this.UUID); |