This changeset changes the way chat from client is routed:

old way: each region module interested in chat from client had to
     	 - subscribe to scene.EventManager.OnNewClient
	 - then in its OnNewClient delegate it would subscribe to
           client.OnChatFromViewer to capture chat messages coming

     new way: ChatModule is the only region module that uses the "old
         way" approach but is now forwarding all client chat via
         scene.EventManager.OnChatFromClient
	 - each region module interested in chat from client now only
           subscribes to scene.EventManager.OnChatFromClient

this not only simplifies code, but also allows us to substitute
ChatModule with derived classes (ConciergeModule is going to be one
example).

Also, this changeset changes ChatFromViewer to ChatFromClient as it
doesn't necessarily have to be a viewer that is a chat source.

i've taken great care to only comment out those OnNewClient delegates
that were only used for getting at the client chat --- hope it's not
breaking anything.
This commit is contained in:
Dr Scofield
2008-10-03 14:53:11 +00:00
parent 8c55f3eaa6
commit 5c0a0bc2e0
11 changed files with 216 additions and 179 deletions

View File

@@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
m_scene = scene;
m_scene.RegisterModuleInterface<IWorldComm>(this);
m_listenerManager = new ListenerManager(maxlisteners, maxhandles);
m_scene.EventManager.OnNewClient += NewClient;
m_scene.EventManager.OnChatFromClient += DeliverClientMessage;
m_pendingQ = new Queue();
m_pending = Queue.Synchronized(m_pendingQ);
}
@@ -203,7 +203,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
/// enqueue the message for delivery to the objects listen event handler.
/// The enqueued ListenerInfo no longer has filter values, but the actually trigged values.
/// Objects that do an llSay have their messages delivered here and for nearby avatars,
/// the OnChatFromViewer event is used.
/// the OnChatFromClient event is used.
/// </summary>
/// <param name="type">type of delvery (whisper,say,shout or regionwide)</param>
/// <param name="channel">channel to sent on</param>
@@ -311,10 +311,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
#endregion
private void NewClient(IClientAPI client)
{
client.OnChatFromViewer += DeliverClientMessage;
}
// private void NewClient(IClientAPI client)
// {
// client.OnChatFromViewer += DeliverClientMessage;
// }
/********************************************************************
*