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

@@ -55,7 +55,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event Action<IClientAPI> OnConnectionClosed;
public event ImprovedInstantMessage OnInstantMessage;
public event ChatMessage OnChatFromViewer;
public event ChatMessage OnChatFromClient;
public event TextureRequest OnRequestTexture;
public event RezObject OnRezObject;
public event ModifyTerrain OnModifyTerrain;
@@ -696,7 +696,7 @@ namespace OpenSim.Region.Examples.SimpleModule
if (count >= 10)
{
if (OnChatFromViewer != null)
if (OnChatFromClient != null)
{
OSChatMessage args = new OSChatMessage();
args.Message = "Hey You! Get out of my Home. This is my Region";
@@ -706,7 +706,7 @@ namespace OpenSim.Region.Examples.SimpleModule
args.Sender = this;
args.Type = ChatTypeEnum.Shout;
OnChatFromViewer(this, args);
OnChatFromClient(this, args);
}
count = -1;
}