aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorCharles Krinke2008-06-04 14:31:36 +0000
committerCharles Krinke2008-06-04 14:31:36 +0000
commitd635b526e5997a66f3a54134230289cb248a9cee (patch)
tree46851f7e5f85f8831c1b8c59b0e007c2b75e39d0 /OpenSim/Region/Environment
parent* fleshing out XMPP entities, adding XmppWriter and XmppSerializer (diff)
downloadopensim-SC-d635b526e5997a66f3a54134230289cb248a9cee.zip
opensim-SC-d635b526e5997a66f3a54134230289cb248a9cee.tar.gz
opensim-SC-d635b526e5997a66f3a54134230289cb248a9cee.tar.bz2
opensim-SC-d635b526e5997a66f3a54134230289cb248a9cee.tar.xz
Mantis#1439. Thank you kindly, Melanie for a patch that
plumbs in the events for on_rez.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/EventManager.cs13
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs15
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs24
4 files changed, 53 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs
index ea44f9a..eee4e4a 100644
--- a/OpenSim/Region/Environment/Scenes/EventManager.cs
+++ b/OpenSim/Region/Environment/Scenes/EventManager.cs
@@ -96,9 +96,12 @@ namespace OpenSim.Region.Environment.Scenes
96 public event OnPermissionErrorDelegate OnPermissionError; 96 public event OnPermissionErrorDelegate OnPermissionError;
97 97
98 public delegate void NewRezScript(uint localID, LLUUID itemID, string script); 98 public delegate void NewRezScript(uint localID, LLUUID itemID, string script);
99 public delegate void RezEvent(uint localID, LLUUID itemID, int param);
99 100
100 public event NewRezScript OnRezScript; 101 public event NewRezScript OnRezScript;
101 102
103 public event RezEvent OnRezEvent;
104
102 public delegate void RemoveScript(uint localID, LLUUID itemID); 105 public delegate void RemoveScript(uint localID, LLUUID itemID);
103 106
104 public event RemoveScript OnRemoveScript; 107 public event RemoveScript OnRemoveScript;
@@ -319,6 +322,7 @@ namespace OpenSim.Region.Environment.Scenes
319 private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab; 322 private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab;
320 private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset 323 private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset
321 private NewRezScript handlerRezScript = null; //OnRezScript; 324 private NewRezScript handlerRezScript = null; //OnRezScript;
325 private RezEvent handlerOnRezEvent = null; //OnRezEvent;
322 private RemoveScript handlerRemoveScript = null; //OnRemoveScript; 326 private RemoveScript handlerRemoveScript = null; //OnRemoveScript;
323 private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove; 327 private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove;
324 private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab; 328 private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab;
@@ -513,6 +517,15 @@ namespace OpenSim.Region.Environment.Scenes
513 } 517 }
514 } 518 }
515 519
520 public void TriggerOnRezEvent(uint localID, LLUUID itemID, int param)
521 {
522 handlerOnRezEvent = OnRezEvent;
523 if (handlerOnRezEvent != null)
524 {
525 handlerOnRezEvent(localID, itemID, param);
526 }
527 }
528
516 public void TriggerRemoveScript(uint localID, LLUUID itemID) 529 public void TriggerRemoveScript(uint localID, LLUUID itemID)
517 { 530 {
518 handlerRemoveScript = OnRemoveScript; 531 handlerRemoveScript = OnRemoveScript;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 306998e..c816e41 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes
1673 group.UpdateGroupRotation(rot); 1673 group.UpdateGroupRotation(rot);
1674 group.ApplyPhysics(m_physicalPrim); 1674 group.ApplyPhysics(m_physicalPrim);
1675 group.Velocity = vel; 1675 group.Velocity = vel;
1676 group.StartScripts(); 1676 group.StartScripts(param);
1677 rootPart.ScheduleFullUpdate(); 1677 rootPart.ScheduleFullUpdate();
1678 return rootPart.ParentGroup; 1678 return rootPart.ParentGroup;
1679 } 1679 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index c49970f..3e84af0 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -98,6 +98,21 @@ namespace OpenSim.Region.Environment.Scenes
98 } 98 }
99 } 99 }
100 100
101 /// <summary>
102 /// Start the scripts contained in all the prims in this group.
103 /// </summary>
104 public void StartScripts(int param)
105 {
106 // Don't start scripts if they're turned off in the region!
107 if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
108 {
109 foreach (SceneObjectPart part in m_parts.Values)
110 {
111 part.StartScripts(param);
112 }
113 }
114 }
115
101 public void StopScripts() 116 public void StopScripts()
102 { 117 {
103 lock (m_parts) 118 lock (m_parts)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index a1d087e..5ef9c79 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -153,6 +153,24 @@ namespace OpenSim.Region.Environment.Scenes
153 } 153 }
154 154
155 /// <summary> 155 /// <summary>
156 /// Start all the scripts contained in this prim's inventory
157 /// </summary>
158 public void StartScripts(int param)
159 {
160 lock (m_taskInventory)
161 {
162 foreach (TaskInventoryItem item in m_taskInventory.Values)
163 {
164 // XXX more hardcoding badness. Should be an enum in TaskInventoryItem
165 if (10 == item.Type)
166 {
167 StartScript(item, param);
168 }
169 }
170 }
171 }
172
173 /// <summary>
156 /// Stop all the scripts in this prim. 174 /// Stop all the scripts in this prim.
157 /// </summary> 175 /// </summary>
158 public void StopScripts() 176 public void StopScripts()
@@ -175,6 +193,12 @@ namespace OpenSim.Region.Environment.Scenes
175 /// </summary> 193 /// </summary>
176 /// <param name="item"></param> 194 /// <param name="item"></param>
177 /// <returns></returns> 195 /// <returns></returns>
196 public void StartScript(TaskInventoryItem item, int param)
197 {
198 StartScript(item);
199 m_parentGroup.Scene.EventManager.TriggerOnRezEvent(LocalId, item.ItemID, param);
200 }
201
178 public void StartScript(TaskInventoryItem item) 202 public void StartScript(TaskInventoryItem item)
179 { 203 {
180 // m_log.InfoFormat( 204 // m_log.InfoFormat(