diff options
author | Teravus Ovares | 2008-05-05 15:53:11 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-05 15:53:11 +0000 |
commit | ce19234dc865e645166dbe5cc52b6d8eb7c6d0af (patch) | |
tree | c84ebb52428d4c4db3305832a5bad5cb283164be | |
parent | * A bit of spice from here, a pinch of salt from there, some brains that attr... (diff) | |
download | opensim-SC_OLD-ce19234dc865e645166dbe5cc52b6d8eb7c6d0af.zip opensim-SC_OLD-ce19234dc865e645166dbe5cc52b6d8eb7c6d0af.tar.gz opensim-SC_OLD-ce19234dc865e645166dbe5cc52b6d8eb7c6d0af.tar.bz2 opensim-SC_OLD-ce19234dc865e645166dbe5cc52b6d8eb7c6d0af.tar.xz |
* Unraveled the DEBUG_CHANNEL mystery.
* Moved script errors to the debug channel.
* Typing '/2147483647 OK' results in a debug_channel message.
* Expanded the available parameters that are send-able through IClientAPI
Diffstat (limited to '')
8 files changed, 46 insertions, 23 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 02ecc1a..a58114c 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -53,6 +53,7 @@ namespace OpenSim.Framework | |||
53 | // 3 is an obsolete version of Say | 53 | // 3 is an obsolete version of Say |
54 | StartTyping = 4, | 54 | StartTyping = 4, |
55 | StopTyping = 5, | 55 | StopTyping = 5, |
56 | DebugChannel = 6, | ||
56 | Broadcast = 0xFF | 57 | Broadcast = 0xFF |
57 | } | 58 | } |
58 | 59 | ||
@@ -82,6 +83,7 @@ namespace OpenSim.Framework | |||
82 | protected IScene m_scene; | 83 | protected IScene m_scene; |
83 | protected IClientAPI m_sender; | 84 | protected IClientAPI m_sender; |
84 | protected ChatTypeEnum m_type; | 85 | protected ChatTypeEnum m_type; |
86 | protected LLUUID m_fromID; | ||
85 | 87 | ||
86 | public ChatFromViewerArgs() | 88 | public ChatFromViewerArgs() |
87 | { | 89 | { |
@@ -144,6 +146,12 @@ namespace OpenSim.Framework | |||
144 | set { m_sender = value; } | 146 | set { m_sender = value; } |
145 | } | 147 | } |
146 | 148 | ||
149 | public LLUUID SenderUUID | ||
150 | { | ||
151 | get { return m_fromID; } | ||
152 | set { m_fromID = value; } | ||
153 | } | ||
154 | |||
147 | /// <summary> | 155 | /// <summary> |
148 | /// | 156 | /// |
149 | /// </summary> | 157 | /// </summary> |
@@ -653,8 +661,8 @@ namespace OpenSim.Framework | |||
653 | void SendKillObject(ulong regionHandle, uint localID); | 661 | void SendKillObject(ulong regionHandle, uint localID); |
654 | void SendAnimations(LLUUID[] animID, int[] seqs, LLUUID sourceAgentId); | 662 | void SendAnimations(LLUUID[] animID, int[] seqs, LLUUID sourceAgentId); |
655 | void SendRegionHandshake(RegionInfo regionInfo); | 663 | void SendRegionHandshake(RegionInfo regionInfo); |
656 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | 664 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID, byte source, byte audible); |
657 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | 665 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID, byte source, byte audible); |
658 | 666 | ||
659 | void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, | 667 | void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, |
660 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp); | 668 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp); |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 475788a..4ff27e7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -898,18 +898,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
898 | /// <param name="fromPos"></param> | 898 | /// <param name="fromPos"></param> |
899 | /// <param name="fromName"></param> | 899 | /// <param name="fromName"></param> |
900 | /// <param name="fromAgentID"></param> | 900 | /// <param name="fromAgentID"></param> |
901 | public void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | 901 | public void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID, byte source, byte audible) |
902 | { | 902 | { |
903 | SendChatMessage(Helpers.StringToField(message), type, fromPos, fromName, fromAgentID); | 903 | SendChatMessage(Helpers.StringToField(message), type, fromPos, fromName, fromAgentID, source, audible); |
904 | } | 904 | } |
905 | 905 | ||
906 | public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | 906 | public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID, byte source, byte audible) |
907 | { | 907 | { |
908 | ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); | 908 | ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); |
909 | reply.ChatData.Audible = 1; | 909 | reply.ChatData.Audible = audible; |
910 | reply.ChatData.Message = message; | 910 | reply.ChatData.Message = message; |
911 | reply.ChatData.ChatType = type; | 911 | reply.ChatData.ChatType = type; |
912 | reply.ChatData.SourceType = 1; | 912 | reply.ChatData.SourceType = source; |
913 | reply.ChatData.Position = fromPos; | 913 | reply.ChatData.Position = fromPos; |
914 | reply.ChatData.FromName = Helpers.StringToField(fromName); | 914 | reply.ChatData.FromName = Helpers.StringToField(fromName); |
915 | reply.ChatData.OwnerID = fromAgentID; | 915 | reply.ChatData.OwnerID = fromAgentID; |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs index 15720fc..9f3429e 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs | |||
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
168 | 168 | ||
169 | string fromName = e.From; | 169 | string fromName = e.From; |
170 | string message = e.Message; | 170 | string message = e.Message; |
171 | LLUUID fromAgentID = LLUUID.Zero; | 171 | LLUUID fromAgentID = e.SenderUUID; |
172 | 172 | ||
173 | if (e.Sender != null) | 173 | if (e.Sender != null) |
174 | { | 174 | { |
@@ -208,10 +208,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
208 | 208 | ||
209 | 209 | ||
210 | // We only want to relay stuff on channel 0 | 210 | // We only want to relay stuff on channel 0 |
211 | if (e.Channel == 0) | 211 | if (e.Channel == 0 || e.Channel == 2147483647) |
212 | { | 212 | { |
213 | if (e.Channel == 2147483647) | ||
214 | e.Type = ChatTypeEnum.DebugChannel; | ||
215 | |||
213 | // IRC stuff | 216 | // IRC stuff |
214 | if (e.Message.Length > 0) | 217 | if (e.Message.Length > 0 && e.Channel == 0) |
215 | { | 218 | { |
216 | if (m_irc.Connected && (avatar != null)) // this is to keep objects from talking to IRC | 219 | if (m_irc.Connected && (avatar != null)) // this is to keep objects from talking to IRC |
217 | { | 220 | { |
@@ -223,8 +226,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
223 | { | 226 | { |
224 | s.ForEachScenePresence(delegate(ScenePresence presence) | 227 | s.ForEachScenePresence(delegate(ScenePresence presence) |
225 | { | 228 | { |
226 | TrySendChatMessage(presence, fromPos, regionPos, | 229 | if (e.Channel == 2147483647) |
227 | fromAgentID, fromName, e.Type, message); | 230 | { |
231 | TrySendChatMessage(presence, fromPos, regionPos, | ||
232 | fromAgentID, fromName, e.Type, message, ChatSourceType.Object); | ||
233 | } | ||
234 | else | ||
235 | { | ||
236 | TrySendChatMessage(presence, fromPos, regionPos, | ||
237 | fromAgentID, fromName, e.Type, message, ChatSourceType.Agent); | ||
238 | |||
239 | } | ||
228 | }); | 240 | }); |
229 | } | 241 | } |
230 | } | 242 | } |
@@ -290,7 +302,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
290 | } | 302 | } |
291 | 303 | ||
292 | private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos, | 304 | private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos, |
293 | LLUUID fromAgentID, string fromName, ChatTypeEnum type, string message) | 305 | LLUUID fromAgentID, string fromName, ChatTypeEnum type, string message, ChatSourceType src) |
294 | { | 306 | { |
295 | if (!presence.IsChildAgent) | 307 | if (!presence.IsChildAgent) |
296 | { | 308 | { |
@@ -306,7 +318,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
306 | } | 318 | } |
307 | 319 | ||
308 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView | 320 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView |
309 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID); | 321 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); |
310 | } | 322 | } |
311 | } | 323 | } |
312 | 324 | ||
@@ -633,7 +645,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
633 | avatar.ControllingClient.SendChatMessage( | 645 | avatar.ControllingClient.SendChatMessage( |
634 | Helpers.StringToField(data["msg"]), 255, | 646 | Helpers.StringToField(data["msg"]), 255, |
635 | pos, data["nick"], | 647 | pos, data["nick"], |
636 | LLUUID.Zero); | 648 | LLUUID.Zero,(byte)ChatSourceType.Agent,(byte)ChatAudibleLevel.Fully); |
637 | } | 649 | } |
638 | }); | 650 | }); |
639 | } | 651 | } |
@@ -678,7 +690,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
678 | avatar.ControllingClient.SendChatMessage( | 690 | avatar.ControllingClient.SendChatMessage( |
679 | Helpers.StringToField(message), 255, | 691 | Helpers.StringToField(message), 255, |
680 | pos, sender, | 692 | pos, sender, |
681 | LLUUID.Zero); | 693 | LLUUID.Zero,(byte)ChatSourceType.Object,(byte)ChatAudibleLevel.Fully); |
682 | } | 694 | } |
683 | }); | 695 | }); |
684 | } | 696 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index dccc09a..b4a581d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -53,6 +53,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
53 | args.Channel = channel; | 53 | args.Channel = channel; |
54 | args.Type = type; | 54 | args.Type = type; |
55 | args.Position = fromPos; | 55 | args.Position = fromPos; |
56 | args.SenderUUID = fromAgentID; | ||
57 | |||
56 | 58 | ||
57 | ScenePresence user = GetScenePresence(fromAgentID); | 59 | ScenePresence user = GetScenePresence(fromAgentID); |
58 | if (user != null) | 60 | if (user != null) |
@@ -61,6 +63,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
61 | args.Sender = null; | 63 | args.Sender = null; |
62 | 64 | ||
63 | args.From = fromName; | 65 | args.From = fromName; |
66 | //args. | ||
64 | 67 | ||
65 | m_simChatModule.SimChat(this, args); | 68 | m_simChatModule.SimChat(this, args); |
66 | } | 69 | } |
diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index abad098..8efbf27 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
118 | 118 | ||
119 | remoteClient.SendKillObject(m_regionHandle, part.LocalId); | 119 | remoteClient.SendKillObject(m_regionHandle, part.LocalId); |
120 | remoteClient.AddMoney(1); | 120 | remoteClient.AddMoney(1); |
121 | remoteClient.SendChatMessage("Poof!", 1, AbsolutePosition, "Party Party", LLUUID.Zero); | 121 | remoteClient.SendChatMessage("Poof!", 1, AbsolutePosition, "Party Party", LLUUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); |
122 | } | 122 | } |
123 | 123 | ||
124 | public override void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) | 124 | public override void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) |
@@ -129,7 +129,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
129 | m_scene.RemoveEntity(this); | 129 | m_scene.RemoveEntity(this); |
130 | remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId); | 130 | remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId); |
131 | remoteClient.AddMoney(50); | 131 | remoteClient.AddMoney(50); |
132 | remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero); | 132 | remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); |
133 | } | 133 | } |
134 | } | 134 | } |
135 | } | 135 | } |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 1a8f808..3a64698 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -296,12 +296,12 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
296 | } | 296 | } |
297 | 297 | ||
298 | public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, | 298 | public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, |
299 | LLUUID fromAgentID) | 299 | LLUUID fromAgentID, byte source, byte audible) |
300 | { | 300 | { |
301 | } | 301 | } |
302 | 302 | ||
303 | public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, | 303 | public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, |
304 | LLUUID fromAgentID) | 304 | LLUUID fromAgentID, byte source, byte audible) |
305 | { | 305 | { |
306 | } | 306 | } |
307 | 307 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 1b1a5fa..2a6f775 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs | |||
@@ -326,8 +326,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
326 | m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); | 326 | m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); |
327 | //if (m_host != null) | 327 | //if (m_host != null) |
328 | //{ | 328 | //{ |
329 | m_ScriptEngine.World.SimChat(Helpers.StringToField(text), | 329 | m_ScriptEngine.World.SimChat(Helpers.StringToField(text.Substring(0,999)), |
330 | ChatTypeEnum.Say, 0, | 330 | ChatTypeEnum.DebugChannel, 2147483647, |
331 | m_host.AbsolutePosition, | 331 | m_host.AbsolutePosition, |
332 | m_host.Name, m_host.UUID); | 332 | m_host.Name, m_host.UUID); |
333 | } | 333 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 32c98a8..ed2c0a3 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -114,7 +114,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
114 | string text = "Error compiling script:\r\n" + e.Message.ToString(); | 114 | string text = "Error compiling script:\r\n" + e.Message.ToString(); |
115 | if (text.Length > 1500) | 115 | if (text.Length > 1500) |
116 | text = text.Substring(0, 1500); | 116 | text = text.Substring(0, 1500); |
117 | World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, | 117 | World.SimChat(Helpers.StringToField(text), ChatTypeEnum.DebugChannel, 2147483647, m_host.AbsolutePosition, |
118 | m_host.Name, m_host.UUID); | 118 | m_host.Name, m_host.UUID); |
119 | } | 119 | } |
120 | catch (Exception e2) // LEGIT: User Scripting | 120 | catch (Exception e2) // LEGIT: User Scripting |