diff options
author | Justin Clarke Casey | 2008-07-13 00:18:29 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-13 00:18:29 +0000 |
commit | eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c (patch) | |
tree | e744381547466429d3001955b62dd4f2e28c7983 /OpenSim/Region/Environment/Scenes | |
parent | * Elminate most of the debugging log output from the archive commands (diff) | |
download | opensim-SC-eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c.zip opensim-SC-eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c.tar.gz opensim-SC-eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c.tar.bz2 opensim-SC-eb63b9bbc10ee9d794c273dc01111de8ce8c8a0c.tar.xz |
* Actually persist restored archives to the database - wasn't actually doing this before (doh)
* Not quite perfect yet
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
5 files changed, 55 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index abd3387..7e8259f 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -196,10 +196,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
196 | /// If true, changes to the object will be reflected in its persisted data | 196 | /// If true, changes to the object will be reflected in its persisted data |
197 | /// If false, the persisted data will not be changed even if the object in the scene is changed | 197 | /// If false, the persisted data will not be changed even if the object in the scene is changed |
198 | /// </param> | 198 | /// </param> |
199 | /// <param name="alreadyPersisted"> | ||
200 | /// If true, we won't persist this object until it changes | ||
201 | /// If false, we'll persist this object immediately | ||
202 | /// </param> | ||
199 | /// <returns> | 203 | /// <returns> |
200 | /// true if the object was added, false if an object with the same uuid was already in the scene | 204 | /// true if the object was added, false if an object with the same uuid was already in the scene |
201 | /// </returns> | 205 | /// </returns> |
202 | protected internal bool AddRestoredSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) | 206 | protected internal bool AddRestoredSceneObject( |
207 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | ||
203 | { | 208 | { |
204 | sceneObject.RegionHandle = m_regInfo.RegionHandle; | 209 | sceneObject.RegionHandle = m_regInfo.RegionHandle; |
205 | sceneObject.SetScene(m_parentScene); | 210 | sceneObject.SetScene(m_parentScene); |
@@ -211,6 +216,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
211 | 216 | ||
212 | sceneObject.UpdateParentIDs(); | 217 | sceneObject.UpdateParentIDs(); |
213 | 218 | ||
219 | if (!alreadyPersisted) | ||
220 | { | ||
221 | sceneObject.ForceInventoryPersistence(); | ||
222 | sceneObject.HasGroupChanged = true; | ||
223 | } | ||
224 | |||
214 | return AddSceneObject(sceneObject, attachToBackup); | 225 | return AddSceneObject(sceneObject, attachToBackup); |
215 | } | 226 | } |
216 | 227 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 1564556..fb931f4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1485,7 +1485,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1485 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); | 1485 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); |
1486 | foreach (SceneObjectGroup group in PrimsFromDB) | 1486 | foreach (SceneObjectGroup group in PrimsFromDB) |
1487 | { | 1487 | { |
1488 | AddRestoredSceneObject(group, true); | 1488 | AddRestoredSceneObject(group, true, true); |
1489 | SceneObjectPart rootPart = group.GetChildPart(group.UUID); | 1489 | SceneObjectPart rootPart = group.GetChildPart(group.UUID); |
1490 | rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; | 1490 | rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; |
1491 | rootPart.TrimPermissions(); | 1491 | rootPart.TrimPermissions(); |
@@ -1665,9 +1665,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
1665 | /// Add an object into the scene that has come from storage | 1665 | /// Add an object into the scene that has come from storage |
1666 | /// </summary> | 1666 | /// </summary> |
1667 | /// <param name="sceneObject"></param> | 1667 | /// <param name="sceneObject"></param> |
1668 | public bool AddRestoredSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) | 1668 | /// <param name="attachToBackup"> |
1669 | /// If true, changes to the object will be reflected in its persisted data | ||
1670 | /// If false, the persisted data will not be changed even if the object in the scene is changed | ||
1671 | /// </param> | ||
1672 | /// <param name="alreadyPersisted"> | ||
1673 | /// If true, we won't persist this object until it changes | ||
1674 | /// If false, we'll persist this object immediately | ||
1675 | /// </param> | ||
1676 | /// <returns> | ||
1677 | /// true if the object was added, false if an object with the same uuid was already in the scene | ||
1678 | /// </returns> | ||
1679 | public bool AddRestoredSceneObject( | ||
1680 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | ||
1669 | { | 1681 | { |
1670 | return m_innerScene.AddRestoredSceneObject(sceneObject, attachToBackup); | 1682 | return m_innerScene.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted); |
1671 | } | 1683 | } |
1672 | 1684 | ||
1673 | /// <summary> | 1685 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index 799cb41..8feb852 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -39,6 +39,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | /// <summary> | 41 | /// <summary> |
42 | /// Force all task inventories of prims in the scene object to persist | ||
43 | /// </summary> | ||
44 | public void ForceInventoryPersistence() | ||
45 | { | ||
46 | lock (m_parts) | ||
47 | { | ||
48 | foreach (SceneObjectPart part in m_parts.Values) | ||
49 | { | ||
50 | part.ForceInventoryPersistence(); | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | |||
55 | /// <summary> | ||
42 | /// Start the scripts contained in all the prims in this group. | 56 | /// Start the scripts contained in all the prims in this group. |
43 | /// </summary> | 57 | /// </summary> |
44 | public void CreateScriptInstances(int startParam, bool postOnRez) | 58 | public void CreateScriptInstances(int startParam, bool postOnRez) |
@@ -53,6 +67,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
53 | } | 67 | } |
54 | } | 68 | } |
55 | 69 | ||
70 | /// <summary> | ||
71 | /// Stop the scripts contained in all the prims in this group | ||
72 | /// </summary> | ||
56 | public void RemoveScriptInstances() | 73 | public void RemoveScriptInstances() |
57 | { | 74 | { |
58 | lock (m_parts) | 75 | lock (m_parts) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 1b3d942..86e0caa 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1396,7 +1396,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1396 | } | 1396 | } |
1397 | 1397 | ||
1398 | /// <summary> | 1398 | /// <summary> |
1399 | /// | 1399 | /// Make a copy of the given part. |
1400 | /// </summary> | 1400 | /// </summary> |
1401 | /// <param name="part"></param> | 1401 | /// <param name="part"></param> |
1402 | /// <param name="cAgentID"></param> | 1402 | /// <param name="cAgentID"></param> |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 005d872..d407392 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |||
@@ -58,7 +58,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Tracks whether inventory has changed since the last persistent backup | 59 | /// Tracks whether inventory has changed since the last persistent backup |
60 | /// </summary> | 60 | /// </summary> |
61 | private bool HasInventoryChanged; | 61 | protected bool HasInventoryChanged; |
62 | |||
63 | /// <summary> | ||
64 | /// Force the task inventory of this prim to persist at the next update sweep | ||
65 | /// </summary> | ||
66 | public void ForceInventoryPersistence() | ||
67 | { | ||
68 | HasInventoryChanged = true; | ||
69 | } | ||
62 | 70 | ||
63 | /// <summary> | 71 | /// <summary> |
64 | /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating | 72 | /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating |
@@ -72,9 +80,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
72 | lock (TaskInventory) | 80 | lock (TaskInventory) |
73 | { | 81 | { |
74 | if (0 == TaskInventory.Count) | 82 | if (0 == TaskInventory.Count) |
75 | { | ||
76 | return; | 83 | return; |
77 | } | ||
78 | 84 | ||
79 | HasInventoryChanged = true; | 85 | HasInventoryChanged = true; |
80 | ParentGroup.HasGroupChanged = true; | 86 | ParentGroup.HasGroupChanged = true; |
@@ -597,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
597 | public void ProcessInventoryBackup(IRegionDataStore datastore) | 603 | public void ProcessInventoryBackup(IRegionDataStore datastore) |
598 | { | 604 | { |
599 | if (HasInventoryChanged) | 605 | if (HasInventoryChanged) |
600 | { | 606 | { |
601 | lock (TaskInventory) | 607 | lock (TaskInventory) |
602 | { | 608 | { |
603 | datastore.StorePrimInventory(UUID, TaskInventory.Values); | 609 | datastore.StorePrimInventory(UUID, TaskInventory.Values); |