diff options
author | Dr Scofield | 2008-10-03 14:53:11 +0000 |
---|---|---|
committer | Dr Scofield | 2008-10-03 14:53:11 +0000 |
commit | 5c0a0bc2e0951745fd52f5c01f2ee2c0aee49a3a (patch) | |
tree | 529c2c8e3ea8f1193f2495f905e542ff1462adb6 /OpenSim/Region/Examples/SimpleModule | |
parent | * minor: remove warnings (the code cleaners strike again) (diff) | |
download | opensim-SC-5c0a0bc2e0951745fd52f5c01f2ee2c0aee49a3a.zip opensim-SC-5c0a0bc2e0951745fd52f5c01f2ee2c0aee49a3a.tar.gz opensim-SC-5c0a0bc2e0951745fd52f5c01f2ee2c0aee49a3a.tar.bz2 opensim-SC-5c0a0bc2e0951745fd52f5c01f2ee2c0aee49a3a.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Examples/SimpleModule')
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 6d69247..fa6ff22 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
55 | public event Action<IClientAPI> OnConnectionClosed; | 55 | public event Action<IClientAPI> OnConnectionClosed; |
56 | 56 | ||
57 | public event ImprovedInstantMessage OnInstantMessage; | 57 | public event ImprovedInstantMessage OnInstantMessage; |
58 | public event ChatMessage OnChatFromViewer; | 58 | public event ChatMessage OnChatFromClient; |
59 | public event TextureRequest OnRequestTexture; | 59 | public event TextureRequest OnRequestTexture; |
60 | public event RezObject OnRezObject; | 60 | public event RezObject OnRezObject; |
61 | public event ModifyTerrain OnModifyTerrain; | 61 | public event ModifyTerrain OnModifyTerrain; |
@@ -696,7 +696,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
696 | 696 | ||
697 | if (count >= 10) | 697 | if (count >= 10) |
698 | { | 698 | { |
699 | if (OnChatFromViewer != null) | 699 | if (OnChatFromClient != null) |
700 | { | 700 | { |
701 | OSChatMessage args = new OSChatMessage(); | 701 | OSChatMessage args = new OSChatMessage(); |
702 | args.Message = "Hey You! Get out of my Home. This is my Region"; | 702 | args.Message = "Hey You! Get out of my Home. This is my Region"; |
@@ -706,7 +706,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
706 | args.Sender = this; | 706 | args.Sender = this; |
707 | args.Type = ChatTypeEnum.Shout; | 707 | args.Type = ChatTypeEnum.Shout; |
708 | 708 | ||
709 | OnChatFromViewer(this, args); | 709 | OnChatFromClient(this, args); |
710 | } | 710 | } |
711 | count = -1; | 711 | count = -1; |
712 | } | 712 | } |