From 0b4e15bc3586422d273bd8845962a2db681230e2 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 8 Nov 2007 03:11:10 +0000 Subject: converted hard-coded chat type values to ChatTypeEnum --- OpenSim/Region/Environment/Interfaces/IWorldComm.cs | 3 ++- OpenSim/Region/Environment/Modules/WorldCommModule.cs | 14 +++++++------- OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Interfaces/IWorldComm.cs b/OpenSim/Region/Environment/Interfaces/IWorldComm.cs index 27b5466..d8811c6 100644 --- a/OpenSim/Region/Environment/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Environment/Interfaces/IWorldComm.cs @@ -27,6 +27,7 @@ */ using libsecondlife; +using OpenSim.Framework; using OpenSim.Region.Environment.Modules; namespace OpenSim.Region.Environment.Interfaces @@ -34,7 +35,7 @@ namespace OpenSim.Region.Environment.Interfaces public interface IWorldComm { int Listen(uint LocalID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg); - void DeliverMessage(string sourceItemID, int type, int channel, string name, string msg); + void DeliverMessage(string sourceItemID, ChatTypeEnum type, int channel, string name, string msg); bool HasMessages(); ListenerInfo GetNextMessage(); void ListenControl(int handle, int active); diff --git a/OpenSim/Region/Environment/Modules/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/WorldCommModule.cs index 7a631d7..a31b484 100644 --- a/OpenSim/Region/Environment/Modules/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/WorldCommModule.cs @@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Modules private void DeliverClientMessage(Object sender, ChatFromViewerArgs e) { DeliverMessage(e.Sender.AgentId.ToString(), - (int) e.Type, e.Channel, + e.Type, e.Channel, e.Sender.FirstName + " " + e.Sender.LastName, e.Message); } @@ -140,8 +140,8 @@ namespace OpenSim.Region.Environment.Modules // and if so if this message fits the filter. If it does, then // enqueue the message for delivery to the objects listen event handler. // Objects that do an llSay have their messages delivered here, and for - // nearby avatards, the SimChat function is used. - public void DeliverMessage(string sourceItemID, int type, int channel, string name, string msg) + // nearby avatars, the SimChat function is used. + public void DeliverMessage(string sourceItemID, ChatTypeEnum type, int channel, string name, string msg) { SceneObjectPart source = null; ScenePresence avatar = null; @@ -177,7 +177,7 @@ namespace OpenSim.Region.Environment.Modules switch (type) { - case 0: // Whisper + case ChatTypeEnum.Whisper: if ((dis < 10) && (dis > -10)) { @@ -191,7 +191,7 @@ namespace OpenSim.Region.Environment.Modules } break; - case 1: // Say + case ChatTypeEnum.Say: if ((dis < 30) && (dis > -30)) { @@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Modules } break; - case 2: // Shout + case ChatTypeEnum.Shout: if ((dis < 100) && (dis > -100)) { ListenerInfo isListener = m_listenerManager.IsListenerMatch( @@ -218,7 +218,7 @@ namespace OpenSim.Region.Environment.Modules } break; - case 0xff: // Broadcast + case ChatTypeEnum.Broadcast: ListenerInfo isListen = m_listenerManager.IsListenerMatch(sourceItemID, eb, channel, name, msg); if (isListen != null) diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index a9f6991..a57041b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -65,7 +65,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName, + public void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, LLUUID fromAgentID) { if (m_simChatModule != null) @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes args.Message = Util.FieldToString(message); args.Channel = channel; - args.Type = (ChatTypeEnum) type; + args.Type = type; args.Position = fromPos; ScenePresence user = GetScenePresence(fromAgentID); -- cgit v1.1