aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/EventManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs82
1 files changed, 79 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 57db4d6..9fcd5fe 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -177,6 +177,9 @@ namespace OpenSim.Region.Framework.Scenes
177 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); 177 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
178 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; 178 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
179 179
180 public delegate void AvatarAppearanceChange(ScenePresence avatar);
181 public event AvatarAppearanceChange OnAvatarAppearanceChange;
182
180 public event Action<ScenePresence> OnSignificantClientMovement; 183 public event Action<ScenePresence> OnSignificantClientMovement;
181 184
182 public delegate void IncomingInstantMessage(GridInstantMessage message); 185 public delegate void IncomingInstantMessage(GridInstantMessage message);
@@ -188,10 +191,62 @@ namespace OpenSim.Region.Framework.Scenes
188 191
189 public event ClientClosed OnClientClosed; 192 public event ClientClosed OnClientClosed;
190 193
194 // Fired when a script is created
195 // The indication that a new script exists in this region.
196 public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
197 public event NewScript OnNewScript;
198 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
199 {
200 NewScript handlerNewScript = OnNewScript;
201 if (handlerNewScript != null)
202 {
203 foreach (NewScript d in handlerNewScript.GetInvocationList())
204 {
205 try
206 {
207 d(clientID, part, itemID);
208 }
209 catch (Exception e)
210 {
211 m_log.ErrorFormat(
212 "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}",
213 e.Message, e.StackTrace);
214 }
215 }
216 }
217 }
218
219 //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
220 // An indication that the script has changed.
221 public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
222 public event UpdateScript OnUpdateScript;
223 public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
224 {
225 UpdateScript handlerUpdateScript = OnUpdateScript;
226 if (handlerUpdateScript != null)
227 {
228 foreach (UpdateScript d in handlerUpdateScript.GetInvocationList())
229 {
230 try
231 {
232 d(clientId, itemId, primId, isScriptRunning, newAssetID);
233 }
234 catch (Exception e)
235 {
236 m_log.ErrorFormat(
237 "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}",
238 e.Message, e.StackTrace);
239 }
240 }
241 }
242 }
243
191 /// <summary> 244 /// <summary>
192 /// This is fired when a scene object property that a script might be interested in (such as color, scale or 245 /// ScriptChangedEvent is fired when a scene object property that a script might be interested
193 /// inventory) changes. Only enough information is sent for the LSL changed event 246 /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event.
194 /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed) 247 /// This is not an indication that the script has changed (see OnUpdateScript for that).
248 /// This event is sent to a script to tell it that some property changed on
249 /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed .
195 /// </summary> 250 /// </summary>
196 public event ScriptChangedEvent OnScriptChangedEvent; 251 public event ScriptChangedEvent OnScriptChangedEvent;
197 public delegate void ScriptChangedEvent(uint localID, uint change); 252 public delegate void ScriptChangedEvent(uint localID, uint change);
@@ -1262,6 +1317,27 @@ namespace OpenSim.Region.Framework.Scenes
1262 } 1317 }
1263 } 1318 }
1264 1319
1320 public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
1321 {
1322 AvatarAppearanceChange handler = OnAvatarAppearanceChange;
1323 if (handler != null)
1324 {
1325 foreach (AvatarAppearanceChange d in handler.GetInvocationList())
1326 {
1327 try
1328 {
1329 d(avatar);
1330 }
1331 catch (Exception e)
1332 {
1333 m_log.ErrorFormat(
1334 "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
1335 e.Message, e.StackTrace);
1336 }
1337 }
1338 }
1339 }
1340
1265 public void TriggerIncomingInstantMessage(GridInstantMessage message) 1341 public void TriggerIncomingInstantMessage(GridInstantMessage message)
1266 { 1342 {
1267 IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; 1343 IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;