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/Environment/Modules/World | |
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/Environment/Modules/World')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 78aee92..33eade2 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -59,22 +59,22 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
59 | 59 | ||
60 | public void Say(string message) | 60 | public void Say(string message) |
61 | { | 61 | { |
62 | SendOnChatFromViewer(message, ChatTypeEnum.Say); | 62 | SendOnChatFromClient(message, ChatTypeEnum.Say); |
63 | } | 63 | } |
64 | 64 | ||
65 | public void Shout(string message) | 65 | public void Shout(string message) |
66 | { | 66 | { |
67 | SendOnChatFromViewer(message, ChatTypeEnum.Shout); | 67 | SendOnChatFromClient(message, ChatTypeEnum.Shout); |
68 | } | 68 | } |
69 | 69 | ||
70 | public void Whisper(string message) | 70 | public void Whisper(string message) |
71 | { | 71 | { |
72 | SendOnChatFromViewer(message, ChatTypeEnum.Whisper); | 72 | SendOnChatFromClient(message, ChatTypeEnum.Whisper); |
73 | } | 73 | } |
74 | 74 | ||
75 | public void Broadcast(string message) | 75 | public void Broadcast(string message) |
76 | { | 76 | { |
77 | SendOnChatFromViewer(message, ChatTypeEnum.Broadcast); | 77 | SendOnChatFromClient(message, ChatTypeEnum.Broadcast); |
78 | } | 78 | } |
79 | 79 | ||
80 | public void GiveMoney(UUID target, int amount) | 80 | public void GiveMoney(UUID target, int amount) |
@@ -132,19 +132,19 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
132 | 132 | ||
133 | #region Internal Functions | 133 | #region Internal Functions |
134 | 134 | ||
135 | private void SendOnChatFromViewer(string message, ChatTypeEnum chatType) | 135 | private void SendOnChatFromClient(string message, ChatTypeEnum chatType) |
136 | { | 136 | { |
137 | OSChatMessage chatFromViewer = new OSChatMessage(); | 137 | OSChatMessage chatFromClient = new OSChatMessage(); |
138 | chatFromViewer.Channel = 0; | 138 | chatFromClient.Channel = 0; |
139 | chatFromViewer.From = Name; | 139 | chatFromClient.From = Name; |
140 | chatFromViewer.Message = message; | 140 | chatFromClient.Message = message; |
141 | chatFromViewer.Position = StartPos; | 141 | chatFromClient.Position = StartPos; |
142 | chatFromViewer.Scene = m_scene; | 142 | chatFromClient.Scene = m_scene; |
143 | chatFromViewer.Sender = this; | 143 | chatFromClient.Sender = this; |
144 | chatFromViewer.SenderUUID = AgentId; | 144 | chatFromClient.SenderUUID = AgentId; |
145 | chatFromViewer.Type = chatType; | 145 | chatFromClient.Type = chatType; |
146 | 146 | ||
147 | OnChatFromViewer(this, chatFromViewer); | 147 | OnChatFromClient(this, chatFromClient); |
148 | } | 148 | } |
149 | 149 | ||
150 | #endregion | 150 | #endregion |
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
161 | public event Action<IClientAPI> OnConnectionClosed; | 161 | public event Action<IClientAPI> OnConnectionClosed; |
162 | public event GenericMessage OnGenericMessage; | 162 | public event GenericMessage OnGenericMessage; |
163 | public event ImprovedInstantMessage OnInstantMessage; | 163 | public event ImprovedInstantMessage OnInstantMessage; |
164 | public event ChatMessage OnChatFromViewer; | 164 | public event ChatMessage OnChatFromClient; |
165 | public event TextureRequest OnRequestTexture; | 165 | public event TextureRequest OnRequestTexture; |
166 | public event RezObject OnRezObject; | 166 | public event RezObject OnRezObject; |
167 | public event ModifyTerrain OnModifyTerrain; | 167 | public event ModifyTerrain OnModifyTerrain; |