From c9b41bdc4ea33452e675a1d12244aab196fcde29 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 27 Jun 2008 14:15:14 +0000 Subject: * Add extra backup parameter to InnerScene.AddRestoredSceneObject() --- .../Modules/World/Serialiser/SceneXmlLoader.cs | 2 +- OpenSim/Region/Environment/Scenes/InnerScene.cs | 8 ++++++-- OpenSim/Region/Environment/Scenes/Scene.cs | 6 +++--- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 18 +++++++++++++----- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 2 ++ 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 1945fac..7b3ce5a 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs @@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectGroup obj = new SceneObjectGroup(xmlData); - scene.AddSceneObjectFromStorage(obj); + scene.AddRestoredSceneObject(obj, true); } public static void SavePrimsToXml2(Scene scene, string fileName) diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 87c4226..c7068fa 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -192,7 +192,11 @@ namespace OpenSim.Region.Environment.Scenes /// Add an object into the scene that has come from storage /// /// - protected internal void AddSceneObjectFromStorage(SceneObjectGroup sceneObject) + /// + /// If true, changes to the object will be reflected in its persisted data + /// If false, the persisted data will not be changed even if the object in the scene is changed + /// + protected internal void AddRestoredSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) { sceneObject.RegionHandle = m_regInfo.RegionHandle; sceneObject.SetScene(m_parentScene); @@ -204,7 +208,7 @@ namespace OpenSim.Region.Environment.Scenes sceneObject.UpdateParentIDs(); - AddSceneObject(sceneObject, true); + AddSceneObject(sceneObject, attachToBackup); } /// diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c7de419..ecb54e6 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1470,7 +1470,7 @@ namespace OpenSim.Region.Environment.Scenes List PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); foreach (SceneObjectGroup group in PrimsFromDB) { - AddSceneObjectFromStorage(group); + AddRestoredSceneObject(group, true); SceneObjectPart rootPart = group.GetChildPart(group.UUID); rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; rootPart.TrimPermissions(); @@ -1651,9 +1651,9 @@ namespace OpenSim.Region.Environment.Scenes /// Add an object into the scene that has come from storage /// /// - public void AddSceneObjectFromStorage(SceneObjectGroup sceneObject) + public void AddRestoredSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) { - m_innerScene.AddSceneObjectFromStorage(sceneObject); + m_innerScene.AddRestoredSceneObject(sceneObject, attachToBackup); } /// diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index b8f52ec..5236014 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -94,6 +94,7 @@ namespace OpenSim.Region.Environment.Scenes /// since the group's last persistent backup /// public bool HasGroupChanged = false; + public float scriptScore = 0f; private LLVector3 lastPhysGroupPos; @@ -1530,7 +1531,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Schedule a full update for every part in this object + /// Schedule a full update for this scene object /// public void ScheduleGroupForFullUpdate() { @@ -1546,7 +1547,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// + /// Schedule a terse update for this scene object /// public void ScheduleGroupForTerseUpdate() { @@ -1562,7 +1563,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// + /// Immediately send a full update for this scene object. /// public void SendGroupFullUpdate() { @@ -1583,7 +1584,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// + /// Immediately send a terse update for this scene object. /// public void SendGroupTerseUpdate() { @@ -2100,7 +2101,7 @@ namespace OpenSim.Region.Environment.Scenes #region Resize /// - /// + /// Resize the given part /// /// /// @@ -2531,6 +2532,12 @@ namespace OpenSim.Region.Environment.Scenes } } } + + /// + /// Set the user group to which this scene object belongs. + /// + /// + /// public void SetGroup(LLUUID GroupID, IClientAPI client) { lock (m_parts) @@ -2540,6 +2547,7 @@ namespace OpenSim.Region.Environment.Scenes part.SetGroup(GroupID, client); } } + ScheduleGroupForFullUpdate(); } } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 6009206..85e098d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -3125,12 +3125,14 @@ namespace OpenSim.Region.Environment.Scenes ParentGroup.RootPart.BaseMask); } + public void SetGroup(LLUUID groupID, IClientAPI client) { GroupID = groupID; GetProperties(client); m_updateFlag = 2; } + private void handleTimerAccounting(uint localID, double interval) { if (localID == LocalId) -- cgit v1.1