diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index e923932..33069da 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -297,6 +297,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
297 | public event ChatFromClientEvent OnChatFromClient; | 297 | public event ChatFromClientEvent OnChatFromClient; |
298 | 298 | ||
299 | /// <summary> | 299 | /// <summary> |
300 | /// ChatToClientsEvent is triggered via ChatModule (or | ||
301 | /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a | ||
302 | /// received chat message if they satisfy various conditions (within audible range, etc.) | ||
303 | /// </summary> | ||
304 | public delegate void ChatToClientsEvent( | ||
305 | UUID senderID, HashSet<UUID> receiverIDs, | ||
306 | string message, ChatTypeEnum type, Vector3 fromPos, string fromName, | ||
307 | ChatSourceType src, ChatAudibleLevel level); | ||
308 | public event ChatToClientsEvent OnChatToClients; | ||
309 | |||
310 | /// <summary> | ||
300 | /// ChatBroadcastEvent is called via Scene when a broadcast chat message | 311 | /// ChatBroadcastEvent is called via Scene when a broadcast chat message |
301 | /// from world comes in | 312 | /// from world comes in |
302 | /// </summary> | 313 | /// </summary> |
@@ -1627,6 +1638,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
1627 | } | 1638 | } |
1628 | } | 1639 | } |
1629 | } | 1640 | } |
1641 | |||
1642 | public void TriggerOnChatToClients( | ||
1643 | UUID senderID, HashSet<UUID> receiverIDs, | ||
1644 | string message, ChatTypeEnum type, Vector3 fromPos, string fromName, | ||
1645 | ChatSourceType src, ChatAudibleLevel level) | ||
1646 | { | ||
1647 | ChatToClientsEvent handler = OnChatToClients; | ||
1648 | if (handler != null) | ||
1649 | { | ||
1650 | foreach (ChatToClientsEvent d in handler.GetInvocationList()) | ||
1651 | { | ||
1652 | try | ||
1653 | { | ||
1654 | d(senderID, receiverIDs, message, type, fromPos, fromName, src, level); | ||
1655 | } | ||
1656 | catch (Exception e) | ||
1657 | { | ||
1658 | m_log.ErrorFormat( | ||
1659 | "[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}", | ||
1660 | e.Message, e.StackTrace); | ||
1661 | } | ||
1662 | } | ||
1663 | } | ||
1664 | } | ||
1630 | 1665 | ||
1631 | public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) | 1666 | public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) |
1632 | { | 1667 | { |