aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-10-25 03:26:12 +0100
committerJustin Clark-Casey (justincc)2012-10-25 03:26:12 +0100
commitc13a99dc5cc82efac5497dab27dcb6b0d9865cea (patch)
treed9384f7104a9b38b333b682cd782b095c1bf1df2
parentGet osNpcCreate() and osNpcLoadAppearance() to generate a script error if app... (diff)
downloadopensim-SC_OLD-c13a99dc5cc82efac5497dab27dcb6b0d9865cea.zip
opensim-SC_OLD-c13a99dc5cc82efac5497dab27dcb6b0d9865cea.tar.gz
opensim-SC_OLD-c13a99dc5cc82efac5497dab27dcb6b0d9865cea.tar.bz2
opensim-SC_OLD-c13a99dc5cc82efac5497dab27dcb6b0d9865cea.tar.xz
Fix script error messages not showing up in viewer 3 and associated viewers.
Viewer 3 will discard such a message if the chat message owner does not match the avatar. We were filling the ownerID with the primID, so this never matched, hence viewer 3 did not see any script error messages. This commit fills the ownerID in with the prim ownerID so the script owner will receive script error messages. This does not affect viewer 1 and associated viewers which continue to process script errors as normal.
-rw-r--r--OpenSim/Framework/Client/IClientChat.cs7
-rw-r--r--OpenSim/Framework/IClientAPI.cs16
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs39
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs12
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs5
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs10
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs10
9 files changed, 75 insertions, 34 deletions
diff --git a/OpenSim/Framework/Client/IClientChat.cs b/OpenSim/Framework/Client/IClientChat.cs
index 078ea9b..86b1faa 100644
--- a/OpenSim/Framework/Client/IClientChat.cs
+++ b/OpenSim/Framework/Client/IClientChat.cs
@@ -33,7 +33,8 @@ namespace OpenSim.Framework.Client
33 { 33 {
34 event ChatMessage OnChatFromClient; 34 event ChatMessage OnChatFromClient;
35 35
36 void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source, 36 void SendChatMessage(
37 byte audible); 37 string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source,
38 byte audible);
38 } 39 }
39} 40} \ No newline at end of file
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 9856978..87433cc 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1099,8 +1099,20 @@ namespace OpenSim.Framework
1099 void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs); 1099 void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);
1100 void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args); 1100 void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args);
1101 1101
1102 void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source, 1102 /// <summary>
1103 byte audible); 1103 /// Send chat to the viewer.
1104 /// </summary>
1105 /// <param name='message'></param>
1106 /// <param name='type'></param>
1107 /// <param name='fromPos'></param>
1108 /// <param name='fromName'></param>
1109 /// <param name='fromAgentID'></param>
1110 /// <param name='ownerID'></param>
1111 /// <param name='source'></param>
1112 /// <param name='audible'></param>
1113 void SendChatMessage(
1114 string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source,
1115 byte audible);
1104 1116
1105 void SendInstantMessage(GridInstantMessage im); 1117 void SendInstantMessage(GridInstantMessage im);
1106 1118
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 7427c59..8e5a6d2 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -817,8 +817,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
817 OutPacket(mov, ThrottleOutPacketType.Unknown); 817 OutPacket(mov, ThrottleOutPacketType.Unknown);
818 } 818 }
819 819
820 public void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, 820 public void SendChatMessage(
821 UUID fromAgentID, byte source, byte audible) 821 string message, byte type, Vector3 fromPos, string fromName,
822 UUID fromAgentID, UUID ownerID, byte source, byte audible)
822 { 823 {
823 ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); 824 ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator);
824 reply.ChatData.Audible = audible; 825 reply.ChatData.Audible = audible;
@@ -827,7 +828,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
827 reply.ChatData.SourceType = source; 828 reply.ChatData.SourceType = source;
828 reply.ChatData.Position = fromPos; 829 reply.ChatData.Position = fromPos;
829 reply.ChatData.FromName = Util.StringToBytes256(fromName); 830 reply.ChatData.FromName = Util.StringToBytes256(fromName);
830 reply.ChatData.OwnerID = fromAgentID; 831 reply.ChatData.OwnerID = ownerID;
831 reply.ChatData.SourceID = fromAgentID; 832 reply.ChatData.SourceID = fromAgentID;
832 833
833 OutPacket(reply, ThrottleOutPacketType.Task); 834 OutPacket(reply, ThrottleOutPacketType.Task);
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index e4452fb..ddf92c3 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -186,6 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
186 { 186 {
187 string fromName = c.From; 187 string fromName = c.From;
188 UUID fromID = UUID.Zero; 188 UUID fromID = UUID.Zero;
189 UUID ownerID = UUID.Zero;
189 UUID targetID = c.TargetUUID; 190 UUID targetID = c.TargetUUID;
190 string message = c.Message; 191 string message = c.Message;
191 IScene scene = c.Scene; 192 IScene scene = c.Scene;
@@ -208,12 +209,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
208 fromPos = avatar.AbsolutePosition; 209 fromPos = avatar.AbsolutePosition;
209 fromName = avatar.Name; 210 fromName = avatar.Name;
210 fromID = c.Sender.AgentId; 211 fromID = c.Sender.AgentId;
212 ownerID = c.Sender.AgentId;
211 213
212 break; 214 break;
213 215
214 case ChatSourceType.Object: 216 case ChatSourceType.Object:
215 fromID = c.SenderUUID; 217 fromID = c.SenderUUID;
216 218
219 if (c.SenderObject != null && c.SenderObject is SceneObjectPart)
220 ownerID = ((SceneObjectPart)c.SenderObject).OwnerID;
221
217 break; 222 break;
218 } 223 }
219 224
@@ -236,7 +241,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
236 s.ForEachRootScenePresence( 241 s.ForEachRootScenePresence(
237 delegate(ScenePresence presence) 242 delegate(ScenePresence presence)
238 { 243 {
239 if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType, false)) 244 if (TrySendChatMessage(
245 presence, fromPos, regionPos, fromID, ownerID, fromName, c.Type, message, sourceType, false))
240 receiverIDs.Add(presence.UUID); 246 receiverIDs.Add(presence.UUID);
241 } 247 }
242 ); 248 );
@@ -248,8 +254,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
248 ScenePresence presence = s.GetScenePresence(targetID); 254 ScenePresence presence = s.GetScenePresence(targetID);
249 if (presence != null && !presence.IsChildAgent) 255 if (presence != null && !presence.IsChildAgent)
250 { 256 {
251 if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, ChatTypeEnum.Say, message, sourceType, true)) 257 if (TrySendChatMessage(
252 receiverIDs.Add(presence.UUID); 258 presence, fromPos, regionPos, fromID, ownerID, fromName, ChatTypeEnum.Say, message, sourceType, true))
259 receiverIDs.Add(presence.UUID);
253 } 260 }
254 } 261 }
255 } 262 }
@@ -305,9 +312,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
305 (null != c.SenderObject) && 312 (null != c.SenderObject) &&
306 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) 313 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
307 return; 314 return;
308 315
309 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, 316 client.SendChatMessage(
310 (byte)sourceType, (byte)ChatAudibleLevel.Fully); 317 c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID,
318 (byte)sourceType, (byte)ChatAudibleLevel.Fully);
319
311 receiverIDs.Add(client.AgentId); 320 receiverIDs.Add(client.AgentId);
312 }); 321 });
313 322
@@ -322,15 +331,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
322 /// <param name="fromPos"></param> 331 /// <param name="fromPos"></param>
323 /// <param name="regionPos">/param> 332 /// <param name="regionPos">/param>
324 /// <param name="fromAgentID"></param> 333 /// <param name="fromAgentID"></param>
334 /// <param name='ownerID'>
335 /// Owner of the message. For at least some messages from objects, this has to be correctly filled with the owner's UUID.
336 /// This is the case for script error messages in viewer 3 since LLViewer change EXT-7762
337 /// </param>
325 /// <param name="fromName"></param> 338 /// <param name="fromName"></param>
326 /// <param name="type"></param> 339 /// <param name="type"></param>
327 /// <param name="message"></param> 340 /// <param name="message"></param>
328 /// <param name="src"></param> 341 /// <param name="src"></param>
329 /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a 342 /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a
330 /// precondition</returns> 343 /// precondition</returns>
331 protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, 344 protected virtual bool TrySendChatMessage(
332 UUID fromAgentID, string fromName, ChatTypeEnum type, 345 ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
333 string message, ChatSourceType src, bool ignoreDistance) 346 UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type,
347 string message, ChatSourceType src, bool ignoreDistance)
334 { 348 {
335 // don't send stuff to child agents 349 // don't send stuff to child agents
336 if (presence.IsChildAgent) return false; 350 if (presence.IsChildAgent) return false;
@@ -353,10 +367,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
353 } 367 }
354 368
355 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView 369 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
356 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, 370 presence.ControllingClient.SendChatMessage(
357 fromAgentID, (byte)src, (byte)ChatAudibleLevel.Fully); 371 message, (byte) type, fromPos, fromName,
372 fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully);
358 373
359 return true; 374 return true;
360 } 375 }
361 } 376 }
362} 377} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 99bf72a..df43271 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -38,6 +38,18 @@ namespace OpenSim.Region.Framework.Scenes
38{ 38{
39 public partial class Scene 39 public partial class Scene
40 { 40 {
41 /// <summary>
42 /// Send chat to listeners.
43 /// </summary>
44 /// <param name='message'></param>
45 /// <param name='type'>/param>
46 /// <param name='channel'></param>
47 /// <param name='fromPos'></param>
48 /// <param name='fromName'></param>
49 /// <param name='fromID'></param>
50 /// <param name='targetID'></param>
51 /// <param name='fromAgent'></param>
52 /// <param name='broadcast'></param>
41 protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, 53 protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
42 UUID fromID, UUID targetID, bool fromAgent, bool broadcast) 54 UUID fromID, UUID targetID, bool fromAgent, bool broadcast)
43 { 55 {
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index e93bd7c..781539a 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -954,7 +954,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
954 954
955 } 955 }
956 956
957 public void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source, byte audible) 957 public void SendChatMessage(
958 string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source, byte audible)
958 { 959 {
959 if (audible > 0 && message.Length > 0) 960 if (audible > 0 && message.Length > 0)
960 IRC_SendChannelPrivmsg(fromName, message); 961 IRC_SendChannelPrivmsg(fromName, message);
diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
index e22618d..5c3be29 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
@@ -546,8 +546,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
546 c.SenderUUID = UUID.Zero; 546 c.SenderUUID = UUID.Zero;
547 c.Scene = agent.Scene; 547 c.Scene = agent.Scene;
548 548
549 agent.ControllingClient.SendChatMessage(msg, (byte) ChatTypeEnum.Say, PosOfGod, m_whoami, UUID.Zero, 549 agent.ControllingClient.SendChatMessage(
550 (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); 550 msg, (byte) ChatTypeEnum.Say, PosOfGod, m_whoami, UUID.Zero, UUID.Zero,
551 (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully);
551 } 552 }
552 553
553 private static void checkStringParameters(XmlRpcRequest request, string[] param) 554 private static void checkStringParameters(XmlRpcRequest request, string[] param)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index ffd4222..5ea2bcd 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -603,13 +603,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
603 { 603 {
604 } 604 }
605 605
606 public virtual void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, 606 public virtual void SendChatMessage(
607 UUID fromAgentID, byte source, byte audible) 607 string message, byte type, Vector3 fromPos, string fromName,
608 UUID fromAgentID, UUID ownerID, byte source, byte audible)
608 { 609 {
609 } 610 }
610 611
611 public virtual void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName, 612 public virtual void SendChatMessage(
612 UUID fromAgentID, byte source, byte audible) 613 byte[] message, byte type, Vector3 fromPos, string fromName,
614 UUID fromAgentID, UUID ownerID, byte source, byte audible)
613 { 615 {
614 } 616 }
615 617
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index bb8b935..dde37ab 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -528,13 +528,9 @@ namespace OpenSim.Tests.Common.Mock
528 { 528 {
529 } 529 }
530 530
531 public virtual void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, 531 public virtual void SendChatMessage(
532 UUID fromAgentID, byte source, byte audible) 532 string message, byte type, Vector3 fromPos, string fromName,
533 { 533 UUID fromAgentID, UUID ownerID, byte source, byte audible)
534 }
535
536 public virtual void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName,
537 UUID fromAgentID, byte source, byte audible)
538 { 534 {
539 } 535 }
540 536