Add MaxPrimsUndo config setting to [Startup] section of OpenSim.ini.
This controls how many undo steps the simulator will store for each prim. Default is now 20 rather than 5 as it briefly was. The default number could be increased through this is a memory tradeoff which will scale with the number of prims in the sim and level of activity.0.7.4-post-fixes
parent
cd6f3b147d
commit
05eeee6ee8
|
@ -715,6 +715,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//Animation states
|
//Animation states
|
||||||
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
|
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
|
||||||
|
|
||||||
|
MaxUndoCount = startupConfig.GetInt("MaxPrimUndos", 20);
|
||||||
|
|
||||||
PhysicalPrims = startupConfig.GetBoolean("physical_prim", PhysicalPrims);
|
PhysicalPrims = startupConfig.GetBoolean("physical_prim", PhysicalPrims);
|
||||||
CollidablePrims = startupConfig.GetBoolean("collidable_prim", CollidablePrims);
|
CollidablePrims = startupConfig.GetBoolean("collidable_prim", CollidablePrims);
|
||||||
|
|
||||||
|
@ -888,9 +890,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
WestBorders.Add(westBorder);
|
WestBorders.Add(westBorder);
|
||||||
BordersLocked = false;
|
BordersLocked = false;
|
||||||
|
|
||||||
// TODO: At some point this should be made configurable.
|
|
||||||
MaxUndoCount = 5;
|
|
||||||
|
|
||||||
m_eventManager = new EventManager();
|
m_eventManager = new EventManager();
|
||||||
|
|
||||||
m_permissions = new ScenePermissions(this);
|
m_permissions = new ScenePermissions(this);
|
||||||
|
|
|
@ -1119,14 +1119,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
parts[i].UUID = UUID.Random();
|
parts[i].UUID = UUID.Random();
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper provided for parts.
|
|
||||||
public int GetSceneMaxUndo()
|
|
||||||
{
|
|
||||||
if (m_scene != null)
|
|
||||||
return m_scene.MaxUndoCount;
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
// justincc: I don't believe this hack is needed any longer, especially since the physics
|
// justincc: I don't believe this hack is needed any longer, especially since the physics
|
||||||
// parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false
|
// parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false
|
||||||
// this method was preventing proper reload of scene objects.
|
// this method was preventing proper reload of scene objects.
|
||||||
|
|
|
@ -3189,13 +3189,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
|
// "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
|
||||||
// Name, LocalId, forGroup, m_undo.Count);
|
// Name, LocalId, forGroup, m_undo.Count);
|
||||||
|
|
||||||
if (ParentGroup.GetSceneMaxUndo() > 0)
|
if (ParentGroup.Scene.MaxUndoCount > 0)
|
||||||
{
|
{
|
||||||
UndoState nUndo = new UndoState(this, forGroup);
|
UndoState nUndo = new UndoState(this, forGroup);
|
||||||
|
|
||||||
m_undo.Add(nUndo);
|
m_undo.Add(nUndo);
|
||||||
|
|
||||||
if (m_undo.Count > ParentGroup.GetSceneMaxUndo())
|
if (m_undo.Count > ParentGroup.Scene.MaxUndoCount)
|
||||||
m_undo.RemoveAt(0);
|
m_undo.RemoveAt(0);
|
||||||
|
|
||||||
if (m_redo.Count > 0)
|
if (m_redo.Count > 0)
|
||||||
|
@ -3235,7 +3235,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
UndoState nUndo = null;
|
UndoState nUndo = null;
|
||||||
|
|
||||||
if (ParentGroup.GetSceneMaxUndo() > 0)
|
if (ParentGroup.Scene.MaxUndoCount > 0)
|
||||||
{
|
{
|
||||||
nUndo = new UndoState(this, goback.ForGroup);
|
nUndo = new UndoState(this, goback.ForGroup);
|
||||||
}
|
}
|
||||||
|
@ -3246,7 +3246,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_redo.Add(nUndo);
|
m_redo.Add(nUndo);
|
||||||
|
|
||||||
if (m_redo.Count > ParentGroup.GetSceneMaxUndo())
|
if (m_redo.Count > ParentGroup.Scene.MaxUndoCount)
|
||||||
m_redo.RemoveAt(0);
|
m_redo.RemoveAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3270,13 +3270,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
UndoState gofwd = m_redo[m_redo.Count - 1];
|
UndoState gofwd = m_redo[m_redo.Count - 1];
|
||||||
m_redo.RemoveAt(m_redo.Count - 1);
|
m_redo.RemoveAt(m_redo.Count - 1);
|
||||||
|
|
||||||
if (ParentGroup.GetSceneMaxUndo() > 0)
|
if (ParentGroup.Scene.MaxUndoCount > 0)
|
||||||
{
|
{
|
||||||
UndoState nUndo = new UndoState(this, gofwd.ForGroup);
|
UndoState nUndo = new UndoState(this, gofwd.ForGroup);
|
||||||
|
|
||||||
m_undo.Add(nUndo);
|
m_undo.Add(nUndo);
|
||||||
|
|
||||||
if (m_undo.Count > ParentGroup.GetSceneMaxUndo())
|
if (m_undo.Count > ParentGroup.Scene.MaxUndoCount)
|
||||||
m_undo.RemoveAt(0);
|
m_undo.RemoveAt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
Assert.That(g1Post.RootPart.Scale.X, Is.EqualTo(2));
|
Assert.That(g1Post.RootPart.Scale.X, Is.EqualTo(2));
|
||||||
Assert.That(g1Post.RootPart.Scale.Y, Is.EqualTo(3));
|
Assert.That(g1Post.RootPart.Scale.Y, Is.EqualTo(3));
|
||||||
Assert.That(g1Post.RootPart.Scale.Z, Is.EqualTo(4));
|
Assert.That(g1Post.RootPart.Scale.Z, Is.EqualTo(4));
|
||||||
|
|
||||||
Assert.That(g1Post.RootPart.UndoCount, Is.EqualTo(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
Vector3 secondSize = new Vector3(5, 6, 7);
|
Vector3 secondSize = new Vector3(5, 6, 7);
|
||||||
|
|
||||||
Scene scene = new SceneHelpers().SetupScene();
|
Scene scene = new SceneHelpers().SetupScene();
|
||||||
|
scene.MaxUndoCount = 20;
|
||||||
SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene);
|
SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene);
|
||||||
|
|
||||||
// TODO: It happens to be the case that we are not storing undo states for SOPs which are not yet in a SOG,
|
// TODO: It happens to be the case that we are not storing undo states for SOPs which are not yet in a SOG,
|
||||||
|
@ -113,6 +114,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
Vector3 fourthSize = new Vector3(11, 12, 13);
|
Vector3 fourthSize = new Vector3(11, 12, 13);
|
||||||
|
|
||||||
Scene scene = new SceneHelpers().SetupScene();
|
Scene scene = new SceneHelpers().SetupScene();
|
||||||
|
scene.MaxUndoCount = 20;
|
||||||
SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(1, TestHelpers.ParseTail(0x1));
|
SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(1, TestHelpers.ParseTail(0x1));
|
||||||
|
|
||||||
g1.GroupResize(firstSize);
|
g1.GroupResize(firstSize);
|
||||||
|
@ -133,6 +135,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
Vector3 newSize = new Vector3(2, 3, 4);
|
Vector3 newSize = new Vector3(2, 3, 4);
|
||||||
|
|
||||||
Scene scene = new SceneHelpers().SetupScene();
|
Scene scene = new SceneHelpers().SetupScene();
|
||||||
|
scene.MaxUndoCount = 20;
|
||||||
SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene);
|
SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene);
|
||||||
Vector3 originalSize = g1.GroupScale;
|
Vector3 originalSize = g1.GroupScale;
|
||||||
|
|
||||||
|
@ -160,6 +163,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
Vector3 newSize = new Vector3(2, 3, 4);
|
Vector3 newSize = new Vector3(2, 3, 4);
|
||||||
|
|
||||||
Scene scene = new SceneHelpers().SetupScene();
|
Scene scene = new SceneHelpers().SetupScene();
|
||||||
|
scene.MaxUndoCount = 20;
|
||||||
SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene);
|
SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene);
|
||||||
Vector3 originalSize = g1.GroupScale;
|
Vector3 originalSize = g1.GroupScale;
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,10 @@
|
||||||
;; from the selected region_info_source.
|
;; from the selected region_info_source.
|
||||||
; allow_regionless = false
|
; allow_regionless = false
|
||||||
|
|
||||||
|
;# {MaxPrimUndos} {} {Maximum number of undos avialable for position, rotation and scale changes of each prim} {} 20
|
||||||
|
;; Increasing the number of undos available number will increase memory usage.
|
||||||
|
MaxPrimUndos = 20
|
||||||
|
|
||||||
;# {NonPhysicalPrimMax} {} {Maximum size of nonphysical prims?} {} 256
|
;# {NonPhysicalPrimMax} {} {Maximum size of nonphysical prims?} {} 256
|
||||||
;; Maximum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!).
|
;; Maximum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!).
|
||||||
; NonphysicalPrimMax = 256
|
; NonphysicalPrimMax = 256
|
||||||
|
|
|
@ -85,8 +85,12 @@
|
||||||
;; from the selected region_info_source.
|
;; from the selected region_info_source.
|
||||||
allow_regionless = false
|
allow_regionless = false
|
||||||
|
|
||||||
; Maximum size of non physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!).
|
; Maximum number of position, rotation and scale changes for each prim that the simulator will store for later undos
|
||||||
NonphysicalPrimMax = 256
|
; Increasing this number will increase memory usage.
|
||||||
|
MaxPrimUndos = 20
|
||||||
|
|
||||||
|
; Maximum size of non physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMax!).
|
||||||
|
NonPhysicalPrimMax = 256
|
||||||
|
|
||||||
; Maximum size of physical prims. Affects resizing of existing prims. This can be overriden in the region config file.
|
; Maximum size of physical prims. Affects resizing of existing prims. This can be overriden in the region config file.
|
||||||
PhysicalPrimMax = 10
|
PhysicalPrimMax = 10
|
||||||
|
|
Loading…
Reference in New Issue