aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
authorDr Scofield2008-05-23 10:24:26 +0000
committerDr Scofield2008-05-23 10:24:26 +0000
commitbf23e5d66cf091d310c660877380f3727d0b0234 (patch)
tree79126b3d3a900d47cae0bf6a59f19de22a0faada /OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
parentThank you kindly, Melanie, for: (diff)
downloadopensim-SC-bf23e5d66cf091d310c660877380f3727d0b0234.zip
opensim-SC-bf23e5d66cf091d310c660877380f3727d0b0234.tar.gz
opensim-SC-bf23e5d66cf091d310c660877380f3727d0b0234.tar.bz2
opensim-SC-bf23e5d66cf091d310c660877380f3727d0b0234.tar.xz
i've refactored the ChatModule into two modules: ChatModule and IRCBridgeModule.
ChatModule is now only doing in-world chat. IRCBridgeModule is only doing, well, bridging chat to/from IRC. Both modules are now using a new OnChatFromWorld event handler (which Scene.PacketHandler is feeding for chat from in-world instead of going via the Interface method). This refactoring will allow us to easily add other bridge modules (e.g., an XMPP bridge module). there is still a bug in IRCBridgeModule (inherited from the old ChatModule) where FindClientRegion does not really find the client region...
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs33
1 files changed, 15 insertions, 18 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 1b25f13..9eb86cb 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -45,28 +45,25 @@ namespace OpenSim.Region.Environment.Scenes
45 public void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, 45 public void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName,
46 LLUUID fromAgentID) 46 LLUUID fromAgentID)
47 { 47 {
48 if (m_simChatModule != null) 48 ChatFromViewerArgs args = new ChatFromViewerArgs();
49 {
50 ChatFromViewerArgs args = new ChatFromViewerArgs();
51
52 args.Message = Helpers.FieldToUTF8String(message);
53 args.Channel = channel;
54 args.Type = type;
55 args.Position = fromPos;
56 args.SenderUUID = fromAgentID;
57 49
50 args.Message = Helpers.FieldToUTF8String(message);
51 args.Channel = channel;
52 args.Type = type;
53 args.Position = fromPos;
54 args.SenderUUID = fromAgentID;
55 args.Scene = this;
58 56
59 ScenePresence user = GetScenePresence(fromAgentID); 57 ScenePresence user = GetScenePresence(fromAgentID);
60 if (user != null) 58 if (user != null)
61 args.Sender = user.ControllingClient; 59 args.Sender = user.ControllingClient;
62 else 60 else
63 args.Sender = null; 61 args.Sender = null;
64 62
65 args.From = fromName; 63 args.From = fromName;
66 //args. 64 //args.
67 65
68 m_simChatModule.SimChat(this, args); 66 EventManager.TriggerOnChatFromWorld(this, args);
69 }
70 } 67 }
71 68
72 /// <summary> 69 /// <summary>