mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Allow region modules to know which agents actually receive chat
This commit is contained in:
committed by
Jonathan Freedman
parent
481a44104e
commit
e06acae965
@@ -292,6 +292,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public delegate void ChatFromClientEvent(Object sender, OSChatMessage chat);
|
||||
public event ChatFromClientEvent OnChatFromClient;
|
||||
|
||||
/// <summary>
|
||||
/// ChatToClientsEvent is triggered via ChatModule (or
|
||||
/// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a
|
||||
/// received chat message if they satisfy various conditions (within audible range, etc.)
|
||||
/// </summary>
|
||||
public delegate void ChatToClientsEvent(
|
||||
UUID senderID, HashSet<UUID> receiverIDs,
|
||||
string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
|
||||
ChatSourceType src, ChatAudibleLevel level);
|
||||
public event ChatToClientsEvent OnChatToClients;
|
||||
|
||||
/// <summary>
|
||||
/// ChatBroadcastEvent is called via Scene when a broadcast chat message
|
||||
/// from world comes in
|
||||
@@ -1603,6 +1614,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerOnChatToClients(
|
||||
UUID senderID, HashSet<UUID> receiverIDs,
|
||||
string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
|
||||
ChatSourceType src, ChatAudibleLevel level)
|
||||
{
|
||||
ChatToClientsEvent handler = OnChatToClients;
|
||||
if (handler != null)
|
||||
{
|
||||
foreach (ChatToClientsEvent d in handler.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(senderID, receiverIDs, message, type, fromPos, fromName, src, level);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user