aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
diff options
context:
space:
mode:
authorMelanie Thielker2010-04-25 22:03:35 +0200
committerMelanie Thielker2010-04-25 22:03:35 +0200
commit81ff5eaba09e7569ef5359874ffcfc7f8855f0b4 (patch)
treeadbc99c0ac713afe3f8eeac686ab7045fc78f7ca /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
parentUse the saved script states (diff)
downloadopensim-SC-81ff5eaba09e7569ef5359874ffcfc7f8855f0b4.zip
opensim-SC-81ff5eaba09e7569ef5359874ffcfc7f8855f0b4.tar.gz
opensim-SC-81ff5eaba09e7569ef5359874ffcfc7f8855f0b4.tar.bz2
opensim-SC-81ff5eaba09e7569ef5359874ffcfc7f8855f0b4.tar.xz
Make scripted attachment states work. Finally. Also replace two monitor locks
with RWLocks, hunting the 10^3 bug. Not successful, but needed to be done anyway
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs41
1 files changed, 28 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 04df35a..f875224 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -311,11 +311,12 @@ namespace OpenSim.Region.Framework.Scenes
311 if (m_part.ParentGroup.m_savedScriptState != null) 311 if (m_part.ParentGroup.m_savedScriptState != null)
312 RestoreSavedScriptState(item.OldItemID, item.ItemID); 312 RestoreSavedScriptState(item.OldItemID, item.ItemID);
313 313
314 lock (m_items) 314 m_items.LockItemsForWrite(true);
315 { 315
316 m_items[item.ItemID].PermsMask = 0; 316 m_items[item.ItemID].PermsMask = 0;
317 m_items[item.ItemID].PermsGranter = UUID.Zero; 317 m_items[item.ItemID].PermsGranter = UUID.Zero;
318 } 318
319 m_items.LockItemsForWrite(false);
319 320
320 string script = Utils.BytesToString(asset.Data); 321 string script = Utils.BytesToString(asset.Data);
321 m_part.ParentGroup.Scene.EventManager.TriggerRezScript( 322 m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
@@ -713,15 +714,16 @@ namespace OpenSim.Region.Framework.Scenes
713 { 714 {
714 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(); 715 IList<TaskInventoryItem> items = new List<TaskInventoryItem>();
715 716
716 lock (m_items) 717 m_items.LockItemsForRead(true);
718
719 foreach (TaskInventoryItem item in m_items.Values)
717 { 720 {
718 foreach (TaskInventoryItem item in m_items.Values) 721 if (item.Name == name)
719 { 722 items.Add(item);
720 if (item.Name == name)
721 items.Add(item);
722 }
723 } 723 }
724 724
725 m_items.LockItemsForRead(false);
726
725 return items; 727 return items;
726 } 728 }
727 729
@@ -1115,6 +1117,11 @@ namespace OpenSim.Region.Framework.Scenes
1115 1117
1116 public Dictionary<UUID, string> GetScriptStates() 1118 public Dictionary<UUID, string> GetScriptStates()
1117 { 1119 {
1120 return GetScriptStates(false);
1121 }
1122
1123 public Dictionary<UUID, string> GetScriptStates(bool oldIDs)
1124 {
1118 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 1125 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
1119 1126
1120 Dictionary<UUID, string> ret = new Dictionary<UUID, string>(); 1127 Dictionary<UUID, string> ret = new Dictionary<UUID, string>();
@@ -1132,8 +1139,16 @@ namespace OpenSim.Region.Framework.Scenes
1132 string n = e.GetXMLState(item.ItemID); 1139 string n = e.GetXMLState(item.ItemID);
1133 if (n != String.Empty) 1140 if (n != String.Empty)
1134 { 1141 {
1135 if (!ret.ContainsKey(item.ItemID)) 1142 if (oldIDs)
1136 ret[item.ItemID] = n; 1143 {
1144 if (!ret.ContainsKey(item.OldItemID))
1145 ret[item.OldItemID] = n;
1146 }
1147 else
1148 {
1149 if (!ret.ContainsKey(item.ItemID))
1150 ret[item.ItemID] = n;
1151 }
1137 break; 1152 break;
1138 } 1153 }
1139 } 1154 }