diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 87 |
1 files changed, 48 insertions, 39 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 2e13f90..3b1b567 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -282,36 +282,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
282 | return; | 282 | return; |
283 | } | 283 | } |
284 | 284 | ||
285 | m_part.ParentGroup.Scene.AssetService.Get( | 285 | AssetBase asset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); |
286 | item.AssetID.ToString(), this, delegate(string id, object sender, AssetBase asset) | 286 | if (null == asset) |
287 | { | 287 | { |
288 | if (null == asset) | 288 | m_log.ErrorFormat( |
289 | { | 289 | "[PRIM INVENTORY]: " + |
290 | m_log.ErrorFormat( | 290 | "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", |
291 | "[PRIM INVENTORY]: " + | 291 | item.Name, item.ItemID, m_part.AbsolutePosition, |
292 | "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", | 292 | m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); |
293 | item.Name, item.ItemID, m_part.AbsolutePosition, | 293 | } |
294 | m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); | 294 | else |
295 | } | 295 | { |
296 | else | 296 | if (m_part.ParentGroup.m_savedScriptState != null) |
297 | { | 297 | RestoreSavedScriptState(item.OldItemID, item.ItemID); |
298 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
299 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
300 | 298 | ||
301 | lock (m_items) | 299 | lock (m_items) |
302 | { | 300 | { |
303 | m_items[item.ItemID].PermsMask = 0; | 301 | m_items[item.ItemID].PermsMask = 0; |
304 | m_items[item.ItemID].PermsGranter = UUID.Zero; | 302 | m_items[item.ItemID].PermsGranter = UUID.Zero; |
305 | } | ||
306 | |||
307 | string script = Utils.BytesToString(asset.Data); | ||
308 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
309 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
310 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
311 | m_part.ScheduleFullUpdate(); | ||
312 | } | ||
313 | } | 303 | } |
314 | ); | 304 | |
305 | string script = Utils.BytesToString(asset.Data); | ||
306 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
307 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
308 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
309 | m_part.ScheduleFullUpdate(); | ||
310 | } | ||
315 | } | 311 | } |
316 | } | 312 | } |
317 | 313 | ||
@@ -630,16 +626,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
630 | { | 626 | { |
631 | item.AssetID = m_items[item.ItemID].AssetID; | 627 | item.AssetID = m_items[item.ItemID].AssetID; |
632 | } | 628 | } |
633 | else if ((InventoryType)item.Type == InventoryType.Notecard) | ||
634 | { | ||
635 | ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); | ||
636 | |||
637 | if (presence != null) | ||
638 | { | ||
639 | presence.ControllingClient.SendAgentAlertMessage( | ||
640 | "Notecard saved", false); | ||
641 | } | ||
642 | } | ||
643 | 629 | ||
644 | m_items[item.ItemID] = item; | 630 | m_items[item.ItemID] = item; |
645 | m_inventorySerial++; | 631 | m_inventorySerial++; |
@@ -1042,5 +1028,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
1042 | 1028 | ||
1043 | return ret; | 1029 | return ret; |
1044 | } | 1030 | } |
1031 | |||
1032 | public void ResumeScripts() | ||
1033 | { | ||
1034 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
1035 | if (engines == null) | ||
1036 | return; | ||
1037 | |||
1038 | |||
1039 | lock (m_items) | ||
1040 | { | ||
1041 | foreach (TaskInventoryItem item in m_items.Values) | ||
1042 | { | ||
1043 | if (item.InvType == (int)InventoryType.LSL) | ||
1044 | { | ||
1045 | foreach (IScriptModule engine in engines) | ||
1046 | { | ||
1047 | if (engine != null) | ||
1048 | engine.ResumeScript(item.ItemID); | ||
1049 | } | ||
1050 | } | ||
1051 | } | ||
1052 | } | ||
1053 | } | ||
1045 | } | 1054 | } |
1046 | } \ No newline at end of file | 1055 | } |