diff options
author | Justin Clark-Casey (justincc) | 2012-02-24 23:35:47 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-24 23:35:59 +0000 |
commit | dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a (patch) | |
tree | 60020a679a229d078ce3be2f933025c81c677d74 /OpenSim/Region/Framework/Scenes/EventManager.cs | |
parent | Amend to last commit: synchronize access to queues. (diff) | |
parent | llGetLinkMedia, llSetLinkMedia, llClearLinkMedia implementation mantis: http:... (diff) | |
download | opensim-SC_OLD-dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a.zip opensim-SC_OLD-dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a.tar.gz opensim-SC_OLD-dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a.tar.bz2 opensim-SC_OLD-dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a.tar.xz |
Merge branch 'master' into 0.7.3-post-fixes
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 82 |
1 files changed, 79 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index d31d380..569c235 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -173,6 +173,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
173 | public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); | 173 | public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); |
174 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; | 174 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; |
175 | 175 | ||
176 | public delegate void AvatarAppearanceChange(ScenePresence avatar); | ||
177 | public event AvatarAppearanceChange OnAvatarAppearanceChange; | ||
178 | |||
176 | public event Action<ScenePresence> OnSignificantClientMovement; | 179 | public event Action<ScenePresence> OnSignificantClientMovement; |
177 | 180 | ||
178 | public delegate void IncomingInstantMessage(GridInstantMessage message); | 181 | public delegate void IncomingInstantMessage(GridInstantMessage message); |
@@ -184,10 +187,62 @@ namespace OpenSim.Region.Framework.Scenes | |||
184 | 187 | ||
185 | public event ClientClosed OnClientClosed; | 188 | public event ClientClosed OnClientClosed; |
186 | 189 | ||
190 | // Fired when a script is created | ||
191 | // The indication that a new script exists in this region. | ||
192 | public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID); | ||
193 | public event NewScript OnNewScript; | ||
194 | public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID) | ||
195 | { | ||
196 | NewScript handlerNewScript = OnNewScript; | ||
197 | if (handlerNewScript != null) | ||
198 | { | ||
199 | foreach (NewScript d in handlerNewScript.GetInvocationList()) | ||
200 | { | ||
201 | try | ||
202 | { | ||
203 | d(clientID, part, itemID); | ||
204 | } | ||
205 | catch (Exception e) | ||
206 | { | ||
207 | m_log.ErrorFormat( | ||
208 | "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}", | ||
209 | e.Message, e.StackTrace); | ||
210 | } | ||
211 | } | ||
212 | } | ||
213 | } | ||
214 | |||
215 | //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset | ||
216 | // An indication that the script has changed. | ||
217 | public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID); | ||
218 | public event UpdateScript OnUpdateScript; | ||
219 | public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID) | ||
220 | { | ||
221 | UpdateScript handlerUpdateScript = OnUpdateScript; | ||
222 | if (handlerUpdateScript != null) | ||
223 | { | ||
224 | foreach (UpdateScript d in handlerUpdateScript.GetInvocationList()) | ||
225 | { | ||
226 | try | ||
227 | { | ||
228 | d(clientId, itemId, primId, isScriptRunning, newAssetID); | ||
229 | } | ||
230 | catch (Exception e) | ||
231 | { | ||
232 | m_log.ErrorFormat( | ||
233 | "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}", | ||
234 | e.Message, e.StackTrace); | ||
235 | } | ||
236 | } | ||
237 | } | ||
238 | } | ||
239 | |||
187 | /// <summary> | 240 | /// <summary> |
188 | /// This is fired when a scene object property that a script might be interested in (such as color, scale or | 241 | /// ScriptChangedEvent is fired when a scene object property that a script might be interested |
189 | /// inventory) changes. Only enough information is sent for the LSL changed event | 242 | /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event. |
190 | /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed) | 243 | /// This is not an indication that the script has changed (see OnUpdateScript for that). |
244 | /// This event is sent to a script to tell it that some property changed on | ||
245 | /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed . | ||
191 | /// </summary> | 246 | /// </summary> |
192 | public event ScriptChangedEvent OnScriptChangedEvent; | 247 | public event ScriptChangedEvent OnScriptChangedEvent; |
193 | public delegate void ScriptChangedEvent(uint localID, uint change); | 248 | public delegate void ScriptChangedEvent(uint localID, uint change); |
@@ -1238,6 +1293,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
1238 | } | 1293 | } |
1239 | } | 1294 | } |
1240 | 1295 | ||
1296 | public void TriggerAvatarAppearanceChanged(ScenePresence avatar) | ||
1297 | { | ||
1298 | AvatarAppearanceChange handler = OnAvatarAppearanceChange; | ||
1299 | if (handler != null) | ||
1300 | { | ||
1301 | foreach (AvatarAppearanceChange d in handler.GetInvocationList()) | ||
1302 | { | ||
1303 | try | ||
1304 | { | ||
1305 | d(avatar); | ||
1306 | } | ||
1307 | catch (Exception e) | ||
1308 | { | ||
1309 | m_log.ErrorFormat( | ||
1310 | "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}", | ||
1311 | e.Message, e.StackTrace); | ||
1312 | } | ||
1313 | } | ||
1314 | } | ||
1315 | } | ||
1316 | |||
1241 | public void TriggerIncomingInstantMessage(GridInstantMessage message) | 1317 | public void TriggerIncomingInstantMessage(GridInstantMessage message) |
1242 | { | 1318 | { |
1243 | IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; | 1319 | IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; |