aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
authorDr Scofield2008-05-26 15:37:31 +0000
committerDr Scofield2008-05-26 15:37:31 +0000
commit1bb1d5d9b06887380eec0696102eb859f04810e6 (patch)
treefecd69763a3daeba464a1bcbc1349828dd9445b3 /OpenSim/Region/Environment/Modules
parentAdding OnChatBroadcast event logic to EventManager providing (diff)
downloadopensim-SC_OLD-1bb1d5d9b06887380eec0696102eb859f04810e6.zip
opensim-SC_OLD-1bb1d5d9b06887380eec0696102eb859f04810e6.tar.gz
opensim-SC_OLD-1bb1d5d9b06887380eec0696102eb859f04810e6.tar.bz2
opensim-SC_OLD-1bb1d5d9b06887380eec0696102eb859f04810e6.tar.xz
This cleans up a merge mess from the earlier checkin and implements llOwnerSay()
via the newly created Scene.SimBroadcast() call.
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs34
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs29
2 files changed, 28 insertions, 35 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
index e12588c..c3fc26e 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
107 #region ISimChat Members 107 #region ISimChat Members
108 public void SimBroadcast(Object sender, ChatFromViewerArgs c) 108 public void SimBroadcast(Object sender, ChatFromViewerArgs c)
109 { 109 {
110 // We only want to relay stuff on channel 0 110 // We only want to relay stuff on channel 0 and on the debug channel
111 if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; 111 if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return;
112 112
113 if (c.Channel == DEBUG_CHANNEL) 113 if (c.Channel == DEBUG_CHANNEL)
@@ -118,13 +118,25 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
118 LLVector3 pos = new LLVector3(128, 128, 30); 118 LLVector3 pos = new LLVector3(128, 128, 30);
119 ((Scene)c.Scene).ForEachScenePresence(delegate(ScenePresence presence) 119 ((Scene)c.Scene).ForEachScenePresence(delegate(ScenePresence presence)
120 { 120 {
121 if (!presence.IsChildAgent) return; 121 if (presence.IsChildAgent) return;
122
123 IClientAPI client = presence.ControllingClient;
124
125 if ((c.Type == ChatTypeEnum.Owner) &&
126 (null != c.SenderObject) &&
127 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
128 return;
122 129
123 presence.ControllingClient.SendChatMessage(c.Message, 130 if (null == c.SenderObject)
124 1, //255, 131 client.SendChatMessage(c.Message, (byte)c.Type,
125 pos, c.From, LLUUID.Zero, 132 pos, c.From, LLUUID.Zero,
126 c.Channel == DEBUG_CHANNEL? (byte)ChatSourceType.Object : (byte)ChatSourceType.Agent, 133 (byte)ChatSourceType.Agent,
127 (byte)ChatAudibleLevel.Fully); 134 (byte)ChatAudibleLevel.Fully);
135 else
136 client.SendChatMessage(c.Message, (byte)c.Type,
137 pos, c.From, LLUUID.Zero,
138 (byte)ChatSourceType.Object,
139 (byte)ChatAudibleLevel.Fully);
128 }); 140 });
129 } 141 }
130 142
@@ -147,7 +159,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
147 159
148 string fromName = e.From; 160 string fromName = e.From;
149 string message = e.Message; 161 string message = e.Message;
150 LLUUID fromAgentID = e.SenderUUID; 162 LLUUID fromID = e.SenderUUID;
151 163
152 if (e.Sender != null) 164 if (e.Sender != null)
153 { 165 {
@@ -160,7 +172,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
160 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, 172 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize,
161 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); 173 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
162 fromName = avatar.Firstname + " " + avatar.Lastname; 174 fromName = avatar.Firstname + " " + avatar.Lastname;
163 fromAgentID = e.Sender.AgentId; 175 fromID = e.Sender.AgentId;
164 } 176 }
165 177
166 if (e.Channel == DEBUG_CHANNEL) 178 if (e.Channel == DEBUG_CHANNEL)
@@ -175,13 +187,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
175 if (e.Channel == DEBUG_CHANNEL) 187 if (e.Channel == DEBUG_CHANNEL)
176 { 188 {
177 TrySendChatMessage(presence, fromPos, regionPos, 189 TrySendChatMessage(presence, fromPos, regionPos,
178 fromAgentID, fromName, e.Type, 190 fromID, fromName, e.Type,
179 message, ChatSourceType.Object); 191 message, ChatSourceType.Object);
180 } 192 }
181 else 193 else
182 { 194 {
183 TrySendChatMessage(presence, fromPos, regionPos, 195 TrySendChatMessage(presence, fromPos, regionPos,
184 fromAgentID, fromName, e.Type, 196 fromID, fromName, e.Type,
185 message, ChatSourceType.Agent); 197 message, ChatSourceType.Agent);
186 } 198 }
187 }); 199 });
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
index 18106be..452ea7b 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
@@ -88,6 +88,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
88 { 88 {
89 m_irc = new IRCChatModule(config); 89 m_irc = new IRCChatModule(config);
90 } 90 }
91
91 if (m_irc_connector == null) 92 if (m_irc_connector == null)
92 { 93 {
93 m_irc_connector = new Thread(IRCConnectRun); 94 m_irc_connector = new Thread(IRCConnectRun);
@@ -183,6 +184,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
183 m_irc_connector.Name = "IRCConnectorThread"; 184 m_irc_connector.Name = "IRCConnectorThread";
184 m_irc_connector.IsBackground = true; 185 m_irc_connector.IsBackground = true;
185 } 186 }
187
186 if (!m_irc_connector.IsAlive) 188 if (!m_irc_connector.IsAlive)
187 { 189 {
188 m_irc_connector.Start(); 190 m_irc_connector.Start();
@@ -196,20 +198,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
196 198
197 if (e.Message.StartsWith("/me ") && (null != avatar)) 199 if (e.Message.StartsWith("/me ") && (null != avatar))
198 e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4)); 200 e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4));
199 if (e.Channel == 0 || e.Channel == DEBUG_CHANNEL) 201
200 { 202 // this is to keep objects from talking to IRC
201 if (e.Channel == DEBUG_CHANNEL) 203 if (m_irc.Connected && (avatar != null))
202 e.Type = ChatTypeEnum.DebugChannel;
203
204 // IRC stuff
205 if (e.Message.Length > 0 && e.Channel == 0)
206 {
207 if (m_irc.Connected && (avatar != null)) // this is to keep objects from talking to IRC
208 {
209 m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message); 204 m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
210 }
211 }
212 }
213 } 205 }
214 206
215 #endregion 207 #endregion
@@ -529,14 +521,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
529 // Get some direct matches $1 $4 is a 521 // Get some direct matches $1 $4 is a
530 if ((matches.Count == 0) || (matches.Count != 1) || (matches[0].Groups.Count != 5)) 522 if ((matches.Count == 0) || (matches.Count != 1) || (matches[0].Groups.Count != 5))
531 { 523 {
532 result = new Dictionary<string, string>();
533 result.Add("nick", matches[0].Groups[1].Value);
534 result.Add("user", matches[0].Groups[2].Value);
535 result.Add("channel", matches[0].Groups[3].Value);
536 result.Add("msg", matches[0].Groups[4].Value);
537 }
538 else
539 {
540 m_log.Info("[IRC]: Number of matches: " + matches.Count); 524 m_log.Info("[IRC]: Number of matches: " + matches.Count);
541 if (matches.Count > 0) 525 if (matches.Count > 0)
542 { 526 {
@@ -641,7 +625,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
641 625
642 public void BroadcastSim(string sender, string format, params string[] args) 626 public void BroadcastSim(string sender, string format, params string[] args)
643 { 627 {
644 LLVector3 pos = new LLVector3(128, 128, 20);
645 try 628 try
646 { 629 {
647 ChatFromViewerArgs c = new ChatFromViewerArgs(); 630 ChatFromViewerArgs c = new ChatFromViewerArgs();
@@ -781,8 +764,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
781 764
782 public void eventIrcMode(string[] commArgs) 765 public void eventIrcMode(string[] commArgs)
783 { 766 {
784 string IrcChannel = commArgs[2];
785 string IrcUser = commArgs[0].Split('!')[0];
786 string UserMode = ""; 767 string UserMode = "";
787 for (int i = 3; i < commArgs.Length; i++) 768 for (int i = 3; i < commArgs.Length; i++)
788 { 769 {