diff options
author | Jeff Ames | 2007-11-08 03:11:10 +0000 |
---|---|---|
committer | Jeff Ames | 2007-11-08 03:11:10 +0000 |
commit | 0b4e15bc3586422d273bd8845962a2db681230e2 (patch) | |
tree | f3394ee384d7b20fc8c1f0eee4ebda3c10203a1a /OpenSim | |
parent | * Added Rotational Velocity reporting for Client Interpolation to Terse Updates (diff) | |
download | opensim-SC-0b4e15bc3586422d273bd8845962a2db681230e2.zip opensim-SC-0b4e15bc3586422d273bd8845962a2db681230e2.tar.gz opensim-SC-0b4e15bc3586422d273bd8845962a2db681230e2.tar.bz2 opensim-SC-0b4e15bc3586422d273bd8845962a2db681230e2.tar.xz |
converted hard-coded chat type values to ChatTypeEnum
Diffstat (limited to '')
9 files changed, 28 insertions, 30 deletions
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 7bc3ce4..64921d7 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -270,24 +270,20 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler | |||
270 | 270 | ||
271 | public void llWhisper(int channelID, string text) | 271 | public void llWhisper(int channelID, string text) |
272 | { | 272 | { |
273 | //type for whisper is 0 | ||
274 | World.SimChat(Helpers.StringToField(text), | 273 | World.SimChat(Helpers.StringToField(text), |
275 | 0, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 274 | ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
276 | } | 275 | } |
277 | 276 | ||
278 | public void llSay(int channelID, string text) | 277 | public void llSay(int channelID, string text) |
279 | { | 278 | { |
280 | //type for say is 1 | ||
281 | |||
282 | World.SimChat(Helpers.StringToField(text), | 279 | World.SimChat(Helpers.StringToField(text), |
283 | 1, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 280 | ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
284 | } | 281 | } |
285 | 282 | ||
286 | public void llShout(int channelID, string text) | 283 | public void llShout(int channelID, string text) |
287 | { | 284 | { |
288 | //type for shout is 2 | ||
289 | World.SimChat(Helpers.StringToField(text), | 285 | World.SimChat(Helpers.StringToField(text), |
290 | 2, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 286 | ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
291 | } | 287 | } |
292 | 288 | ||
293 | public int llListen(int channelID, string name, string ID, string msg) | 289 | public int llListen(int channelID, string name, string ID, string msg) |
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs index 31d090f..91d4558 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs | |||
@@ -31,6 +31,7 @@ using System.Collections; | |||
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | using OpenSim.Framework; | ||
34 | using OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL; | 35 | using OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL; |
35 | using OpenSim.Region.Environment.Scenes.Scripting; | 36 | using OpenSim.Region.Environment.Scenes.Scripting; |
36 | 37 | ||
@@ -205,7 +206,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
205 | IScriptHost m_host = m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); | 206 | IScriptHost m_host = m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); |
206 | //if (m_host != null) | 207 | //if (m_host != null) |
207 | //{ | 208 | //{ |
208 | m_ScriptEngine.World.SimChat(Helpers.StringToField(text), 1, 0, | 209 | m_ScriptEngine.World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0, |
209 | m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 210 | m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
210 | } | 211 | } |
211 | catch | 212 | catch |
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs index 2149bf0..85e9a9c 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -33,6 +33,7 @@ using System.Reflection; | |||
33 | using System.Runtime.Serialization.Formatters.Binary; | 33 | using System.Runtime.Serialization.Formatters.Binary; |
34 | using System.Threading; | 34 | using System.Threading; |
35 | using libsecondlife; | 35 | using libsecondlife; |
36 | using OpenSim.Framework; | ||
36 | using OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler; | 37 | using OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler; |
37 | using OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL; | 38 | using OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL; |
38 | using OpenSim.Region.Environment.Scenes; | 39 | using OpenSim.Region.Environment.Scenes; |
@@ -318,7 +319,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
318 | string text = "Error compiling script:\r\n" + e.Message.ToString(); | 319 | string text = "Error compiling script:\r\n" + e.Message.ToString(); |
319 | if (text.Length > 1500) | 320 | if (text.Length > 1500) |
320 | text = text.Substring(0, 1500); | 321 | text = text.Substring(0, 1500); |
321 | World.SimChat(Helpers.StringToField(text), 1, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 322 | World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
322 | } | 323 | } |
323 | catch (Exception e2) | 324 | catch (Exception e2) |
324 | { | 325 | { |
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 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using OpenSim.Framework; | ||
30 | using OpenSim.Region.Environment.Modules; | 31 | using OpenSim.Region.Environment.Modules; |
31 | 32 | ||
32 | namespace OpenSim.Region.Environment.Interfaces | 33 | namespace OpenSim.Region.Environment.Interfaces |
@@ -34,7 +35,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
34 | public interface IWorldComm | 35 | public interface IWorldComm |
35 | { | 36 | { |
36 | int Listen(uint LocalID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg); | 37 | int Listen(uint LocalID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg); |
37 | void DeliverMessage(string sourceItemID, int type, int channel, string name, string msg); | 38 | void DeliverMessage(string sourceItemID, ChatTypeEnum type, int channel, string name, string msg); |
38 | bool HasMessages(); | 39 | bool HasMessages(); |
39 | ListenerInfo GetNextMessage(); | 40 | ListenerInfo GetNextMessage(); |
40 | void ListenControl(int handle, int active); | 41 | 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 | |||
113 | private void DeliverClientMessage(Object sender, ChatFromViewerArgs e) | 113 | private void DeliverClientMessage(Object sender, ChatFromViewerArgs e) |
114 | { | 114 | { |
115 | DeliverMessage(e.Sender.AgentId.ToString(), | 115 | DeliverMessage(e.Sender.AgentId.ToString(), |
116 | (int) e.Type, e.Channel, | 116 | e.Type, e.Channel, |
117 | e.Sender.FirstName + " " + e.Sender.LastName, | 117 | e.Sender.FirstName + " " + e.Sender.LastName, |
118 | e.Message); | 118 | e.Message); |
119 | } | 119 | } |
@@ -140,8 +140,8 @@ namespace OpenSim.Region.Environment.Modules | |||
140 | // and if so if this message fits the filter. If it does, then | 140 | // and if so if this message fits the filter. If it does, then |
141 | // enqueue the message for delivery to the objects listen event handler. | 141 | // enqueue the message for delivery to the objects listen event handler. |
142 | // Objects that do an llSay have their messages delivered here, and for | 142 | // Objects that do an llSay have their messages delivered here, and for |
143 | // nearby avatards, the SimChat function is used. | 143 | // nearby avatars, the SimChat function is used. |
144 | public void DeliverMessage(string sourceItemID, int type, int channel, string name, string msg) | 144 | public void DeliverMessage(string sourceItemID, ChatTypeEnum type, int channel, string name, string msg) |
145 | { | 145 | { |
146 | SceneObjectPart source = null; | 146 | SceneObjectPart source = null; |
147 | ScenePresence avatar = null; | 147 | ScenePresence avatar = null; |
@@ -177,7 +177,7 @@ namespace OpenSim.Region.Environment.Modules | |||
177 | 177 | ||
178 | switch (type) | 178 | switch (type) |
179 | { | 179 | { |
180 | case 0: // Whisper | 180 | case ChatTypeEnum.Whisper: |
181 | 181 | ||
182 | if ((dis < 10) && (dis > -10)) | 182 | if ((dis < 10) && (dis > -10)) |
183 | { | 183 | { |
@@ -191,7 +191,7 @@ namespace OpenSim.Region.Environment.Modules | |||
191 | } | 191 | } |
192 | break; | 192 | break; |
193 | 193 | ||
194 | case 1: // Say | 194 | case ChatTypeEnum.Say: |
195 | 195 | ||
196 | if ((dis < 30) && (dis > -30)) | 196 | if ((dis < 30) && (dis > -30)) |
197 | { | 197 | { |
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Modules | |||
205 | } | 205 | } |
206 | break; | 206 | break; |
207 | 207 | ||
208 | case 2: // Shout | 208 | case ChatTypeEnum.Shout: |
209 | if ((dis < 100) && (dis > -100)) | 209 | if ((dis < 100) && (dis > -100)) |
210 | { | 210 | { |
211 | ListenerInfo isListener = m_listenerManager.IsListenerMatch( | 211 | ListenerInfo isListener = m_listenerManager.IsListenerMatch( |
@@ -218,7 +218,7 @@ namespace OpenSim.Region.Environment.Modules | |||
218 | } | 218 | } |
219 | break; | 219 | break; |
220 | 220 | ||
221 | case 0xff: // Broadcast | 221 | case ChatTypeEnum.Broadcast: |
222 | ListenerInfo isListen = | 222 | ListenerInfo isListen = |
223 | m_listenerManager.IsListenerMatch(sourceItemID, eb, channel, name, msg); | 223 | m_listenerManager.IsListenerMatch(sourceItemID, eb, channel, name, msg); |
224 | if (isListen != null) | 224 | 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 | |||
65 | /// <param name="fromPos"></param> | 65 | /// <param name="fromPos"></param> |
66 | /// <param name="fromName"></param> | 66 | /// <param name="fromName"></param> |
67 | /// <param name="fromAgentID"></param> | 67 | /// <param name="fromAgentID"></param> |
68 | public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName, | 68 | public void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, |
69 | LLUUID fromAgentID) | 69 | LLUUID fromAgentID) |
70 | { | 70 | { |
71 | if (m_simChatModule != null) | 71 | if (m_simChatModule != null) |
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
74 | 74 | ||
75 | args.Message = Util.FieldToString(message); | 75 | args.Message = Util.FieldToString(message); |
76 | args.Channel = channel; | 76 | args.Channel = channel; |
77 | args.Type = (ChatTypeEnum) type; | 77 | args.Type = type; |
78 | args.Position = fromPos; | 78 | args.Position = fromPos; |
79 | 79 | ||
80 | ScenePresence user = GetScenePresence(fromAgentID); | 80 | ScenePresence user = GetScenePresence(fromAgentID); |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 737dee6..e3504d3 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -270,32 +270,29 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
270 | 270 | ||
271 | public void llWhisper(int channelID, string text) | 271 | public void llWhisper(int channelID, string text) |
272 | { | 272 | { |
273 | //type for whisper is 0 | ||
274 | World.SimChat(Helpers.StringToField(text), | 273 | World.SimChat(Helpers.StringToField(text), |
275 | 0, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 274 | ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
276 | 275 | ||
277 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 276 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
278 | wComm.DeliverMessage(m_host.UUID.ToString(), 0, channelID, m_host.Name, text); | 277 | wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Whisper, channelID, m_host.Name, text); |
279 | } | 278 | } |
280 | 279 | ||
281 | public void llSay(int channelID, string text) | 280 | public void llSay(int channelID, string text) |
282 | { | 281 | { |
283 | //type for say is 1 | ||
284 | World.SimChat(Helpers.StringToField(text), | 282 | World.SimChat(Helpers.StringToField(text), |
285 | 1, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 283 | ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
286 | 284 | ||
287 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 285 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
288 | wComm.DeliverMessage(m_host.UUID.ToString(), 1, channelID, m_host.Name, text); | 286 | wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, channelID, m_host.Name, text); |
289 | } | 287 | } |
290 | 288 | ||
291 | public void llShout(int channelID, string text) | 289 | public void llShout(int channelID, string text) |
292 | { | 290 | { |
293 | //type for shout is 2 | ||
294 | World.SimChat(Helpers.StringToField(text), | 291 | World.SimChat(Helpers.StringToField(text), |
295 | 2, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 292 | ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
296 | 293 | ||
297 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 294 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
298 | wComm.DeliverMessage(m_host.UUID.ToString(), 2, channelID, m_host.Name, text); | 295 | wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Shout, channelID, m_host.Name, text); |
299 | } | 296 | } |
300 | 297 | ||
301 | public int llListen(int channelID, string name, string ID, string msg) | 298 | public int llListen(int channelID, string name, string ID, string msg) |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs index f215dd5..d79a8a6 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs | |||
@@ -31,6 +31,7 @@ using System.Collections; | |||
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | using OpenSim.Framework; | ||
34 | using OpenSim.Region.Environment.Scenes.Scripting; | 35 | using OpenSim.Region.Environment.Scenes.Scripting; |
35 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 36 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
36 | 37 | ||
@@ -212,7 +213,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
212 | IScriptHost m_host = m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); | 213 | IScriptHost m_host = m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); |
213 | //if (m_host != null) | 214 | //if (m_host != null) |
214 | //{ | 215 | //{ |
215 | m_ScriptEngine.World.SimChat(Helpers.StringToField(text), 1, 0, | 216 | m_ScriptEngine.World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0, |
216 | m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 217 | m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
217 | } | 218 | } |
218 | catch | 219 | catch |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index a3cf9f7..5b6a9d1 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -33,6 +33,7 @@ using System.Reflection; | |||
33 | using System.Runtime.Serialization.Formatters.Binary; | 33 | using System.Runtime.Serialization.Formatters.Binary; |
34 | using System.Threading; | 34 | using System.Threading; |
35 | using libsecondlife; | 35 | using libsecondlife; |
36 | using OpenSim.Framework; | ||
36 | using OpenSim.Region.Environment.Scenes; | 37 | using OpenSim.Region.Environment.Scenes; |
37 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; | 38 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; |
38 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 39 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
@@ -323,7 +324,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
323 | string text = "Error compiling script:\r\n" + e.Message.ToString(); | 324 | string text = "Error compiling script:\r\n" + e.Message.ToString(); |
324 | if (text.Length > 1500) | 325 | if (text.Length > 1500) |
325 | text = text.Substring(0, 1500); | 326 | text = text.Substring(0, 1500); |
326 | World.SimChat(Helpers.StringToField(text), 1, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 327 | World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
327 | } | 328 | } |
328 | catch (Exception e2) | 329 | catch (Exception e2) |
329 | { | 330 | { |