diff options
10 files changed, 1207 insertions, 386 deletions
diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs index 7d71f18..daf1fb0 100644 --- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs +++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Client.MXP.PacketHandler | |||
55 | private readonly Dictionary<UUID, Scene> m_scenes; | 55 | private readonly Dictionary<UUID, Scene> m_scenes; |
56 | private readonly Transmitter m_transmitter; | 56 | private readonly Transmitter m_transmitter; |
57 | 57 | ||
58 | private readonly Thread m_clientThread; | 58 | // private readonly Thread m_clientThread; |
59 | 59 | ||
60 | private readonly IList<Session> m_sessions = new List<Session>(); | 60 | private readonly IList<Session> m_sessions = new List<Session>(); |
61 | private readonly IList<Session> m_sessionsToClient = new List<Session>(); | 61 | private readonly IList<Session> m_sessionsToClient = new List<Session>(); |
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index 6941e00..13f58bd 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs | |||
@@ -174,18 +174,16 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
174 | { | 174 | { |
175 | m_log.DebugFormat("[LIBRARY MODULE]: Exception when processing archive {0}: {1}", iarFileName, e.Message); | 175 | m_log.DebugFormat("[LIBRARY MODULE]: Exception when processing archive {0}: {1}", iarFileName, e.Message); |
176 | } | 176 | } |
177 | |||
178 | } | 177 | } |
179 | |||
180 | } | ||
181 | |||
182 | private void DumpLibrary() | ||
183 | { | ||
184 | InventoryFolderImpl lib = m_Scene.CommsManager.UserProfileCacheService.LibraryRoot; | ||
185 | |||
186 | m_log.DebugFormat(" - folder {0}", lib.Name); | ||
187 | DumpFolder(lib); | ||
188 | } | 178 | } |
179 | // | ||
180 | // private void DumpLibrary() | ||
181 | // { | ||
182 | // InventoryFolderImpl lib = m_Scene.CommsManager.UserProfileCacheService.LibraryRoot; | ||
183 | // | ||
184 | // m_log.DebugFormat(" - folder {0}", lib.Name); | ||
185 | // DumpFolder(lib); | ||
186 | // } | ||
189 | 187 | ||
190 | private void DumpFolder(InventoryFolderImpl folder) | 188 | private void DumpFolder(InventoryFolderImpl folder) |
191 | { | 189 | { |
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 60df2e7..d647e71 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -262,44 +262,34 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
262 | { | 262 | { |
263 | case ChatTypeEnum.Whisper: | 263 | case ChatTypeEnum.Whisper: |
264 | if (dis < m_whisperdistance) | 264 | if (dis < m_whisperdistance) |
265 | { | 265 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
266 | lock (m_pending.SyncRoot) | ||
267 | { | ||
268 | m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); | ||
269 | } | ||
270 | } | ||
271 | break; | 266 | break; |
272 | 267 | ||
273 | case ChatTypeEnum.Say: | 268 | case ChatTypeEnum.Say: |
274 | if (dis < m_saydistance) | 269 | if (dis < m_saydistance) |
275 | { | 270 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
276 | lock (m_pending.SyncRoot) | ||
277 | { | ||
278 | m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); | ||
279 | } | ||
280 | } | ||
281 | break; | 271 | break; |
282 | 272 | ||
283 | case ChatTypeEnum.Shout: | 273 | case ChatTypeEnum.Shout: |
284 | if (dis < m_shoutdistance) | 274 | if (dis < m_shoutdistance) |
285 | { | 275 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
286 | lock (m_pending.SyncRoot) | ||
287 | { | ||
288 | m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); | ||
289 | } | ||
290 | } | ||
291 | break; | 276 | break; |
292 | 277 | ||
293 | case ChatTypeEnum.Region: | 278 | case ChatTypeEnum.Region: |
294 | lock (m_pending.SyncRoot) | 279 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
295 | { | ||
296 | m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); | ||
297 | } | ||
298 | break; | 280 | break; |
299 | } | 281 | } |
300 | } | 282 | } |
301 | } | 283 | } |
302 | 284 | ||
285 | protected void QueueMessage(ListenerInfo li) | ||
286 | { | ||
287 | lock (m_pending.SyncRoot) | ||
288 | { | ||
289 | m_pending.Enqueue(li); | ||
290 | } | ||
291 | } | ||
292 | |||
303 | /// <summary> | 293 | /// <summary> |
304 | /// Are there any listen events ready to be dispatched? | 294 | /// Are there any listen events ready to be dispatched? |
305 | /// </summary> | 295 | /// </summary> |
@@ -319,7 +309,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
319 | 309 | ||
320 | lock (m_pending.SyncRoot) | 310 | lock (m_pending.SyncRoot) |
321 | { | 311 | { |
322 | li = (ListenerInfo) m_pending.Dequeue(); | 312 | li = (ListenerInfo)m_pending.Dequeue(); |
323 | } | 313 | } |
324 | 314 | ||
325 | return li; | 315 | return li; |
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index dfa8df6..73f7ae3 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -42,9 +42,7 @@ namespace OpenSim.Region.CoreModules.World | |||
42 | { | 42 | { |
43 | public class AccessModule : ISharedRegionModule | 43 | public class AccessModule : ISharedRegionModule |
44 | { | 44 | { |
45 | private static readonly ILog m_log = | 45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | LogManager.GetLogger( | ||
47 | MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | 46 | ||
49 | private List<Scene> m_SceneList = new List<Scene>(); | 47 | private List<Scene> m_SceneList = new List<Scene>(); |
50 | 48 | ||
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index a4a1abc..473920e 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -27,11 +27,13 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | ||
31 | using log4net; | ||
30 | using OpenMetaverse; | 32 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Client; | 34 | using OpenSim.Framework.Client; |
33 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
34 | using Caps=OpenSim.Framework.Capabilities.Caps; | 36 | using Caps = OpenSim.Framework.Capabilities.Caps; |
35 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 37 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
36 | 38 | ||
37 | namespace OpenSim.Region.Framework.Scenes | 39 | namespace OpenSim.Region.Framework.Scenes |
@@ -41,6 +43,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
41 | /// </summary> | 43 | /// </summary> |
42 | public class EventManager | 44 | public class EventManager |
43 | { | 45 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
44 | public delegate void OnFrameDelegate(); | 48 | public delegate void OnFrameDelegate(); |
45 | 49 | ||
46 | public event OnFrameDelegate OnFrame; | 50 | public event OnFrameDelegate OnFrame; |
@@ -208,14 +212,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
208 | public delegate void RequestChangeWaterHeight(float height); | 212 | public delegate void RequestChangeWaterHeight(float height); |
209 | 213 | ||
210 | public event RequestChangeWaterHeight OnRequestChangeWaterHeight; | 214 | public event RequestChangeWaterHeight OnRequestChangeWaterHeight; |
211 | 215 | ||
212 | public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar); | 216 | /// <summary> |
213 | 217 | /// Fired if any avatar is 'killed' due to its health falling to zero | |
218 | /// </summary> | ||
214 | public event AvatarKillData OnAvatarKilled; | 219 | public event AvatarKillData OnAvatarKilled; |
220 | public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar); | ||
215 | 221 | ||
216 | public delegate void ScriptTimerEvent(uint localID, double timerinterval); | 222 | // public delegate void ScriptTimerEvent(uint localID, double timerinterval); |
217 | 223 | ||
218 | public event ScriptTimerEvent OnScriptTimerEvent; | 224 | // public event ScriptTimerEvent OnScriptTimerEvent; |
219 | 225 | ||
220 | public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); | 226 | public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); |
221 | public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); | 227 | public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); |
@@ -382,617 +388,1263 @@ namespace OpenSim.Region.Framework.Scenes | |||
382 | public event LandBuy OnLandBuy; | 388 | public event LandBuy OnLandBuy; |
383 | public event LandBuy OnValidateLandBuy; | 389 | public event LandBuy OnValidateLandBuy; |
384 | 390 | ||
385 | /* Designated Event Deletage Instances */ | ||
386 | |||
387 | private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent; | ||
388 | private ScriptAtTargetEvent handlerScriptAtTargetEvent = null; | ||
389 | private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null; | ||
390 | private ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = null; | ||
391 | private ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = null; | ||
392 | private ClientMovement handlerClientMovement = null; //OnClientMovement; | ||
393 | private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError; | ||
394 | private OnPluginConsoleDelegate handlerPluginConsole = null; //OnPluginConsole; | ||
395 | private OnFrameDelegate handlerFrame = null; //OnFrame; | ||
396 | private OnNewClientDelegate handlerNewClient = null; //OnNewClient; | ||
397 | private OnClientConnectCoreDelegate handlerClientConnect = null; //OnClientConnect | ||
398 | private OnNewPresenceDelegate handlerNewPresence = null; //OnNewPresence; | ||
399 | private OnRemovePresenceDelegate handlerRemovePresence = null; //OnRemovePresence; | ||
400 | private OnBackupDelegate handlerBackup = null; //OnBackup; | ||
401 | private OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = null; //OnParcelPrimCountUpdate; | ||
402 | private MoneyTransferEvent handlerMoneyTransfer = null; //OnMoneyTransfer; | ||
403 | private OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = null; //OnParcelPrimCountAdd; | ||
404 | private OnShutdownDelegate handlerShutdown = null; //OnShutdown; | ||
405 | private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab; | ||
406 | private ObjectGrabDelegate handlerObjectGrabbing = null; //OnObjectGrabbing; | ||
407 | private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab; | ||
408 | private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset | ||
409 | private NewRezScript handlerRezScript = null; //OnRezScript; | ||
410 | private RemoveScript handlerRemoveScript = null; //OnRemoveScript; | ||
411 | private StartScript handlerStartScript = null; //OnStartScript; | ||
412 | private StopScript handlerStopScript = null; //OnStopScript; | ||
413 | private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove; | ||
414 | private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab; | ||
415 | private SceneGroupSpinStarted handlerSceneGroupSpinStarted = null; //OnSceneGroupSpinStart; | ||
416 | private SceneGroupSpun handlerSceneGroupSpin = null; //OnSceneGroupSpin; | ||
417 | private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded; | ||
418 | private LandObjectRemoved handlerLandObjectRemoved = null; //OnLandObjectRemoved; | ||
419 | private AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = null; //OnAvatarEnteringNewParcel; | ||
420 | private IncomingInstantMessage handlerIncomingInstantMessage = null; //OnIncomingInstantMessage; | ||
421 | private IncomingInstantMessage handlerUnhandledInstantMessage = null; //OnUnhandledInstantMessage; | ||
422 | private ClientClosed handlerClientClosed = null; //OnClientClosed; | ||
423 | private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent; | ||
424 | private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent; | ||
425 | private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick; | ||
426 | private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps; | ||
427 | private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps; | ||
428 | private ChatFromWorldEvent handlerChatFromWorld = null; // OnChatFromWorld; | ||
429 | private ChatFromClientEvent handlerChatFromClient = null; // OnChatFromClient; | ||
430 | private ChatBroadcastEvent handlerChatBroadcast = null; // OnChatBroadcast; | ||
431 | private NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = null; | ||
432 | private RequestChangeWaterHeight handlerRequestChangeWaterHeight = null; //OnRequestChangeWaterHeight | ||
433 | private ScriptControlEvent handlerScriptControlEvent = null; | ||
434 | private SignificantClientMovement handlerSignificantClientMovement = null; | ||
435 | |||
436 | private LandBuy handlerLandBuy = null; | ||
437 | private LandBuy handlerValidateLandBuy = null; | ||
438 | private AvatarKillData handlerAvatarKill = null; | ||
439 | |||
440 | private NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = null; | ||
441 | private IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = null; | ||
442 | private SetAllowForcefulBan handlerSetAllowForcefulBan = null; | ||
443 | private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null; | ||
444 | private ParcelPrimCountTainted handlerParcelPrimCountTainted = null; | ||
445 | private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null; | ||
446 | // TODO: unused: private ScriptTimerEvent handlerScriptTimerEvent = null; | ||
447 | private EstateToolsSunUpdate handlerEstateToolsSunUpdate = null; | ||
448 | |||
449 | private ScriptColliding handlerCollidingStart = null; | ||
450 | private ScriptColliding handlerColliding = null; | ||
451 | private ScriptColliding handlerCollidingEnd = null; | ||
452 | private ScriptColliding handlerLandCollidingStart = null; | ||
453 | private ScriptColliding handlerLandColliding = null; | ||
454 | private ScriptColliding handlerLandCollidingEnd = null; | ||
455 | private GetScriptRunning handlerGetScriptRunning = null; | ||
456 | |||
457 | private SunLindenHour handlerCurrentTimeAsLindenSunHour = null; | ||
458 | private OnSetRootAgentSceneDelegate handlerSetRootAgentScene = null; | ||
459 | |||
460 | private OarFileLoaded handlerOarFileLoaded = null; | ||
461 | private OarFileSaved handlerOarFileSaved = null; | ||
462 | |||
463 | private EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = null; | ||
464 | |||
465 | private Attach handlerOnAttach = null; | ||
466 | private RegionUp handlerOnRegionUp = null; | ||
467 | |||
468 | public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID) | 391 | public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID) |
469 | { | 392 | { |
470 | handlerOnAttach = OnAttach; | 393 | Attach handlerOnAttach = OnAttach; |
471 | if (handlerOnAttach != null) | 394 | if (handlerOnAttach != null) |
472 | handlerOnAttach(localID, itemID, avatarID); | 395 | { |
396 | foreach (Attach d in handlerOnAttach.GetInvocationList()) | ||
397 | { | ||
398 | try | ||
399 | { | ||
400 | d(localID, itemID, avatarID); | ||
401 | } | ||
402 | catch (Exception e) | ||
403 | { | ||
404 | m_log.ErrorFormat( | ||
405 | "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", | ||
406 | e.Message, e.StackTrace); | ||
407 | } | ||
408 | } | ||
409 | } | ||
473 | } | 410 | } |
474 | 411 | ||
475 | public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) | 412 | public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) |
476 | { | 413 | { |
477 | handlerGetScriptRunning = OnGetScriptRunning; | 414 | GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning; |
478 | if (handlerGetScriptRunning != null) | 415 | if (handlerGetScriptRunning != null) |
479 | handlerGetScriptRunning(controllingClient, objectID, itemID); | 416 | { |
417 | foreach (GetScriptRunning d in handlerGetScriptRunning.GetInvocationList()) | ||
418 | { | ||
419 | try | ||
420 | { | ||
421 | d(controllingClient, objectID, itemID); | ||
422 | } | ||
423 | catch (Exception e) | ||
424 | { | ||
425 | m_log.ErrorFormat( | ||
426 | "[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}", | ||
427 | e.Message, e.StackTrace); | ||
428 | } | ||
429 | } | ||
430 | } | ||
480 | } | 431 | } |
481 | 432 | ||
482 | public void TriggerOnScriptChangedEvent(uint localID, uint change) | 433 | public void TriggerOnScriptChangedEvent(uint localID, uint change) |
483 | { | 434 | { |
484 | handlerScriptChangedEvent = OnScriptChangedEvent; | 435 | ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent; |
485 | if (handlerScriptChangedEvent != null) | 436 | if (handlerScriptChangedEvent != null) |
486 | handlerScriptChangedEvent(localID, change); | 437 | { |
438 | foreach (ScriptChangedEvent d in handlerScriptChangedEvent.GetInvocationList()) | ||
439 | { | ||
440 | try | ||
441 | { | ||
442 | d(localID, change); | ||
443 | } | ||
444 | catch (Exception e) | ||
445 | { | ||
446 | m_log.ErrorFormat( | ||
447 | "[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}", | ||
448 | e.Message, e.StackTrace); | ||
449 | } | ||
450 | } | ||
451 | } | ||
487 | } | 452 | } |
488 | 453 | ||
489 | public void TriggerOnClientMovement(ScenePresence avatar) | 454 | public void TriggerOnClientMovement(ScenePresence avatar) |
490 | { | 455 | { |
491 | handlerClientMovement = OnClientMovement; | 456 | ClientMovement handlerClientMovement = OnClientMovement; |
492 | if (handlerClientMovement != null) | 457 | if (handlerClientMovement != null) |
493 | handlerClientMovement(avatar); | 458 | { |
459 | foreach (ClientMovement d in handlerClientMovement.GetInvocationList()) | ||
460 | { | ||
461 | try | ||
462 | { | ||
463 | d(avatar); | ||
464 | } | ||
465 | catch (Exception e) | ||
466 | { | ||
467 | m_log.ErrorFormat( | ||
468 | "[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}", | ||
469 | e.Message, e.StackTrace); | ||
470 | } | ||
471 | } | ||
472 | } | ||
494 | } | 473 | } |
495 | 474 | ||
496 | public void TriggerPermissionError(UUID user, string reason) | 475 | public void TriggerPermissionError(UUID user, string reason) |
497 | { | 476 | { |
498 | handlerPermissionError = OnPermissionError; | 477 | OnPermissionErrorDelegate handlerPermissionError = OnPermissionError; |
499 | if (handlerPermissionError != null) | 478 | if (handlerPermissionError != null) |
500 | handlerPermissionError(user, reason); | 479 | { |
480 | foreach (OnPermissionErrorDelegate d in handlerPermissionError.GetInvocationList()) | ||
481 | { | ||
482 | try | ||
483 | { | ||
484 | d(user, reason); | ||
485 | } | ||
486 | catch (Exception e) | ||
487 | { | ||
488 | m_log.ErrorFormat( | ||
489 | "[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}", | ||
490 | e.Message, e.StackTrace); | ||
491 | } | ||
492 | } | ||
493 | } | ||
501 | } | 494 | } |
502 | 495 | ||
503 | public void TriggerOnPluginConsole(string[] args) | 496 | public void TriggerOnPluginConsole(string[] args) |
504 | { | 497 | { |
505 | handlerPluginConsole = OnPluginConsole; | 498 | OnPluginConsoleDelegate handlerPluginConsole = OnPluginConsole; |
506 | if (handlerPluginConsole != null) | 499 | if (handlerPluginConsole != null) |
507 | handlerPluginConsole(args); | 500 | { |
501 | foreach (OnPluginConsoleDelegate d in handlerPluginConsole.GetInvocationList()) | ||
502 | { | ||
503 | try | ||
504 | { | ||
505 | d(args); | ||
506 | } | ||
507 | catch (Exception e) | ||
508 | { | ||
509 | m_log.ErrorFormat( | ||
510 | "[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}", | ||
511 | e.Message, e.StackTrace); | ||
512 | } | ||
513 | } | ||
514 | } | ||
508 | } | 515 | } |
509 | 516 | ||
510 | public void TriggerOnFrame() | 517 | public void TriggerOnFrame() |
511 | { | 518 | { |
512 | handlerFrame = OnFrame; | 519 | OnFrameDelegate handlerFrame = OnFrame; |
513 | if (handlerFrame != null) | 520 | if (handlerFrame != null) |
514 | { | 521 | { |
515 | handlerFrame(); | 522 | foreach (OnFrameDelegate d in handlerFrame.GetInvocationList()) |
516 | } | 523 | { |
524 | try | ||
525 | { | ||
526 | d(); | ||
527 | } | ||
528 | catch (Exception e) | ||
529 | { | ||
530 | m_log.ErrorFormat( | ||
531 | "[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}", | ||
532 | e.Message, e.StackTrace); | ||
533 | } | ||
534 | } | ||
535 | } | ||
517 | } | 536 | } |
518 | 537 | ||
519 | public void TriggerOnNewClient(IClientAPI client) | 538 | public void TriggerOnNewClient(IClientAPI client) |
520 | { | 539 | { |
521 | handlerNewClient = OnNewClient; | 540 | OnNewClientDelegate handlerNewClient = OnNewClient; |
522 | if (handlerNewClient != null) | 541 | if (handlerNewClient != null) |
523 | handlerNewClient(client); | 542 | { |
543 | foreach (OnNewClientDelegate d in handlerNewClient.GetInvocationList()) | ||
544 | { | ||
545 | try | ||
546 | { | ||
547 | d(client); | ||
548 | } | ||
549 | catch (Exception e) | ||
550 | { | ||
551 | m_log.ErrorFormat( | ||
552 | "[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}", | ||
553 | e.Message, e.StackTrace); | ||
554 | } | ||
555 | } | ||
556 | } | ||
524 | 557 | ||
525 | if (client is IClientCore) | 558 | if (client is IClientCore) |
526 | { | 559 | { |
527 | handlerClientConnect = OnClientConnect; | 560 | OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect; |
528 | if (handlerClientConnect != null) | 561 | if (handlerClientConnect != null) |
529 | handlerClientConnect((IClientCore)client); | 562 | { |
563 | foreach (OnClientConnectCoreDelegate d in handlerClientConnect.GetInvocationList()) | ||
564 | { | ||
565 | try | ||
566 | { | ||
567 | d((IClientCore)client); | ||
568 | } | ||
569 | catch (Exception e) | ||
570 | { | ||
571 | m_log.ErrorFormat( | ||
572 | "[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}", | ||
573 | e.Message, e.StackTrace); | ||
574 | } | ||
575 | } | ||
576 | } | ||
530 | } | 577 | } |
531 | } | 578 | } |
532 | 579 | ||
533 | public void TriggerOnNewPresence(ScenePresence presence) | 580 | public void TriggerOnNewPresence(ScenePresence presence) |
534 | { | 581 | { |
535 | handlerNewPresence = OnNewPresence; | 582 | OnNewPresenceDelegate handlerNewPresence = OnNewPresence; |
536 | if (handlerNewPresence != null) | 583 | if (handlerNewPresence != null) |
537 | handlerNewPresence(presence); | 584 | { |
585 | foreach (OnNewPresenceDelegate d in handlerNewPresence.GetInvocationList()) | ||
586 | { | ||
587 | try | ||
588 | { | ||
589 | d(presence); | ||
590 | } | ||
591 | catch (Exception e) | ||
592 | { | ||
593 | m_log.ErrorFormat( | ||
594 | "[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}", | ||
595 | e.Message, e.StackTrace); | ||
596 | } | ||
597 | } | ||
598 | } | ||
538 | } | 599 | } |
539 | 600 | ||
540 | public void TriggerOnRemovePresence(UUID agentId) | 601 | public void TriggerOnRemovePresence(UUID agentId) |
541 | { | 602 | { |
542 | handlerRemovePresence = OnRemovePresence; | 603 | OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence; |
543 | if (handlerRemovePresence != null) | 604 | if (handlerRemovePresence != null) |
544 | { | 605 | { |
545 | handlerRemovePresence(agentId); | 606 | foreach (OnRemovePresenceDelegate d in handlerRemovePresence.GetInvocationList()) |
546 | } | 607 | { |
608 | try | ||
609 | { | ||
610 | d(agentId); | ||
611 | } | ||
612 | catch (Exception e) | ||
613 | { | ||
614 | m_log.ErrorFormat( | ||
615 | "[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}", | ||
616 | e.Message, e.StackTrace); | ||
617 | } | ||
618 | } | ||
619 | } | ||
547 | } | 620 | } |
548 | 621 | ||
549 | public void TriggerOnBackup(IRegionDataStore dstore) | 622 | public void TriggerOnBackup(IRegionDataStore dstore) |
550 | { | 623 | { |
551 | handlerBackup = OnBackup; | 624 | OnBackupDelegate handlerOnAttach = OnBackup; |
552 | if (handlerBackup != null) | 625 | if (handlerOnAttach != null) |
553 | { | 626 | { |
554 | handlerBackup(dstore, false); | 627 | foreach (OnBackupDelegate d in handlerOnAttach.GetInvocationList()) |
555 | } | 628 | { |
629 | try | ||
630 | { | ||
631 | d(dstore, false); | ||
632 | } | ||
633 | catch (Exception e) | ||
634 | { | ||
635 | m_log.ErrorFormat( | ||
636 | "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}", | ||
637 | e.Message, e.StackTrace); | ||
638 | } | ||
639 | } | ||
640 | } | ||
556 | } | 641 | } |
557 | 642 | ||
558 | public void TriggerParcelPrimCountUpdate() | 643 | public void TriggerParcelPrimCountUpdate() |
559 | { | 644 | { |
560 | handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate; | 645 | OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate; |
561 | if (handlerParcelPrimCountUpdate != null) | 646 | if (handlerParcelPrimCountUpdate != null) |
562 | { | 647 | { |
563 | handlerParcelPrimCountUpdate(); | 648 | foreach (OnParcelPrimCountUpdateDelegate d in handlerParcelPrimCountUpdate.GetInvocationList()) |
564 | } | 649 | { |
565 | } | 650 | try |
566 | 651 | { | |
567 | public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e) | 652 | d(); |
568 | { | 653 | } |
569 | handlerMoneyTransfer = OnMoneyTransfer; | 654 | catch (Exception e) |
655 | { | ||
656 | m_log.ErrorFormat( | ||
657 | "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}", | ||
658 | e.Message, e.StackTrace); | ||
659 | } | ||
660 | } | ||
661 | } | ||
662 | } | ||
663 | |||
664 | public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args) | ||
665 | { | ||
666 | MoneyTransferEvent handlerMoneyTransfer = OnMoneyTransfer; | ||
570 | if (handlerMoneyTransfer != null) | 667 | if (handlerMoneyTransfer != null) |
571 | { | 668 | { |
572 | handlerMoneyTransfer(sender, e); | 669 | foreach (MoneyTransferEvent d in handlerMoneyTransfer.GetInvocationList()) |
573 | } | 670 | { |
671 | try | ||
672 | { | ||
673 | d(sender, args); | ||
674 | } | ||
675 | catch (Exception e) | ||
676 | { | ||
677 | m_log.ErrorFormat( | ||
678 | "[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}", | ||
679 | e.Message, e.StackTrace); | ||
680 | } | ||
681 | } | ||
682 | } | ||
574 | } | 683 | } |
575 | 684 | ||
576 | public void TriggerTerrainTick() | 685 | public void TriggerTerrainTick() |
577 | { | 686 | { |
578 | handlerTerrainTick = OnTerrainTick; | 687 | OnTerrainTickDelegate handlerTerrainTick = OnTerrainTick; |
579 | if (handlerTerrainTick != null) | 688 | if (handlerTerrainTick != null) |
580 | { | 689 | { |
581 | handlerTerrainTick(); | 690 | foreach (OnTerrainTickDelegate d in handlerTerrainTick.GetInvocationList()) |
582 | } | 691 | { |
692 | try | ||
693 | { | ||
694 | d(); | ||
695 | } | ||
696 | catch (Exception e) | ||
697 | { | ||
698 | m_log.ErrorFormat( | ||
699 | "[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}", | ||
700 | e.Message, e.StackTrace); | ||
701 | } | ||
702 | } | ||
703 | } | ||
583 | } | 704 | } |
584 | 705 | ||
585 | public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) | 706 | public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) |
586 | { | 707 | { |
587 | handlerParcelPrimCountAdd = OnParcelPrimCountAdd; | 708 | OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd; |
588 | if (handlerParcelPrimCountAdd != null) | 709 | if (handlerParcelPrimCountAdd != null) |
589 | { | 710 | { |
590 | handlerParcelPrimCountAdd(obj); | 711 | foreach (OnParcelPrimCountAddDelegate d in handlerParcelPrimCountAdd.GetInvocationList()) |
591 | } | 712 | { |
713 | try | ||
714 | { | ||
715 | d(obj); | ||
716 | } | ||
717 | catch (Exception e) | ||
718 | { | ||
719 | m_log.ErrorFormat( | ||
720 | "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}", | ||
721 | e.Message, e.StackTrace); | ||
722 | } | ||
723 | } | ||
724 | } | ||
592 | } | 725 | } |
593 | 726 | ||
594 | public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) | 727 | public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) |
595 | { | 728 | { |
596 | handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; | 729 | ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; |
597 | if (handlerObjectBeingRemovedFromScene != null) | 730 | if (handlerObjectBeingRemovedFromScene != null) |
598 | { | 731 | { |
599 | handlerObjectBeingRemovedFromScene(obj); | 732 | foreach (ObjectBeingRemovedFromScene d in handlerObjectBeingRemovedFromScene.GetInvocationList()) |
600 | } | 733 | { |
734 | try | ||
735 | { | ||
736 | d(obj); | ||
737 | } | ||
738 | catch (Exception e) | ||
739 | { | ||
740 | m_log.ErrorFormat( | ||
741 | "[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}", | ||
742 | e.Message, e.StackTrace); | ||
743 | } | ||
744 | } | ||
745 | } | ||
601 | } | 746 | } |
602 | 747 | ||
603 | public void TriggerShutdown() | 748 | public void TriggerShutdown() |
604 | { | 749 | { |
605 | handlerShutdown = OnShutdown; | 750 | OnShutdownDelegate handlerShutdown = OnShutdown; |
606 | if (handlerShutdown != null) | 751 | if (handlerShutdown != null) |
607 | handlerShutdown(); | 752 | { |
753 | foreach (OnShutdownDelegate d in handlerShutdown.GetInvocationList()) | ||
754 | { | ||
755 | try | ||
756 | { | ||
757 | d(); | ||
758 | } | ||
759 | catch (Exception e) | ||
760 | { | ||
761 | m_log.ErrorFormat( | ||
762 | "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}", | ||
763 | e.Message, e.StackTrace); | ||
764 | } | ||
765 | } | ||
766 | } | ||
608 | } | 767 | } |
609 | 768 | ||
610 | public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) | 769 | public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) |
611 | { | 770 | { |
612 | handlerObjectGrab = OnObjectGrab; | 771 | ObjectGrabDelegate handlerObjectGrab = OnObjectGrab; |
613 | if (handlerObjectGrab != null) | 772 | if (handlerObjectGrab != null) |
614 | { | 773 | { |
615 | handlerObjectGrab(localID, originalID, offsetPos, remoteClient, surfaceArgs); | 774 | foreach (ObjectGrabDelegate d in handlerObjectGrab.GetInvocationList()) |
616 | } | 775 | { |
776 | try | ||
777 | { | ||
778 | d(localID, originalID, offsetPos, remoteClient, surfaceArgs); | ||
779 | } | ||
780 | catch (Exception e) | ||
781 | { | ||
782 | m_log.ErrorFormat( | ||
783 | "[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}", | ||
784 | e.Message, e.StackTrace); | ||
785 | } | ||
786 | } | ||
787 | } | ||
617 | } | 788 | } |
618 | 789 | ||
619 | public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) | 790 | public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) |
620 | { | 791 | { |
621 | handlerObjectGrabbing = OnObjectGrabbing; | 792 | ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing; |
622 | if (handlerObjectGrabbing != null) | 793 | if (handlerObjectGrabbing != null) |
623 | { | 794 | { |
624 | handlerObjectGrabbing(localID, originalID, offsetPos, remoteClient, surfaceArgs); | 795 | foreach (ObjectGrabDelegate d in handlerObjectGrabbing.GetInvocationList()) |
625 | } | 796 | { |
797 | try | ||
798 | { | ||
799 | d(localID, originalID, offsetPos, remoteClient, surfaceArgs); | ||
800 | } | ||
801 | catch (Exception e) | ||
802 | { | ||
803 | m_log.ErrorFormat( | ||
804 | "[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}", | ||
805 | e.Message, e.StackTrace); | ||
806 | } | ||
807 | } | ||
808 | } | ||
626 | } | 809 | } |
627 | 810 | ||
628 | public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) | 811 | public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) |
629 | { | 812 | { |
630 | handlerObjectDeGrab = OnObjectDeGrab; | 813 | ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab; |
631 | if (handlerObjectDeGrab != null) | 814 | if (handlerObjectDeGrab != null) |
632 | { | 815 | { |
633 | handlerObjectDeGrab(localID, originalID, remoteClient, surfaceArgs); | 816 | foreach (ObjectDeGrabDelegate d in handlerObjectDeGrab.GetInvocationList()) |
634 | } | 817 | { |
818 | try | ||
819 | { | ||
820 | d(localID, originalID, remoteClient, surfaceArgs); | ||
821 | } | ||
822 | catch (Exception e) | ||
823 | { | ||
824 | m_log.ErrorFormat( | ||
825 | "[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}", | ||
826 | e.Message, e.StackTrace); | ||
827 | } | ||
828 | } | ||
829 | } | ||
635 | } | 830 | } |
636 | 831 | ||
637 | public void TriggerScriptReset(uint localID, UUID itemID) | 832 | public void TriggerScriptReset(uint localID, UUID itemID) |
638 | { | 833 | { |
639 | handlerScriptReset = OnScriptReset; | 834 | ScriptResetDelegate handlerScriptReset = OnScriptReset; |
640 | if (handlerScriptReset != null) | 835 | if (handlerScriptReset != null) |
641 | { | 836 | { |
642 | handlerScriptReset(localID, itemID); | 837 | foreach (ScriptResetDelegate d in handlerScriptReset.GetInvocationList()) |
643 | } | 838 | { |
839 | try | ||
840 | { | ||
841 | d(localID, itemID); | ||
842 | } | ||
843 | catch (Exception e) | ||
844 | { | ||
845 | m_log.ErrorFormat( | ||
846 | "[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}", | ||
847 | e.Message, e.StackTrace); | ||
848 | } | ||
849 | } | ||
850 | } | ||
644 | } | 851 | } |
645 | 852 | ||
646 | public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) | 853 | public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) |
647 | { | 854 | { |
648 | handlerRezScript = OnRezScript; | 855 | NewRezScript handlerRezScript = OnRezScript; |
649 | if (handlerRezScript != null) | 856 | if (handlerRezScript != null) |
650 | { | 857 | { |
651 | handlerRezScript(localID, itemID, script, startParam, | 858 | foreach (NewRezScript d in handlerRezScript.GetInvocationList()) |
652 | postOnRez, engine, stateSource); | 859 | { |
653 | } | 860 | try |
861 | { | ||
862 | d(localID, itemID, script, startParam, postOnRez, engine, stateSource); | ||
863 | } | ||
864 | catch (Exception e) | ||
865 | { | ||
866 | m_log.ErrorFormat( | ||
867 | "[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}", | ||
868 | e.Message, e.StackTrace); | ||
869 | } | ||
870 | } | ||
871 | } | ||
654 | } | 872 | } |
655 | 873 | ||
656 | public void TriggerStartScript(uint localID, UUID itemID) | 874 | public void TriggerStartScript(uint localID, UUID itemID) |
657 | { | 875 | { |
658 | handlerStartScript = OnStartScript; | 876 | StartScript handlerStartScript = OnStartScript; |
659 | if (handlerStartScript != null) | 877 | if (handlerStartScript != null) |
660 | { | 878 | { |
661 | handlerStartScript(localID, itemID); | 879 | foreach (StartScript d in handlerStartScript.GetInvocationList()) |
662 | } | 880 | { |
881 | try | ||
882 | { | ||
883 | d(localID, itemID); | ||
884 | } | ||
885 | catch (Exception e) | ||
886 | { | ||
887 | m_log.ErrorFormat( | ||
888 | "[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}", | ||
889 | e.Message, e.StackTrace); | ||
890 | } | ||
891 | } | ||
892 | } | ||
663 | } | 893 | } |
664 | 894 | ||
665 | public void TriggerStopScript(uint localID, UUID itemID) | 895 | public void TriggerStopScript(uint localID, UUID itemID) |
666 | { | 896 | { |
667 | handlerStopScript = OnStopScript; | 897 | StopScript handlerStopScript = OnStopScript; |
668 | if (handlerStopScript != null) | 898 | if (handlerStopScript != null) |
669 | { | 899 | { |
670 | handlerStopScript(localID, itemID); | 900 | foreach (StopScript d in handlerStopScript.GetInvocationList()) |
671 | } | 901 | { |
902 | try | ||
903 | { | ||
904 | d(localID, itemID); | ||
905 | } | ||
906 | catch (Exception e) | ||
907 | { | ||
908 | m_log.ErrorFormat( | ||
909 | "[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}", | ||
910 | e.Message, e.StackTrace); | ||
911 | } | ||
912 | } | ||
913 | } | ||
672 | } | 914 | } |
673 | 915 | ||
674 | public void TriggerRemoveScript(uint localID, UUID itemID) | 916 | public void TriggerRemoveScript(uint localID, UUID itemID) |
675 | { | 917 | { |
676 | handlerRemoveScript = OnRemoveScript; | 918 | RemoveScript handlerRemoveScript = OnRemoveScript; |
677 | if (handlerRemoveScript != null) | 919 | if (handlerRemoveScript != null) |
678 | { | 920 | { |
679 | handlerRemoveScript(localID, itemID); | 921 | foreach (RemoveScript d in handlerRemoveScript.GetInvocationList()) |
680 | } | 922 | { |
923 | try | ||
924 | { | ||
925 | d(localID, itemID); | ||
926 | } | ||
927 | catch (Exception e) | ||
928 | { | ||
929 | m_log.ErrorFormat( | ||
930 | "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", | ||
931 | e.Message, e.StackTrace); | ||
932 | } | ||
933 | } | ||
934 | } | ||
681 | } | 935 | } |
682 | 936 | ||
683 | public bool TriggerGroupMove(UUID groupID, Vector3 delta) | 937 | public bool TriggerGroupMove(UUID groupID, Vector3 delta) |
684 | { | 938 | { |
685 | handlerSceneGroupMove = OnSceneGroupMove; | 939 | bool result = true; |
686 | 940 | ||
941 | SceneGroupMoved handlerSceneGroupMove = OnSceneGroupMove; | ||
687 | if (handlerSceneGroupMove != null) | 942 | if (handlerSceneGroupMove != null) |
688 | { | 943 | { |
689 | return handlerSceneGroupMove(groupID, delta); | 944 | foreach (SceneGroupMoved d in handlerSceneGroupMove.GetInvocationList()) |
945 | { | ||
946 | try | ||
947 | { | ||
948 | if (d(groupID, delta) == false) | ||
949 | result = false; | ||
950 | } | ||
951 | catch (Exception e) | ||
952 | { | ||
953 | m_log.ErrorFormat( | ||
954 | "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", | ||
955 | e.Message, e.StackTrace); | ||
956 | } | ||
957 | } | ||
690 | } | 958 | } |
691 | return true; | 959 | |
960 | return result; | ||
692 | } | 961 | } |
693 | 962 | ||
694 | public bool TriggerGroupSpinStart(UUID groupID) | 963 | public bool TriggerGroupSpinStart(UUID groupID) |
695 | { | 964 | { |
696 | handlerSceneGroupSpinStarted = OnSceneGroupSpinStart; | 965 | bool result = true; |
697 | 966 | ||
967 | SceneGroupSpinStarted handlerSceneGroupSpinStarted = OnSceneGroupSpinStart; | ||
698 | if (handlerSceneGroupSpinStarted != null) | 968 | if (handlerSceneGroupSpinStarted != null) |
699 | { | 969 | { |
700 | return handlerSceneGroupSpinStarted(groupID); | 970 | foreach (SceneGroupSpinStarted d in handlerSceneGroupSpinStarted.GetInvocationList()) |
971 | { | ||
972 | try | ||
973 | { | ||
974 | if (d(groupID) == false) | ||
975 | result = false; | ||
976 | } | ||
977 | catch (Exception e) | ||
978 | { | ||
979 | m_log.ErrorFormat( | ||
980 | "[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}", | ||
981 | e.Message, e.StackTrace); | ||
982 | } | ||
983 | } | ||
701 | } | 984 | } |
702 | return true; | 985 | |
986 | return result; | ||
703 | } | 987 | } |
704 | 988 | ||
705 | public bool TriggerGroupSpin(UUID groupID, Quaternion rotation) | 989 | public bool TriggerGroupSpin(UUID groupID, Quaternion rotation) |
706 | { | 990 | { |
707 | handlerSceneGroupSpin = OnSceneGroupSpin; | 991 | bool result = true; |
708 | 992 | ||
993 | SceneGroupSpun handlerSceneGroupSpin = OnSceneGroupSpin; | ||
709 | if (handlerSceneGroupSpin != null) | 994 | if (handlerSceneGroupSpin != null) |
710 | { | 995 | { |
711 | return handlerSceneGroupSpin(groupID, rotation); | 996 | foreach (SceneGroupSpun d in handlerSceneGroupSpin.GetInvocationList()) |
997 | { | ||
998 | try | ||
999 | { | ||
1000 | if (d(groupID, rotation) == false) | ||
1001 | result = false; | ||
1002 | } | ||
1003 | catch (Exception e) | ||
1004 | { | ||
1005 | m_log.ErrorFormat( | ||
1006 | "[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}", | ||
1007 | e.Message, e.StackTrace); | ||
1008 | } | ||
1009 | } | ||
712 | } | 1010 | } |
713 | return true; | 1011 | |
1012 | return result; | ||
714 | } | 1013 | } |
715 | 1014 | ||
716 | public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID) | 1015 | public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID) |
717 | { | 1016 | { |
718 | handlerSceneGroupGrab = OnSceneGroupGrab; | 1017 | SceneGroupGrabed handlerSceneGroupGrab = OnSceneGroupGrab; |
719 | if (handlerSceneGroupGrab != null) | 1018 | if (handlerSceneGroupGrab != null) |
720 | { | 1019 | { |
721 | handlerSceneGroupGrab(groupID, offset, userID); | 1020 | foreach (SceneGroupGrabed d in handlerSceneGroupGrab.GetInvocationList()) |
722 | } | 1021 | { |
1022 | try | ||
1023 | { | ||
1024 | d(groupID, offset, userID); | ||
1025 | } | ||
1026 | catch (Exception e) | ||
1027 | { | ||
1028 | m_log.ErrorFormat( | ||
1029 | "[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}", | ||
1030 | e.Message, e.StackTrace); | ||
1031 | } | ||
1032 | } | ||
1033 | } | ||
723 | } | 1034 | } |
724 | 1035 | ||
725 | public void TriggerLandObjectAdded(ILandObject newParcel) | 1036 | public void TriggerLandObjectAdded(ILandObject newParcel) |
726 | { | 1037 | { |
727 | handlerLandObjectAdded = OnLandObjectAdded; | 1038 | LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded; |
728 | |||
729 | if (handlerLandObjectAdded != null) | 1039 | if (handlerLandObjectAdded != null) |
730 | { | 1040 | { |
731 | handlerLandObjectAdded(newParcel); | 1041 | foreach (LandObjectAdded d in handlerLandObjectAdded.GetInvocationList()) |
732 | } | 1042 | { |
1043 | try | ||
1044 | { | ||
1045 | d(newParcel); | ||
1046 | } | ||
1047 | catch (Exception e) | ||
1048 | { | ||
1049 | m_log.ErrorFormat( | ||
1050 | "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}", | ||
1051 | e.Message, e.StackTrace); | ||
1052 | } | ||
1053 | } | ||
1054 | } | ||
733 | } | 1055 | } |
734 | 1056 | ||
735 | public void TriggerLandObjectRemoved(UUID globalID) | 1057 | public void TriggerLandObjectRemoved(UUID globalID) |
736 | { | 1058 | { |
737 | handlerLandObjectRemoved = OnLandObjectRemoved; | 1059 | LandObjectRemoved handlerLandObjectRemoved = OnLandObjectRemoved; |
738 | if (handlerLandObjectRemoved != null) | 1060 | if (handlerLandObjectRemoved != null) |
739 | { | 1061 | { |
740 | handlerLandObjectRemoved(globalID); | 1062 | foreach (LandObjectRemoved d in handlerLandObjectRemoved.GetInvocationList()) |
741 | } | 1063 | { |
1064 | try | ||
1065 | { | ||
1066 | d(globalID); | ||
1067 | } | ||
1068 | catch (Exception e) | ||
1069 | { | ||
1070 | m_log.ErrorFormat( | ||
1071 | "[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}", | ||
1072 | e.Message, e.StackTrace); | ||
1073 | } | ||
1074 | } | ||
1075 | } | ||
742 | } | 1076 | } |
743 | 1077 | ||
744 | public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel) | 1078 | public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel) |
745 | { | 1079 | { |
746 | //triggerLandObjectRemoved(localParcelID); | ||
747 | |||
748 | TriggerLandObjectAdded(newParcel); | 1080 | TriggerLandObjectAdded(newParcel); |
749 | } | 1081 | } |
750 | 1082 | ||
751 | public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) | 1083 | public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) |
752 | { | 1084 | { |
753 | handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel; | 1085 | AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel; |
754 | |||
755 | if (handlerAvatarEnteringNewParcel != null) | 1086 | if (handlerAvatarEnteringNewParcel != null) |
756 | { | 1087 | { |
757 | handlerAvatarEnteringNewParcel(avatar, localLandID, regionID); | 1088 | foreach (AvatarEnteringNewParcel d in handlerAvatarEnteringNewParcel.GetInvocationList()) |
758 | } | 1089 | { |
1090 | try | ||
1091 | { | ||
1092 | d(avatar, localLandID, regionID); | ||
1093 | } | ||
1094 | catch (Exception e) | ||
1095 | { | ||
1096 | m_log.ErrorFormat( | ||
1097 | "[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}", | ||
1098 | e.Message, e.StackTrace); | ||
1099 | } | ||
1100 | } | ||
1101 | } | ||
759 | } | 1102 | } |
760 | 1103 | ||
761 | public void TriggerIncomingInstantMessage(GridInstantMessage message) | 1104 | public void TriggerIncomingInstantMessage(GridInstantMessage message) |
762 | { | 1105 | { |
763 | handlerIncomingInstantMessage = OnIncomingInstantMessage; | 1106 | IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; |
764 | if (handlerIncomingInstantMessage != null) | 1107 | if (handlerIncomingInstantMessage != null) |
765 | { | 1108 | { |
766 | handlerIncomingInstantMessage(message); | 1109 | foreach (IncomingInstantMessage d in handlerIncomingInstantMessage.GetInvocationList()) |
767 | } | 1110 | { |
1111 | try | ||
1112 | { | ||
1113 | d(message); | ||
1114 | } | ||
1115 | catch (Exception e) | ||
1116 | { | ||
1117 | m_log.ErrorFormat( | ||
1118 | "[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}", | ||
1119 | e.Message, e.StackTrace); | ||
1120 | } | ||
1121 | } | ||
1122 | } | ||
768 | } | 1123 | } |
769 | 1124 | ||
770 | public void TriggerUnhandledInstantMessage(GridInstantMessage message) | 1125 | public void TriggerUnhandledInstantMessage(GridInstantMessage message) |
771 | { | 1126 | { |
772 | handlerUnhandledInstantMessage = OnUnhandledInstantMessage; | 1127 | IncomingInstantMessage handlerUnhandledInstantMessage = OnUnhandledInstantMessage; |
773 | if (handlerUnhandledInstantMessage != null) | 1128 | if (handlerUnhandledInstantMessage != null) |
774 | { | 1129 | { |
775 | handlerUnhandledInstantMessage(message); | 1130 | foreach (IncomingInstantMessage d in handlerUnhandledInstantMessage.GetInvocationList()) |
776 | } | 1131 | { |
1132 | try | ||
1133 | { | ||
1134 | d(message); | ||
1135 | } | ||
1136 | catch (Exception e) | ||
1137 | { | ||
1138 | m_log.ErrorFormat( | ||
1139 | "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", | ||
1140 | e.Message, e.StackTrace); | ||
1141 | } | ||
1142 | } | ||
1143 | } | ||
777 | } | 1144 | } |
778 | 1145 | ||
779 | public void TriggerClientClosed(UUID ClientID, Scene scene) | 1146 | public void TriggerClientClosed(UUID ClientID, Scene scene) |
780 | { | 1147 | { |
781 | handlerClientClosed = OnClientClosed; | 1148 | ClientClosed handlerClientClosed = OnClientClosed; |
782 | if (handlerClientClosed != null) | 1149 | if (handlerClientClosed != null) |
783 | { | 1150 | { |
784 | handlerClientClosed(ClientID, scene); | 1151 | foreach (ClientClosed d in handlerClientClosed.GetInvocationList()) |
785 | } | 1152 | { |
1153 | try | ||
1154 | { | ||
1155 | d(ClientID, scene); | ||
1156 | } | ||
1157 | catch (Exception e) | ||
1158 | { | ||
1159 | m_log.ErrorFormat( | ||
1160 | "[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}", | ||
1161 | e.Message, e.StackTrace); | ||
1162 | } | ||
1163 | } | ||
1164 | } | ||
786 | } | 1165 | } |
787 | 1166 | ||
788 | public void TriggerOnMakeChildAgent(ScenePresence presence) | 1167 | public void TriggerOnMakeChildAgent(ScenePresence presence) |
789 | { | 1168 | { |
790 | handlerMakeChildAgent = OnMakeChildAgent; | 1169 | OnMakeChildAgentDelegate handlerMakeChildAgent = OnMakeChildAgent; |
791 | if (handlerMakeChildAgent != null) | 1170 | if (handlerMakeChildAgent != null) |
792 | { | 1171 | { |
793 | handlerMakeChildAgent(presence); | 1172 | foreach (OnMakeChildAgentDelegate d in handlerMakeChildAgent.GetInvocationList()) |
794 | } | 1173 | { |
1174 | try | ||
1175 | { | ||
1176 | d(presence); | ||
1177 | } | ||
1178 | catch (Exception e) | ||
1179 | { | ||
1180 | m_log.ErrorFormat( | ||
1181 | "[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}", | ||
1182 | e.Message, e.StackTrace); | ||
1183 | } | ||
1184 | } | ||
1185 | } | ||
795 | } | 1186 | } |
796 | 1187 | ||
797 | public void TriggerOnMakeRootAgent(ScenePresence presence) | 1188 | public void TriggerOnMakeRootAgent(ScenePresence presence) |
798 | { | 1189 | { |
799 | handlerMakeRootAgent = OnMakeRootAgent; | 1190 | OnMakeRootAgentDelegate handlerMakeRootAgent = OnMakeRootAgent; |
800 | if (handlerMakeRootAgent != null) | 1191 | if (handlerMakeRootAgent != null) |
801 | { | 1192 | { |
802 | handlerMakeRootAgent(presence); | 1193 | foreach (OnMakeRootAgentDelegate d in handlerMakeRootAgent.GetInvocationList()) |
803 | } | 1194 | { |
1195 | try | ||
1196 | { | ||
1197 | d(presence); | ||
1198 | } | ||
1199 | catch (Exception e) | ||
1200 | { | ||
1201 | m_log.ErrorFormat( | ||
1202 | "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}", | ||
1203 | e.Message, e.StackTrace); | ||
1204 | } | ||
1205 | } | ||
1206 | } | ||
804 | } | 1207 | } |
805 | 1208 | ||
806 | public void TriggerOnRegisterCaps(UUID agentID, Caps caps) | 1209 | public void TriggerOnRegisterCaps(UUID agentID, Caps caps) |
807 | { | 1210 | { |
808 | handlerRegisterCaps = OnRegisterCaps; | 1211 | RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps; |
809 | if (handlerRegisterCaps != null) | 1212 | if (handlerRegisterCaps != null) |
810 | { | 1213 | { |
811 | handlerRegisterCaps(agentID, caps); | 1214 | foreach (RegisterCapsEvent d in handlerRegisterCaps.GetInvocationList()) |
812 | } | 1215 | { |
1216 | try | ||
1217 | { | ||
1218 | d(agentID, caps); | ||
1219 | } | ||
1220 | catch (Exception e) | ||
1221 | { | ||
1222 | m_log.ErrorFormat( | ||
1223 | "[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}", | ||
1224 | e.Message, e.StackTrace); | ||
1225 | } | ||
1226 | } | ||
1227 | } | ||
813 | } | 1228 | } |
814 | 1229 | ||
815 | public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) | 1230 | public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) |
816 | { | 1231 | { |
817 | handlerDeregisterCaps = OnDeregisterCaps; | 1232 | DeregisterCapsEvent handlerDeregisterCaps = OnDeregisterCaps; |
818 | if (handlerDeregisterCaps != null) | 1233 | if (handlerDeregisterCaps != null) |
819 | { | 1234 | { |
820 | handlerDeregisterCaps(agentID, caps); | 1235 | foreach (DeregisterCapsEvent d in handlerDeregisterCaps.GetInvocationList()) |
821 | } | 1236 | { |
1237 | try | ||
1238 | { | ||
1239 | d(agentID, caps); | ||
1240 | } | ||
1241 | catch (Exception e) | ||
1242 | { | ||
1243 | m_log.ErrorFormat( | ||
1244 | "[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}", | ||
1245 | e.Message, e.StackTrace); | ||
1246 | } | ||
1247 | } | ||
1248 | } | ||
822 | } | 1249 | } |
823 | 1250 | ||
824 | public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) | 1251 | public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) |
825 | { | 1252 | { |
826 | handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; | 1253 | NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; |
827 | if (handlerNewInventoryItemUpdateComplete != null) | 1254 | if (handlerNewInventoryItemUpdateComplete != null) |
828 | { | 1255 | { |
829 | handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); | 1256 | foreach (NewInventoryItemUploadComplete d in handlerNewInventoryItemUpdateComplete.GetInvocationList()) |
830 | } | 1257 | { |
831 | } | 1258 | try |
832 | 1259 | { | |
833 | public void TriggerLandBuy(Object sender, LandBuyArgs e) | 1260 | d(agentID, AssetID, AssetName, userlevel); |
834 | { | 1261 | } |
835 | handlerLandBuy = OnLandBuy; | 1262 | catch (Exception e) |
1263 | { | ||
1264 | m_log.ErrorFormat( | ||
1265 | "[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}", | ||
1266 | e.Message, e.StackTrace); | ||
1267 | } | ||
1268 | } | ||
1269 | } | ||
1270 | } | ||
1271 | |||
1272 | public void TriggerLandBuy(Object sender, LandBuyArgs args) | ||
1273 | { | ||
1274 | LandBuy handlerLandBuy = OnLandBuy; | ||
836 | if (handlerLandBuy != null) | 1275 | if (handlerLandBuy != null) |
837 | { | 1276 | { |
838 | handlerLandBuy(sender, e); | 1277 | foreach (LandBuy d in handlerLandBuy.GetInvocationList()) |
839 | } | 1278 | { |
840 | } | 1279 | try |
841 | 1280 | { | |
842 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) | 1281 | d(sender, args); |
843 | { | 1282 | } |
844 | handlerValidateLandBuy = OnValidateLandBuy; | 1283 | catch (Exception e) |
1284 | { | ||
1285 | m_log.ErrorFormat( | ||
1286 | "[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}", | ||
1287 | e.Message, e.StackTrace); | ||
1288 | } | ||
1289 | } | ||
1290 | } | ||
1291 | } | ||
1292 | |||
1293 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs args) | ||
1294 | { | ||
1295 | LandBuy handlerValidateLandBuy = OnValidateLandBuy; | ||
845 | if (handlerValidateLandBuy != null) | 1296 | if (handlerValidateLandBuy != null) |
846 | { | 1297 | { |
847 | handlerValidateLandBuy(sender, e); | 1298 | foreach (LandBuy d in handlerValidateLandBuy.GetInvocationList()) |
848 | } | 1299 | { |
1300 | try | ||
1301 | { | ||
1302 | d(sender, args); | ||
1303 | } | ||
1304 | catch (Exception e) | ||
1305 | { | ||
1306 | m_log.ErrorFormat( | ||
1307 | "[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}", | ||
1308 | e.Message, e.StackTrace); | ||
1309 | } | ||
1310 | } | ||
1311 | } | ||
849 | } | 1312 | } |
850 | 1313 | ||
851 | public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) | 1314 | public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) |
852 | { | 1315 | { |
853 | handlerScriptAtTargetEvent = OnScriptAtTargetEvent; | 1316 | ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent; |
854 | if (handlerScriptAtTargetEvent != null) | 1317 | if (handlerScriptAtTargetEvent != null) |
855 | { | 1318 | { |
856 | handlerScriptAtTargetEvent(localID, handle, targetpos, currentpos); | 1319 | foreach (ScriptAtTargetEvent d in handlerScriptAtTargetEvent.GetInvocationList()) |
857 | } | 1320 | { |
1321 | try | ||
1322 | { | ||
1323 | d(localID, handle, targetpos, currentpos); | ||
1324 | } | ||
1325 | catch (Exception e) | ||
1326 | { | ||
1327 | m_log.ErrorFormat( | ||
1328 | "[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}", | ||
1329 | e.Message, e.StackTrace); | ||
1330 | } | ||
1331 | } | ||
1332 | } | ||
858 | } | 1333 | } |
859 | 1334 | ||
860 | public void TriggerNotAtTargetEvent(uint localID) | 1335 | public void TriggerNotAtTargetEvent(uint localID) |
861 | { | 1336 | { |
862 | handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent; | 1337 | ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent; |
863 | if (handlerScriptNotAtTargetEvent != null) | 1338 | if (handlerScriptNotAtTargetEvent != null) |
864 | { | 1339 | { |
865 | handlerScriptNotAtTargetEvent(localID); | 1340 | foreach (ScriptNotAtTargetEvent d in handlerScriptNotAtTargetEvent.GetInvocationList()) |
866 | } | 1341 | { |
1342 | try | ||
1343 | { | ||
1344 | d(localID); | ||
1345 | } | ||
1346 | catch (Exception e) | ||
1347 | { | ||
1348 | m_log.ErrorFormat( | ||
1349 | "[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}", | ||
1350 | e.Message, e.StackTrace); | ||
1351 | } | ||
1352 | } | ||
1353 | } | ||
867 | } | 1354 | } |
868 | 1355 | ||
869 | public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) | 1356 | public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) |
870 | { | 1357 | { |
871 | handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; | 1358 | ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; |
872 | if (handlerScriptAtRotTargetEvent != null) | 1359 | if (handlerScriptAtRotTargetEvent != null) |
873 | { | 1360 | { |
874 | handlerScriptAtRotTargetEvent(localID, handle, targetrot, currentrot); | 1361 | foreach (ScriptAtRotTargetEvent d in handlerScriptAtRotTargetEvent.GetInvocationList()) |
875 | } | 1362 | { |
1363 | try | ||
1364 | { | ||
1365 | d(localID, handle, targetrot, currentrot); | ||
1366 | } | ||
1367 | catch (Exception e) | ||
1368 | { | ||
1369 | m_log.ErrorFormat( | ||
1370 | "[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}", | ||
1371 | e.Message, e.StackTrace); | ||
1372 | } | ||
1373 | } | ||
1374 | } | ||
876 | } | 1375 | } |
877 | 1376 | ||
878 | public void TriggerNotAtRotTargetEvent(uint localID) | 1377 | public void TriggerNotAtRotTargetEvent(uint localID) |
879 | { | 1378 | { |
880 | handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent; | 1379 | ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent; |
881 | if (handlerScriptNotAtRotTargetEvent != null) | 1380 | if (handlerScriptNotAtRotTargetEvent != null) |
882 | { | 1381 | { |
883 | handlerScriptNotAtRotTargetEvent(localID); | 1382 | foreach (ScriptNotAtRotTargetEvent d in handlerScriptNotAtRotTargetEvent.GetInvocationList()) |
884 | } | 1383 | { |
1384 | try | ||
1385 | { | ||
1386 | d(localID); | ||
1387 | } | ||
1388 | catch (Exception e) | ||
1389 | { | ||
1390 | m_log.ErrorFormat( | ||
1391 | "[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}", | ||
1392 | e.Message, e.StackTrace); | ||
1393 | } | ||
1394 | } | ||
1395 | } | ||
885 | } | 1396 | } |
886 | 1397 | ||
887 | public void TriggerRequestChangeWaterHeight(float height) | 1398 | public void TriggerRequestChangeWaterHeight(float height) |
888 | { | 1399 | { |
889 | handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; | 1400 | RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; |
890 | if (handlerRequestChangeWaterHeight != null) | 1401 | if (handlerRequestChangeWaterHeight != null) |
891 | { | 1402 | { |
892 | handlerRequestChangeWaterHeight(height); | 1403 | foreach (RequestChangeWaterHeight d in handlerRequestChangeWaterHeight.GetInvocationList()) |
893 | } | 1404 | { |
1405 | try | ||
1406 | { | ||
1407 | d(height); | ||
1408 | } | ||
1409 | catch (Exception e) | ||
1410 | { | ||
1411 | m_log.ErrorFormat( | ||
1412 | "[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}", | ||
1413 | e.Message, e.StackTrace); | ||
1414 | } | ||
1415 | } | ||
1416 | } | ||
894 | } | 1417 | } |
895 | 1418 | ||
896 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) | 1419 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) |
897 | { | 1420 | { |
898 | handlerAvatarKill = OnAvatarKilled; | 1421 | AvatarKillData handlerAvatarKill = OnAvatarKilled; |
899 | if (handlerAvatarKill != null) | 1422 | if (handlerAvatarKill != null) |
900 | { | 1423 | { |
901 | handlerAvatarKill(KillerObjectLocalID, DeadAvatar); | 1424 | foreach (AvatarKillData d in handlerAvatarKill.GetInvocationList()) |
902 | } | 1425 | { |
1426 | try | ||
1427 | { | ||
1428 | d(KillerObjectLocalID, DeadAvatar); | ||
1429 | } | ||
1430 | catch (Exception e) | ||
1431 | { | ||
1432 | m_log.ErrorFormat( | ||
1433 | "[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}", | ||
1434 | e.Message, e.StackTrace); | ||
1435 | } | ||
1436 | } | ||
1437 | } | ||
903 | } | 1438 | } |
904 | 1439 | ||
905 | public void TriggerSignificantClientMovement(IClientAPI client) | 1440 | public void TriggerSignificantClientMovement(IClientAPI client) |
906 | { | 1441 | { |
907 | handlerSignificantClientMovement = OnSignificantClientMovement; | 1442 | SignificantClientMovement handlerSignificantClientMovement = OnSignificantClientMovement; |
908 | if (handlerSignificantClientMovement != null) | 1443 | if (handlerSignificantClientMovement != null) |
909 | { | 1444 | { |
910 | handlerSignificantClientMovement(client); | 1445 | foreach (SignificantClientMovement d in handlerSignificantClientMovement.GetInvocationList()) |
911 | } | 1446 | { |
1447 | try | ||
1448 | { | ||
1449 | d(client); | ||
1450 | } | ||
1451 | catch (Exception e) | ||
1452 | { | ||
1453 | m_log.ErrorFormat( | ||
1454 | "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}", | ||
1455 | e.Message, e.StackTrace); | ||
1456 | } | ||
1457 | } | ||
1458 | } | ||
912 | } | 1459 | } |
913 | 1460 | ||
914 | public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat) | 1461 | public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat) |
915 | { | 1462 | { |
916 | handlerChatFromWorld = OnChatFromWorld; | 1463 | ChatFromWorldEvent handlerChatFromWorld = OnChatFromWorld; |
917 | if (handlerChatFromWorld != null) | 1464 | if (handlerChatFromWorld != null) |
918 | { | 1465 | { |
919 | handlerChatFromWorld(sender, chat); | 1466 | foreach (ChatFromWorldEvent d in handlerChatFromWorld.GetInvocationList()) |
920 | } | 1467 | { |
1468 | try | ||
1469 | { | ||
1470 | d(sender, chat); | ||
1471 | } | ||
1472 | catch (Exception e) | ||
1473 | { | ||
1474 | m_log.ErrorFormat( | ||
1475 | "[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}", | ||
1476 | e.Message, e.StackTrace); | ||
1477 | } | ||
1478 | } | ||
1479 | } | ||
921 | } | 1480 | } |
922 | 1481 | ||
923 | public void TriggerOnChatFromClient(Object sender, OSChatMessage chat) | 1482 | public void TriggerOnChatFromClient(Object sender, OSChatMessage chat) |
924 | { | 1483 | { |
925 | handlerChatFromClient = OnChatFromClient; | 1484 | ChatFromClientEvent handlerChatFromClient = OnChatFromClient; |
926 | if (handlerChatFromClient != null) | 1485 | if (handlerChatFromClient != null) |
927 | { | 1486 | { |
928 | handlerChatFromClient(sender, chat); | 1487 | foreach (ChatFromClientEvent d in handlerChatFromClient.GetInvocationList()) |
929 | } | 1488 | { |
1489 | try | ||
1490 | { | ||
1491 | d(sender, chat); | ||
1492 | } | ||
1493 | catch (Exception e) | ||
1494 | { | ||
1495 | m_log.ErrorFormat( | ||
1496 | "[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}", | ||
1497 | e.Message, e.StackTrace); | ||
1498 | } | ||
1499 | } | ||
1500 | } | ||
930 | } | 1501 | } |
931 | 1502 | ||
932 | public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) | 1503 | public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) |
933 | { | 1504 | { |
934 | handlerChatBroadcast = OnChatBroadcast; | 1505 | ChatBroadcastEvent handlerChatBroadcast = OnChatBroadcast; |
935 | if (handlerChatBroadcast != null) | 1506 | if (handlerChatBroadcast != null) |
936 | { | 1507 | { |
937 | handlerChatBroadcast(sender, chat); | 1508 | foreach (ChatBroadcastEvent d in handlerChatBroadcast.GetInvocationList()) |
938 | } | 1509 | { |
1510 | try | ||
1511 | { | ||
1512 | d(sender, chat); | ||
1513 | } | ||
1514 | catch (Exception e) | ||
1515 | { | ||
1516 | m_log.ErrorFormat( | ||
1517 | "[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}", | ||
1518 | e.Message, e.StackTrace); | ||
1519 | } | ||
1520 | } | ||
1521 | } | ||
939 | } | 1522 | } |
940 | 1523 | ||
941 | internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) | 1524 | internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) |
942 | { | 1525 | { |
943 | handlerScriptControlEvent = OnScriptControlEvent; | 1526 | ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent; |
944 | if (handlerScriptControlEvent != null) | 1527 | if (handlerScriptControlEvent != null) |
945 | { | 1528 | { |
946 | handlerScriptControlEvent(p, scriptUUID, avatarID, held, _changed); | 1529 | foreach (ScriptControlEvent d in handlerScriptControlEvent.GetInvocationList()) |
947 | } | 1530 | { |
1531 | try | ||
1532 | { | ||
1533 | d(p, scriptUUID, avatarID, held, _changed); | ||
1534 | } | ||
1535 | catch (Exception e) | ||
1536 | { | ||
1537 | m_log.ErrorFormat( | ||
1538 | "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}", | ||
1539 | e.Message, e.StackTrace); | ||
1540 | } | ||
1541 | } | ||
1542 | } | ||
948 | } | 1543 | } |
949 | 1544 | ||
950 | public void TriggerNoticeNoLandDataFromStorage() | 1545 | public void TriggerNoticeNoLandDataFromStorage() |
951 | { | 1546 | { |
952 | handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; | 1547 | NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; |
953 | if (handlerNoticeNoLandDataFromStorage != null) | 1548 | if (handlerNoticeNoLandDataFromStorage != null) |
954 | { | 1549 | { |
955 | handlerNoticeNoLandDataFromStorage(); | 1550 | foreach (NoticeNoLandDataFromStorage d in handlerNoticeNoLandDataFromStorage.GetInvocationList()) |
956 | 1551 | { | |
957 | } | 1552 | try |
1553 | { | ||
1554 | d(); | ||
1555 | } | ||
1556 | catch (Exception e) | ||
1557 | { | ||
1558 | m_log.ErrorFormat( | ||
1559 | "[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}", | ||
1560 | e.Message, e.StackTrace); | ||
1561 | } | ||
1562 | } | ||
1563 | } | ||
958 | } | 1564 | } |
959 | 1565 | ||
960 | public void TriggerIncomingLandDataFromStorage(List<LandData> landData) | 1566 | public void TriggerIncomingLandDataFromStorage(List<LandData> landData) |
961 | { | 1567 | { |
962 | handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage; | 1568 | IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage; |
963 | if (handlerIncomingLandDataFromStorage != null) | 1569 | if (handlerIncomingLandDataFromStorage != null) |
964 | { | 1570 | { |
965 | handlerIncomingLandDataFromStorage(landData); | 1571 | foreach (IncomingLandDataFromStorage d in handlerIncomingLandDataFromStorage.GetInvocationList()) |
966 | 1572 | { | |
967 | } | 1573 | try |
1574 | { | ||
1575 | d(landData); | ||
1576 | } | ||
1577 | catch (Exception e) | ||
1578 | { | ||
1579 | m_log.ErrorFormat( | ||
1580 | "[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}", | ||
1581 | e.Message, e.StackTrace); | ||
1582 | } | ||
1583 | } | ||
1584 | } | ||
968 | } | 1585 | } |
969 | 1586 | ||
970 | public void TriggerSetAllowForcefulBan(bool allow) | 1587 | public void TriggerSetAllowForcefulBan(bool allow) |
971 | { | 1588 | { |
972 | handlerSetAllowForcefulBan = OnSetAllowForcefulBan; | 1589 | SetAllowForcefulBan handlerSetAllowForcefulBan = OnSetAllowForcefulBan; |
973 | if (handlerSetAllowForcefulBan != null) | 1590 | if (handlerSetAllowForcefulBan != null) |
974 | { | 1591 | { |
975 | handlerSetAllowForcefulBan(allow); | 1592 | foreach (SetAllowForcefulBan d in handlerSetAllowForcefulBan.GetInvocationList()) |
976 | 1593 | { | |
977 | } | 1594 | try |
1595 | { | ||
1596 | d(allow); | ||
1597 | } | ||
1598 | catch (Exception e) | ||
1599 | { | ||
1600 | m_log.ErrorFormat( | ||
1601 | "[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}", | ||
1602 | e.Message, e.StackTrace); | ||
1603 | } | ||
1604 | } | ||
1605 | } | ||
978 | } | 1606 | } |
979 | 1607 | ||
980 | public void TriggerRequestParcelPrimCountUpdate() | 1608 | public void TriggerRequestParcelPrimCountUpdate() |
981 | { | 1609 | { |
982 | handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; | 1610 | RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; |
983 | if (handlerRequestParcelPrimCountUpdate != null) | 1611 | if (handlerRequestParcelPrimCountUpdate != null) |
984 | { | 1612 | { |
985 | handlerRequestParcelPrimCountUpdate(); | 1613 | foreach (RequestParcelPrimCountUpdate d in handlerRequestParcelPrimCountUpdate.GetInvocationList()) |
986 | } | 1614 | { |
1615 | try | ||
1616 | { | ||
1617 | d(); | ||
1618 | } | ||
1619 | catch (Exception e) | ||
1620 | { | ||
1621 | m_log.ErrorFormat( | ||
1622 | "[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}", | ||
1623 | e.Message, e.StackTrace); | ||
1624 | } | ||
1625 | } | ||
1626 | } | ||
987 | } | 1627 | } |
988 | 1628 | ||
989 | public void TriggerParcelPrimCountTainted() | 1629 | public void TriggerParcelPrimCountTainted() |
990 | { | 1630 | { |
991 | handlerParcelPrimCountTainted = OnParcelPrimCountTainted; | 1631 | ParcelPrimCountTainted handlerParcelPrimCountTainted = OnParcelPrimCountTainted; |
992 | if (handlerParcelPrimCountTainted != null) | 1632 | if (handlerParcelPrimCountTainted != null) |
993 | { | 1633 | { |
994 | handlerParcelPrimCountTainted(); | 1634 | foreach (ParcelPrimCountTainted d in handlerParcelPrimCountTainted.GetInvocationList()) |
995 | } | 1635 | { |
1636 | try | ||
1637 | { | ||
1638 | d(); | ||
1639 | } | ||
1640 | catch (Exception e) | ||
1641 | { | ||
1642 | m_log.ErrorFormat( | ||
1643 | "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}", | ||
1644 | e.Message, e.StackTrace); | ||
1645 | } | ||
1646 | } | ||
1647 | } | ||
996 | } | 1648 | } |
997 | 1649 | ||
998 | // this lets us keep track of nasty script events like timer, etc. | 1650 | // this lets us keep track of nasty script events like timer, etc. |
@@ -1015,99 +1667,277 @@ namespace OpenSim.Region.Framework.Scenes | |||
1015 | /// <param name="FixedSunHour">The hour 0.0 <= FixedSunHour <= 24.0 at which the sun is fixed at. Sun Hour 0 is sun-rise, when Day/Night ratio is 1:1</param> | 1667 | /// <param name="FixedSunHour">The hour 0.0 <= FixedSunHour <= 24.0 at which the sun is fixed at. Sun Hour 0 is sun-rise, when Day/Night ratio is 1:1</param> |
1016 | public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour) | 1668 | public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour) |
1017 | { | 1669 | { |
1018 | handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; | 1670 | EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; |
1019 | if (handlerEstateToolsSunUpdate != null) | 1671 | if (handlerEstateToolsSunUpdate != null) |
1020 | { | 1672 | { |
1021 | handlerEstateToolsSunUpdate(regionHandle, FixedTime, useEstateTime, FixedSunHour); | 1673 | foreach (EstateToolsSunUpdate d in handlerEstateToolsSunUpdate.GetInvocationList()) |
1022 | } | 1674 | { |
1675 | try | ||
1676 | { | ||
1677 | d(regionHandle, FixedTime, useEstateTime, FixedSunHour); | ||
1678 | } | ||
1679 | catch (Exception e) | ||
1680 | { | ||
1681 | m_log.ErrorFormat( | ||
1682 | "[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}", | ||
1683 | e.Message, e.StackTrace); | ||
1684 | } | ||
1685 | } | ||
1686 | } | ||
1023 | } | 1687 | } |
1024 | 1688 | ||
1025 | public float GetCurrentTimeAsSunLindenHour() | 1689 | public float GetCurrentTimeAsSunLindenHour() |
1026 | { | 1690 | { |
1027 | handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour; | 1691 | SunLindenHour handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour; |
1028 | if (handlerCurrentTimeAsLindenSunHour != null) | 1692 | if (handlerCurrentTimeAsLindenSunHour != null) |
1029 | { | 1693 | { |
1030 | return handlerCurrentTimeAsLindenSunHour(); | 1694 | foreach (SunLindenHour d in handlerCurrentTimeAsLindenSunHour.GetInvocationList()) |
1695 | { | ||
1696 | try | ||
1697 | { | ||
1698 | return d(); | ||
1699 | } | ||
1700 | catch (Exception e) | ||
1701 | { | ||
1702 | m_log.ErrorFormat( | ||
1703 | "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", | ||
1704 | e.Message, e.StackTrace); | ||
1705 | } | ||
1706 | } | ||
1031 | } | 1707 | } |
1708 | |||
1032 | return 6; | 1709 | return 6; |
1033 | } | 1710 | } |
1034 | 1711 | ||
1035 | public void TriggerOarFileLoaded(Guid requestId, string message) | 1712 | public void TriggerOarFileLoaded(Guid requestId, string message) |
1036 | { | 1713 | { |
1037 | handlerOarFileLoaded = OnOarFileLoaded; | 1714 | OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded; |
1038 | if (handlerOarFileLoaded != null) | 1715 | if (handlerOarFileLoaded != null) |
1039 | handlerOarFileLoaded(requestId, message); | 1716 | { |
1717 | foreach (OarFileLoaded d in handlerOarFileLoaded.GetInvocationList()) | ||
1718 | { | ||
1719 | try | ||
1720 | { | ||
1721 | d(requestId, message); | ||
1722 | } | ||
1723 | catch (Exception e) | ||
1724 | { | ||
1725 | m_log.ErrorFormat( | ||
1726 | "[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}", | ||
1727 | e.Message, e.StackTrace); | ||
1728 | } | ||
1729 | } | ||
1730 | } | ||
1040 | } | 1731 | } |
1041 | 1732 | ||
1042 | public void TriggerOarFileSaved(Guid requestId, string message) | 1733 | public void TriggerOarFileSaved(Guid requestId, string message) |
1043 | { | 1734 | { |
1044 | handlerOarFileSaved = OnOarFileSaved; | 1735 | OarFileSaved handlerOarFileSaved = OnOarFileSaved; |
1045 | if (handlerOarFileSaved != null) | 1736 | if (handlerOarFileSaved != null) |
1046 | handlerOarFileSaved(requestId, message); | 1737 | { |
1738 | foreach (OarFileSaved d in handlerOarFileSaved.GetInvocationList()) | ||
1739 | { | ||
1740 | try | ||
1741 | { | ||
1742 | d(requestId, message); | ||
1743 | } | ||
1744 | catch (Exception e) | ||
1745 | { | ||
1746 | m_log.ErrorFormat( | ||
1747 | "[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}", | ||
1748 | e.Message, e.StackTrace); | ||
1749 | } | ||
1750 | } | ||
1751 | } | ||
1047 | } | 1752 | } |
1048 | 1753 | ||
1049 | public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) | 1754 | public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) |
1050 | { | 1755 | { |
1051 | handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue; | 1756 | EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue; |
1052 | if (handlerEmptyScriptCompileQueue != null) | 1757 | if (handlerEmptyScriptCompileQueue != null) |
1053 | handlerEmptyScriptCompileQueue(numScriptsFailed, message); | 1758 | { |
1759 | foreach (EmptyScriptCompileQueue d in handlerEmptyScriptCompileQueue.GetInvocationList()) | ||
1760 | { | ||
1761 | try | ||
1762 | { | ||
1763 | d(numScriptsFailed, message); | ||
1764 | } | ||
1765 | catch (Exception e) | ||
1766 | { | ||
1767 | m_log.ErrorFormat( | ||
1768 | "[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}", | ||
1769 | e.Message, e.StackTrace); | ||
1770 | } | ||
1771 | } | ||
1772 | } | ||
1054 | } | 1773 | } |
1055 | 1774 | ||
1056 | public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) | 1775 | public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) |
1057 | { | 1776 | { |
1058 | handlerCollidingStart = OnScriptColliderStart; | 1777 | ScriptColliding handlerCollidingStart = OnScriptColliderStart; |
1059 | if (handlerCollidingStart != null) | 1778 | if (handlerCollidingStart != null) |
1060 | handlerCollidingStart(localId, colliders); | 1779 | { |
1780 | foreach (ScriptColliding d in handlerCollidingStart.GetInvocationList()) | ||
1781 | { | ||
1782 | try | ||
1783 | { | ||
1784 | d(localId, colliders); | ||
1785 | } | ||
1786 | catch (Exception e) | ||
1787 | { | ||
1788 | m_log.ErrorFormat( | ||
1789 | "[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}", | ||
1790 | e.Message, e.StackTrace); | ||
1791 | } | ||
1792 | } | ||
1793 | } | ||
1061 | } | 1794 | } |
1062 | 1795 | ||
1063 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) | 1796 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) |
1064 | { | 1797 | { |
1065 | handlerColliding = OnScriptColliding; | 1798 | ScriptColliding handlerColliding = OnScriptColliding; |
1066 | if (handlerColliding != null) | 1799 | if (handlerColliding != null) |
1067 | handlerColliding(localId, colliders); | 1800 | { |
1801 | foreach (ScriptColliding d in handlerColliding.GetInvocationList()) | ||
1802 | { | ||
1803 | try | ||
1804 | { | ||
1805 | d(localId, colliders); | ||
1806 | } | ||
1807 | catch (Exception e) | ||
1808 | { | ||
1809 | m_log.ErrorFormat( | ||
1810 | "[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}", | ||
1811 | e.Message, e.StackTrace); | ||
1812 | } | ||
1813 | } | ||
1814 | } | ||
1068 | } | 1815 | } |
1069 | 1816 | ||
1070 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) | 1817 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) |
1071 | { | 1818 | { |
1072 | handlerCollidingEnd = OnScriptCollidingEnd; | 1819 | ScriptColliding handlerCollidingEnd = OnScriptCollidingEnd; |
1073 | if (handlerCollidingEnd != null) | 1820 | if (handlerCollidingEnd != null) |
1074 | handlerCollidingEnd(localId, colliders); | 1821 | { |
1822 | foreach (ScriptColliding d in handlerCollidingEnd.GetInvocationList()) | ||
1823 | { | ||
1824 | try | ||
1825 | { | ||
1826 | d(localId, colliders); | ||
1827 | } | ||
1828 | catch (Exception e) | ||
1829 | { | ||
1830 | m_log.ErrorFormat( | ||
1831 | "[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}", | ||
1832 | e.Message, e.StackTrace); | ||
1833 | } | ||
1834 | } | ||
1835 | } | ||
1075 | } | 1836 | } |
1076 | 1837 | ||
1077 | public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) | 1838 | public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) |
1078 | { | 1839 | { |
1079 | handlerLandCollidingStart = OnScriptLandColliderStart; | 1840 | ScriptColliding handlerLandCollidingStart = OnScriptLandColliderStart; |
1080 | if (handlerLandCollidingStart != null) | 1841 | if (handlerLandCollidingStart != null) |
1081 | handlerLandCollidingStart(localId, colliders); | 1842 | { |
1843 | foreach (ScriptColliding d in handlerLandCollidingStart.GetInvocationList()) | ||
1844 | { | ||
1845 | try | ||
1846 | { | ||
1847 | d(localId, colliders); | ||
1848 | } | ||
1849 | catch (Exception e) | ||
1850 | { | ||
1851 | m_log.ErrorFormat( | ||
1852 | "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}", | ||
1853 | e.Message, e.StackTrace); | ||
1854 | } | ||
1855 | } | ||
1856 | } | ||
1082 | } | 1857 | } |
1083 | 1858 | ||
1084 | public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) | 1859 | public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) |
1085 | { | 1860 | { |
1086 | handlerLandColliding = OnScriptLandColliding; | 1861 | ScriptColliding handlerLandColliding = OnScriptLandColliding; |
1087 | if (handlerLandColliding != null) | 1862 | if (handlerLandColliding != null) |
1088 | handlerLandColliding(localId, colliders); | 1863 | { |
1864 | foreach (ScriptColliding d in handlerLandColliding.GetInvocationList()) | ||
1865 | { | ||
1866 | try | ||
1867 | { | ||
1868 | d(localId, colliders); | ||
1869 | } | ||
1870 | catch (Exception e) | ||
1871 | { | ||
1872 | m_log.ErrorFormat( | ||
1873 | "[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}", | ||
1874 | e.Message, e.StackTrace); | ||
1875 | } | ||
1876 | } | ||
1877 | } | ||
1089 | } | 1878 | } |
1090 | 1879 | ||
1091 | public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) | 1880 | public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) |
1092 | { | 1881 | { |
1093 | handlerLandCollidingEnd = OnScriptLandColliderEnd; | 1882 | ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd; |
1094 | if (handlerLandCollidingEnd != null) | 1883 | if (handlerLandCollidingEnd != null) |
1095 | handlerLandCollidingEnd(localId, colliders); | 1884 | { |
1885 | foreach (ScriptColliding d in handlerLandCollidingEnd.GetInvocationList()) | ||
1886 | { | ||
1887 | try | ||
1888 | { | ||
1889 | d(localId, colliders); | ||
1890 | } | ||
1891 | catch (Exception e) | ||
1892 | { | ||
1893 | m_log.ErrorFormat( | ||
1894 | "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}", | ||
1895 | e.Message, e.StackTrace); | ||
1896 | } | ||
1897 | } | ||
1898 | } | ||
1096 | } | 1899 | } |
1097 | 1900 | ||
1098 | public void TriggerSetRootAgentScene(UUID agentID, Scene scene) | 1901 | public void TriggerSetRootAgentScene(UUID agentID, Scene scene) |
1099 | { | 1902 | { |
1100 | handlerSetRootAgentScene = OnSetRootAgentScene; | 1903 | OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene; |
1101 | if (handlerSetRootAgentScene != null) | 1904 | if (handlerSetRootAgentScene != null) |
1102 | handlerSetRootAgentScene(agentID, scene); | 1905 | { |
1906 | foreach (OnSetRootAgentSceneDelegate d in handlerSetRootAgentScene.GetInvocationList()) | ||
1907 | { | ||
1908 | try | ||
1909 | { | ||
1910 | d(agentID, scene); | ||
1911 | } | ||
1912 | catch (Exception e) | ||
1913 | { | ||
1914 | m_log.ErrorFormat( | ||
1915 | "[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}", | ||
1916 | e.Message, e.StackTrace); | ||
1917 | } | ||
1918 | } | ||
1919 | } | ||
1103 | } | 1920 | } |
1104 | 1921 | ||
1105 | public void TriggerOnRegionUp(GridRegion otherRegion) | 1922 | public void TriggerOnRegionUp(GridRegion otherRegion) |
1106 | { | 1923 | { |
1107 | handlerOnRegionUp = OnRegionUp; | 1924 | RegionUp handlerOnRegionUp = OnRegionUp; |
1108 | if (handlerOnRegionUp != null) | 1925 | if (handlerOnRegionUp != null) |
1109 | handlerOnRegionUp(otherRegion); | 1926 | { |
1927 | foreach (RegionUp d in handlerOnRegionUp.GetInvocationList()) | ||
1928 | { | ||
1929 | try | ||
1930 | { | ||
1931 | d(otherRegion); | ||
1932 | } | ||
1933 | catch (Exception e) | ||
1934 | { | ||
1935 | m_log.ErrorFormat( | ||
1936 | "[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}", | ||
1937 | e.Message, e.StackTrace); | ||
1938 | } | ||
1939 | } | ||
1940 | } | ||
1110 | } | 1941 | } |
1111 | |||
1112 | } | 1942 | } |
1113 | } | 1943 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 73b0b3e..ff2be05 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2496,20 +2496,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
2496 | 2496 | ||
2497 | //RootPrim.SetParentLocalId(parentLocalID); | 2497 | //RootPrim.SetParentLocalId(parentLocalID); |
2498 | 2498 | ||
2499 | m_log.DebugFormat("[ATTACHMENT]: Received " + | 2499 | m_log.DebugFormat( |
2500 | "attachment {0}, inworld asset id {1}", | 2500 | "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", |
2501 | //grp.RootPart.LastOwnerID.ToString(), | 2501 | //grp.RootPart.LastOwnerID.ToString(), |
2502 | grp.GetFromItemID(), | 2502 | grp.GetFromItemID(), |
2503 | grp.UUID.ToString()); | 2503 | grp.UUID.ToString()); |
2504 | 2504 | ||
2505 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); | 2505 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); |
2506 | m_log.DebugFormat("[ATTACHMENT]: Attach " + | 2506 | m_log.DebugFormat( |
2507 | "to avatar {0} at position {1}", | 2507 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID.ToString(), grp.AbsolutePosition); |
2508 | sp.UUID.ToString(), grp.AbsolutePosition); | 2508 | |
2509 | AttachObject(sp.ControllingClient, | 2509 | if ( |
2510 | grp.LocalId, (uint)0, | 2510 | AttachObject( |
2511 | grp.GroupRotation, | 2511 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false)) |
2512 | grp.AbsolutePosition, false); | 2512 | { |
2513 | // Do this last so that event listeners have access to all the effects of the attachment | ||
2514 | EventManager.TriggerOnAttach(grp.LocalId, UUID.Zero, sp.UUID); | ||
2515 | } | ||
2516 | |||
2513 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2517 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2514 | grp.SendGroupFullUpdate(); | 2518 | grp.SendGroupFullUpdate(); |
2515 | } | 2519 | } |
@@ -2518,7 +2522,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2518 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2522 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2519 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2523 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2520 | } | 2524 | } |
2521 | |||
2522 | } | 2525 | } |
2523 | else | 2526 | else |
2524 | { | 2527 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1ac061a..b508af5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -627,11 +627,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
627 | } | 627 | } |
628 | 628 | ||
629 | m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); | 629 | m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); |
630 | |||
631 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | 630 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); |
631 | |||
632 | // In case it is later dropped again, don't let | 632 | // In case it is later dropped again, don't let |
633 | // it get cleaned up | 633 | // it get cleaned up |
634 | // | ||
635 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | 634 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); |
636 | group.HasGroupChanged = false; | 635 | group.HasGroupChanged = false; |
637 | } | 636 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 61ba4da..8d84557 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -113,6 +113,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
113 | 113 | ||
114 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 114 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
115 | 115 | ||
116 | /// <value> | ||
117 | /// Is this sop a root part? | ||
118 | /// </value> | ||
119 | [XmlIgnore] | ||
120 | public bool IsRoot | ||
121 | { | ||
122 | get { return ParentGroup.RootPart == this; } | ||
123 | } | ||
124 | |||
116 | // use only one serializer to give the runtime a chance to optimize it (it won't do that if you | 125 | // use only one serializer to give the runtime a chance to optimize it (it won't do that if you |
117 | // use a new instance every time) | 126 | // use a new instance every time) |
118 | private static XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); | 127 | private static XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 87c1a95..298ede9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -44,8 +44,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | static System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); | ||
48 | |||
49 | private string m_inventoryFileName = String.Empty; | 47 | private string m_inventoryFileName = String.Empty; |
50 | private int m_inventoryFileNameSerial = 0; | 48 | private int m_inventoryFileNameSerial = 0; |
51 | 49 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e26283d..cd39cab 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2783,11 +2783,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2783 | { | 2783 | { |
2784 | m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); | 2784 | m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); |
2785 | } | 2785 | } |
2786 | catch(Exception ex) | 2786 | catch |
2787 | { | 2787 | { |
2788 | m_scene.CrossAgentToNewRegion(this, false); | 2788 | m_scene.CrossAgentToNewRegion(this, false); |
2789 | } | 2789 | } |
2790 | |||
2791 | } | 2790 | } |
2792 | 2791 | ||
2793 | public void InTransit() | 2792 | public void InTransit() |
@@ -2865,7 +2864,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2865 | { | 2864 | { |
2866 | RemoveNeighbourRegion(handle); | 2865 | RemoveNeighbourRegion(handle); |
2867 | } | 2866 | } |
2868 | |||
2869 | } | 2867 | } |
2870 | 2868 | ||
2871 | #endregion | 2869 | #endregion |
@@ -3026,7 +3024,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3026 | List<int> attPoints = m_appearance.GetAttachedPoints(); | 3024 | List<int> attPoints = m_appearance.GetAttachedPoints(); |
3027 | if (attPoints != null) | 3025 | if (attPoints != null) |
3028 | { | 3026 | { |
3029 | m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); | 3027 | //m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); |
3030 | int i = 0; | 3028 | int i = 0; |
3031 | AttachmentData[] attachs = new AttachmentData[attPoints.Count]; | 3029 | AttachmentData[] attachs = new AttachmentData[attPoints.Count]; |
3032 | foreach (int point in attPoints) | 3030 | foreach (int point in attPoints) |
@@ -3276,9 +3274,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3276 | } | 3274 | } |
3277 | if (m_health <= 0) | 3275 | if (m_health <= 0) |
3278 | m_scene.EventManager.TriggerAvatarKill(killerObj, this); | 3276 | m_scene.EventManager.TriggerAvatarKill(killerObj, this); |
3279 | } | 3277 | } |
3280 | |||
3281 | |||
3282 | } | 3278 | } |
3283 | 3279 | ||
3284 | public void setHealthWithUpdate(float health) | 3280 | public void setHealthWithUpdate(float health) |