aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authorUbitUmarov2012-03-07 07:31:26 +0000
committerUbitUmarov2012-03-07 07:31:26 +0000
commit3d3b81e67698cc361a9eca28083f5f526ff1de2e (patch)
tree22b71ba2e23bcd2297f0f8be7470b76fdd9d08e6 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
parentPrevent scripted region crossings from crashing with prim limits enabled (diff)
downloadopensim-SC-3d3b81e67698cc361a9eca28083f5f526ff1de2e.zip
opensim-SC-3d3b81e67698cc361a9eca28083f5f526ff1de2e.tar.gz
opensim-SC-3d3b81e67698cc361a9eca28083f5f526ff1de2e.tar.bz2
opensim-SC-3d3b81e67698cc361a9eca28083f5f526ff1de2e.tar.xz
changes on undo/redo (untested/incomplete). Think we may consider moving this mfrom SOP to client side. At least does seem to work a bit better ( again there wwas a issue on sop.copy )
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs72
1 files changed, 27 insertions, 45 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 9c06786..8dd2c76 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -263,8 +263,8 @@ namespace OpenSim.Region.Framework.Scenes
263 private bool m_occupied; // KF if any av is sitting on this prim 263 private bool m_occupied; // KF if any av is sitting on this prim
264 private string m_text = String.Empty; 264 private string m_text = String.Empty;
265 private string m_touchName = String.Empty; 265 private string m_touchName = String.Empty;
266 private readonly Stack<UndoState> m_undo = new Stack<UndoState>(5); 266 private Stack<UndoState> m_undo = new Stack<UndoState>(5);
267 private readonly Stack<UndoState> m_redo = new Stack<UndoState>(5); 267 private Stack<UndoState> m_redo = new Stack<UndoState>(5);
268 268
269 private bool m_passTouches; 269 private bool m_passTouches;
270 270
@@ -1711,6 +1711,11 @@ namespace OpenSim.Region.Framework.Scenes
1711 dupe.Category = Category; 1711 dupe.Category = Category;
1712 dupe.m_rezzed = m_rezzed; 1712 dupe.m_rezzed = m_rezzed;
1713 1713
1714 dupe.m_undo = new Stack<UndoState>(5);
1715 dupe.m_redo = new Stack<UndoState>(5);
1716 dupe.IgnoreUndoUpdate = false;
1717 dupe.Undoing = false;
1718
1714 dupe.m_inventory = new SceneObjectPartInventory(dupe); 1719 dupe.m_inventory = new SceneObjectPartInventory(dupe);
1715 dupe.m_inventory.Items = (TaskInventoryDictionary)m_inventory.Items.Clone(); 1720 dupe.m_inventory.Items = (TaskInventoryDictionary)m_inventory.Items.Clone();
1716 1721
@@ -3661,61 +3666,38 @@ namespace OpenSim.Region.Framework.Scenes
3661 3666
3662 public void StoreUndoState(bool forGroup) 3667 public void StoreUndoState(bool forGroup)
3663 { 3668 {
3664 if (!Undoing) 3669 if (!Undoing && !IgnoreUndoUpdate) // just to read better - undo is in progress, or suspended
3665 { 3670 {
3666 if (!IgnoreUndoUpdate) 3671 if (ParentGroup != null)
3667 { 3672 {
3668 if (ParentGroup != null) 3673 lock (m_undo)
3669 { 3674 {
3670 lock (m_undo) 3675 if (m_undo.Count > 0)
3671 { 3676 {
3672 if (m_undo.Count > 0) 3677 // see if we had a change
3673 {
3674 UndoState last = m_undo.Peek();
3675 if (last != null)
3676 {
3677 // TODO: May need to fix for group comparison
3678 if (last.Compare(this))
3679 {
3680 // m_log.DebugFormat(
3681 // "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}",
3682 // Name, LocalId, m_undo.Count);
3683 3678
3684 return; 3679 UndoState last = m_undo.Peek();
3685 } 3680 if (last != null)
3681 {
3682 if (last.Compare(this, forGroup))
3683 {
3684 return;
3686 } 3685 }
3687 } 3686 }
3688 3687 }
3689 // m_log.DebugFormat(
3690 // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
3691 // Name, LocalId, forGroup, m_undo.Count);
3692
3693 if (ParentGroup.GetSceneMaxUndo() > 0)
3694 {
3695 UndoState nUndo = new UndoState(this, forGroup);
3696 3688
3697 m_undo.Push(nUndo); 3689 if (ParentGroup.GetSceneMaxUndo() > 0)
3690 {
3691 UndoState nUndo = new UndoState(this, forGroup);
3698 3692
3699 if (m_redo.Count > 0) 3693 m_undo.Push(nUndo);
3700 m_redo.Clear();
3701 3694
3702 // m_log.DebugFormat( 3695 if (m_redo.Count > 0)
3703 // "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}", 3696 m_redo.Clear();
3704 // Name, LocalId, forGroup, m_undo.Count);
3705 }
3706 } 3697 }
3707 } 3698 }
3708 } 3699 }
3709 // else
3710 // {
3711 // m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
3712 // }
3713 } 3700 }
3714 // else
3715 // {
3716 // m_log.DebugFormat(
3717 // "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
3718 // }
3719 } 3701 }
3720 3702
3721 /// <summary> 3703 /// <summary>
@@ -3751,7 +3733,7 @@ namespace OpenSim.Region.Framework.Scenes
3751 nUndo = new UndoState(this, goback.ForGroup); 3733 nUndo = new UndoState(this, goback.ForGroup);
3752 } 3734 }
3753 3735
3754 goback.PlaybackState(this); 3736 goback.PlayState(this);
3755 3737
3756 if (nUndo != null) 3738 if (nUndo != null)
3757 m_redo.Push(nUndo); 3739 m_redo.Push(nUndo);
@@ -3785,7 +3767,7 @@ namespace OpenSim.Region.Framework.Scenes
3785 m_undo.Push(nUndo); 3767 m_undo.Push(nUndo);
3786 } 3768 }
3787 3769
3788 gofwd.PlayfwdState(this); 3770 gofwd.PlayState(this);
3789 } 3771 }
3790 3772
3791// m_log.DebugFormat( 3773// m_log.DebugFormat(