From 1a33582c05cdbec32d925ff214b50997ecce51a6 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 29 Aug 2007 15:32:48 +0000 Subject: Attempt to cut down how often objects are backed up to the database. --- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 14 ++++++++++++-- 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 public event PrimCountTaintedDelegate OnPrimCountTainted; + public bool HasChanged = false; + #region Properties /// /// @@ -339,6 +341,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void ScheduleGroupForFullUpdate() { + HasChanged = true; foreach (SceneObjectPart part in this.m_parts.Values) { part.ScheduleFullUpdate(); @@ -350,6 +353,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void ScheduleGroupForTerseUpdate() { + HasChanged = true; foreach (SceneObjectPart part in this.m_parts.Values) { part.ScheduleTerseUpdate(); @@ -361,6 +365,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendGroupFullUpdate() { + HasChanged = true; foreach (SceneObjectPart part in this.m_parts.Values) { part.SendFullUpdateToAllClients(); @@ -372,6 +377,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendGroupTerseUpdate() { + HasChanged = true; foreach (SceneObjectPart part in this.m_parts.Values) { part.SendTerseUpdateToAllClients(); @@ -642,7 +648,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public string RequestInventoryFile(uint localID, ModuleAPIMethod addXferFile) + public string RequestInventoryFile(uint localID, ModuleAPIMethod2 addXferFile) { SceneObjectPart part = this.GetChildPart(localID); if (part != null) @@ -969,7 +975,11 @@ namespace OpenSim.Region.Environment.Scenes /// public void ProcessBackup(OpenSim.Region.Environment.Interfaces.IRegionDataStore datastore) { - datastore.StoreObject(this, m_scene.RegionInfo.SimUUID); + if (HasChanged) + { + datastore.StoreObject(this, m_scene.RegionInfo.SimUUID); + HasChanged = false; + } } #endregion 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 /// public void ScheduleFullUpdate() { + m_parentGroup.HasChanged = true; m_updateFlag = 2; } @@ -373,6 +374,7 @@ namespace OpenSim.Region.Environment.Scenes { if (m_updateFlag < 1) { + m_parentGroup.HasChanged = true; m_updateFlag = 1; } } @@ -482,7 +484,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public string RequestInventoryFile(ModuleAPIMethod addXferFile) + public string RequestInventoryFile(ModuleAPIMethod2 addXferFile) { byte[] fileData = new byte[0]; InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, this.UUID); -- cgit v1.1