diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 30 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs | 52 |
2 files changed, 41 insertions, 41 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 5164289..53800bb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
69 | m_enabled = false; | 69 | m_enabled = false; |
70 | return; | 70 | return; |
71 | } | 71 | } |
72 | 72 | ||
73 | m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance); | 73 | m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance); |
74 | m_saydistance = m_config.GetInt("say_distance", m_saydistance); | 74 | m_saydistance = m_config.GetInt("say_distance", m_saydistance); |
75 | m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance); | 75 | m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance); |
@@ -123,7 +123,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 | ||
127 | public virtual void Close() | 127 | public virtual void Close() |
128 | { | 128 | { |
129 | } | 129 | } |
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
132 | { | 132 | { |
133 | } | 133 | } |
134 | 134 | ||
135 | public virtual Type ReplaceableInterface | 135 | public virtual Type ReplaceableInterface |
136 | { | 136 | { |
137 | get { return null; } | 137 | get { return null; } |
138 | } | 138 | } |
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
222 | return; | 222 | return; |
223 | } | 223 | } |
224 | 224 | ||
225 | switch (sourceType) | 225 | switch (sourceType) |
226 | { | 226 | { |
227 | case ChatSourceType.Agent: | 227 | case ChatSourceType.Agent: |
228 | ScenePresence avatar = (scene as Scene).GetScenePresence(c.Sender.AgentId); | 228 | ScenePresence avatar = (scene as Scene).GetScenePresence(c.Sender.AgentId); |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
240 | } | 240 | } |
241 | destination = UUID.Zero; // Avatars cant "SayTo" | 241 | destination = UUID.Zero; // Avatars cant "SayTo" |
242 | ownerID = c.Sender.AgentId; | 242 | ownerID = c.Sender.AgentId; |
243 | 243 | ||
244 | hidePos = fromPos; | 244 | hidePos = fromPos; |
245 | break; | 245 | break; |
246 | 246 | ||
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
264 | message = message.Substring(0, 1000); | 264 | message = message.Substring(0, 1000); |
265 | 265 | ||
266 | // m_log.DebugFormat( | 266 | // m_log.DebugFormat( |
267 | // "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", | 267 | // "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", |
268 | // fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); | 268 | // fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); |
269 | 269 | ||
270 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); | 270 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); |
@@ -317,13 +317,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
317 | } | 317 | } |
318 | } | 318 | } |
319 | }); | 319 | }); |
320 | 320 | ||
321 | scene.EventManager.TriggerOnChatToClients( | 321 | scene.EventManager.TriggerOnChatToClients( |
322 | fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); | 322 | fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); |
323 | } | 323 | } |
324 | 324 | ||
325 | static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30); | 325 | static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30); |
326 | 326 | ||
327 | public virtual void OnChatBroadcast(Object sender, OSChatMessage c) | 327 | public virtual void OnChatBroadcast(Object sender, OSChatMessage c) |
328 | { | 328 | { |
329 | if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; | 329 | if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; |
@@ -341,7 +341,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
341 | // broadcast chat works by redistributing every incoming chat | 341 | // broadcast chat works by redistributing every incoming chat |
342 | // message to each avatar in the scene. | 342 | // message to each avatar in the scene. |
343 | string fromName = c.From; | 343 | string fromName = c.From; |
344 | 344 | ||
345 | UUID fromID = UUID.Zero; | 345 | UUID fromID = UUID.Zero; |
346 | UUID ownerID = UUID.Zero; | 346 | UUID ownerID = UUID.Zero; |
347 | ChatSourceType sourceType = ChatSourceType.Object; | 347 | ChatSourceType sourceType = ChatSourceType.Object; |
@@ -353,15 +353,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
353 | ownerID = c.Sender.AgentId; | 353 | ownerID = c.Sender.AgentId; |
354 | sourceType = ChatSourceType.Agent; | 354 | sourceType = ChatSourceType.Agent; |
355 | } | 355 | } |
356 | else if (c.SenderUUID != UUID.Zero) | 356 | else if (c.SenderUUID != UUID.Zero) |
357 | { | 357 | { |
358 | fromID = c.SenderUUID; | 358 | fromID = c.SenderUUID; |
359 | ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; | 359 | ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; |
360 | } | 360 | } |
361 | 361 | ||
362 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); | 362 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); |
363 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); | 363 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); |
364 | 364 | ||
365 | if (c.Scene != null) | 365 | if (c.Scene != null) |
366 | { | 366 | { |
367 | ((Scene)c.Scene).ForEachRootClient | 367 | ((Scene)c.Scene).ForEachRootClient |
@@ -374,7 +374,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
374 | (null != c.SenderObject) && | 374 | (null != c.SenderObject) && |
375 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | 375 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) |
376 | return; | 376 | return; |
377 | 377 | ||
378 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, | 378 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, |
379 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | 379 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); |
380 | receiverIDs.Add(client.AgentId); | 380 | receiverIDs.Add(client.AgentId); |
@@ -400,7 +400,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
400 | /// <param name="type"></param> | 400 | /// <param name="type"></param> |
401 | /// <param name="message"></param> | 401 | /// <param name="message"></param> |
402 | /// <param name="src"></param> | 402 | /// <param name="src"></param> |
403 | /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a | 403 | /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a |
404 | /// precondition</returns> | 404 | /// precondition</returns> |
405 | protected virtual bool TrySendChatMessage( | 405 | protected virtual bool TrySendChatMessage( |
406 | ScenePresence presence, Vector3 fromPos, Vector3 regionPos, | 406 | ScenePresence presence, Vector3 fromPos, Vector3 regionPos, |
@@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
430 | presence.ControllingClient.SendChatMessage( | 430 | presence.ControllingClient.SendChatMessage( |
431 | message, (byte) type, fromPos, fromName, | 431 | message, (byte) type, fromPos, fromName, |
432 | fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); | 432 | fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); |
433 | 433 | ||
434 | return true; | 434 | return true; |
435 | } | 435 | } |
436 | 436 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs index a720ad9..5457dc3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
47 | { | 47 | { |
48 | [TestFixture] | 48 | [TestFixture] |
49 | public class ChatModuleTests : OpenSimTestCase | 49 | public class ChatModuleTests : OpenSimTestCase |
50 | { | 50 | { |
51 | [TestFixtureSetUp] | 51 | [TestFixtureSetUp] |
52 | public void FixtureInit() | 52 | public void FixtureInit() |
53 | { | 53 | { |
@@ -66,14 +66,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
66 | } | 66 | } |
67 | 67 | ||
68 | private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB) | 68 | private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB) |
69 | { | 69 | { |
70 | // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the | 70 | // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the |
71 | // CapabilitiesModule complain when it can't set up HTTP endpoints. | 71 | // CapabilitiesModule complain when it can't set up HTTP endpoints. |
72 | BaseHttpServer httpServer = new BaseHttpServer(99999); | 72 | BaseHttpServer httpServer = new BaseHttpServer(99999); |
73 | MainServer.AddHttpServer(httpServer); | 73 | MainServer.AddHttpServer(httpServer); |
74 | MainServer.Instance = httpServer; | 74 | MainServer.Instance = httpServer; |
75 | 75 | ||
76 | // We need entity transfer modules so that when sp2 logs into the east region, the region calls | 76 | // We need entity transfer modules so that when sp2 logs into the east region, the region calls |
77 | // EntityTransferModuleto set up a child agent on the west region. | 77 | // EntityTransferModuleto set up a child agent on the west region. |
78 | // XXX: However, this is not an entity transfer so is misleading. | 78 | // XXX: However, this is not an entity transfer so is misleading. |
79 | EntityTransferModule etmA = new EntityTransferModule(); | 79 | EntityTransferModule etmA = new EntityTransferModule(); |
@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
87 | modulesConfig.Set("SimulationServices", lscm.Name); | 87 | modulesConfig.Set("SimulationServices", lscm.Name); |
88 | 88 | ||
89 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); | 89 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); |
90 | SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); | 90 | SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); |
91 | SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule()); | 91 | SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule()); |
92 | } | 92 | } |
93 | 93 | ||
@@ -111,8 +111,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
111 | Vector3 sp2Position = new Vector3(250, 128, 20); | 111 | Vector3 sp2Position = new Vector3(250, 128, 20); |
112 | 112 | ||
113 | SceneHelpers sh = new SceneHelpers(); | 113 | SceneHelpers sh = new SceneHelpers(); |
114 | TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); | 114 | TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); |
115 | TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); | 115 | TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); |
116 | 116 | ||
117 | SetupNeighbourRegions(sceneWest, sceneEast); | 117 | SetupNeighbourRegions(sceneWest, sceneEast); |
118 | 118 | ||
@@ -124,12 +124,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
124 | // physics is irrelevant to this test. | 124 | // physics is irrelevant to this test. |
125 | sp1.Flying = true; | 125 | sp1.Flying = true; |
126 | 126 | ||
127 | // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to | 127 | // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to |
128 | // make the connection. For this test, will simplify this chain by making the connection directly. | 128 | // make the connection. For this test, will simplify this chain by making the connection directly. |
129 | ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid); | 129 | ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid); |
130 | TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; | 130 | TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; |
131 | 131 | ||
132 | sp1.AbsolutePosition = sp1Position; | 132 | sp1.AbsolutePosition = sp1Position; |
133 | 133 | ||
134 | ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid); | 134 | ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid); |
135 | TestClient sp2Client = (TestClient)sp2.ControllingClient; | 135 | TestClient sp2Client = (TestClient)sp2.ControllingClient; |
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
138 | ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid); | 138 | ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid); |
139 | TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; | 139 | TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; |
140 | 140 | ||
141 | sp2.AbsolutePosition = sp2Position; | 141 | sp2.AbsolutePosition = sp2Position; |
142 | 142 | ||
143 | // We must update the scenes in order to make the root new root agents trigger position updates in their | 143 | // We must update the scenes in order to make the root new root agents trigger position updates in their |
144 | // children. | 144 | // children. |
@@ -147,19 +147,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
147 | 147 | ||
148 | // Check child positions are correct. | 148 | // Check child positions are correct. |
149 | Assert.AreEqual( | 149 | Assert.AreEqual( |
150 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), | 150 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), |
151 | sp1ChildClient.SceneAgent.AbsolutePosition); | 151 | sp1ChildClient.SceneAgent.AbsolutePosition); |
152 | 152 | ||
153 | Assert.AreEqual( | 153 | Assert.AreEqual( |
154 | new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), | 154 | new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), |
155 | sp2ChildClient.SceneAgent.AbsolutePosition); | 155 | sp2ChildClient.SceneAgent.AbsolutePosition); |
156 | 156 | ||
157 | string receivedSp1ChatMessage = ""; | 157 | string receivedSp1ChatMessage = ""; |
158 | string receivedSp2ChatMessage = ""; | 158 | string receivedSp2ChatMessage = ""; |
159 | 159 | ||
160 | sp1ChildClient.OnReceivedChatMessage | 160 | sp1ChildClient.OnReceivedChatMessage |
161 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; | 161 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; |
162 | sp2ChildClient.OnReceivedChatMessage | 162 | sp2ChildClient.OnReceivedChatMessage |
163 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; | 163 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; |
164 | 164 | ||
165 | TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); | 165 | TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); |
@@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
175 | 175 | ||
176 | // Check child position is correct. | 176 | // Check child position is correct. |
177 | Assert.AreEqual( | 177 | Assert.AreEqual( |
178 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), | 178 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), |
179 | sp1ChildClient.SceneAgent.AbsolutePosition); | 179 | sp1ChildClient.SceneAgent.AbsolutePosition); |
180 | 180 | ||
181 | TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); | 181 | TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); |
@@ -202,8 +202,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
202 | Vector3 sp2Position = new Vector3(128, 6, 20); | 202 | Vector3 sp2Position = new Vector3(128, 6, 20); |
203 | 203 | ||
204 | SceneHelpers sh = new SceneHelpers(); | 204 | SceneHelpers sh = new SceneHelpers(); |
205 | TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); | 205 | TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); |
206 | TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); | 206 | TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); |
207 | 207 | ||
208 | SetupNeighbourRegions(sceneNorth, sceneSouth); | 208 | SetupNeighbourRegions(sceneNorth, sceneSouth); |
209 | 209 | ||
@@ -215,12 +215,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
215 | // physics is irrelevant to this test. | 215 | // physics is irrelevant to this test. |
216 | sp1.Flying = true; | 216 | sp1.Flying = true; |
217 | 217 | ||
218 | // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to | 218 | // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to |
219 | // make the connection. For this test, will simplify this chain by making the connection directly. | 219 | // make the connection. For this test, will simplify this chain by making the connection directly. |
220 | ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid); | 220 | ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid); |
221 | TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; | 221 | TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; |
222 | 222 | ||
223 | sp1.AbsolutePosition = sp1Position; | 223 | sp1.AbsolutePosition = sp1Position; |
224 | 224 | ||
225 | ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid); | 225 | ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid); |
226 | TestClient sp2Client = (TestClient)sp2.ControllingClient; | 226 | TestClient sp2Client = (TestClient)sp2.ControllingClient; |
@@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
229 | ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid); | 229 | ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid); |
230 | TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; | 230 | TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; |
231 | 231 | ||
232 | sp2.AbsolutePosition = sp2Position; | 232 | sp2.AbsolutePosition = sp2Position; |
233 | 233 | ||
234 | // We must update the scenes in order to make the root new root agents trigger position updates in their | 234 | // We must update the scenes in order to make the root new root agents trigger position updates in their |
235 | // children. | 235 | // children. |
@@ -238,19 +238,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
238 | 238 | ||
239 | // Check child positions are correct. | 239 | // Check child positions are correct. |
240 | Assert.AreEqual( | 240 | Assert.AreEqual( |
241 | new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), | 241 | new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), |
242 | sp1ChildClient.SceneAgent.AbsolutePosition); | 242 | sp1ChildClient.SceneAgent.AbsolutePosition); |
243 | 243 | ||
244 | Assert.AreEqual( | 244 | Assert.AreEqual( |
245 | new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), | 245 | new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), |
246 | sp2ChildClient.SceneAgent.AbsolutePosition); | 246 | sp2ChildClient.SceneAgent.AbsolutePosition); |
247 | 247 | ||
248 | string receivedSp1ChatMessage = ""; | 248 | string receivedSp1ChatMessage = ""; |
249 | string receivedSp2ChatMessage = ""; | 249 | string receivedSp2ChatMessage = ""; |
250 | 250 | ||
251 | sp1ChildClient.OnReceivedChatMessage | 251 | sp1ChildClient.OnReceivedChatMessage |
252 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; | 252 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; |
253 | sp2ChildClient.OnReceivedChatMessage | 253 | sp2ChildClient.OnReceivedChatMessage |
254 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; | 254 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; |
255 | 255 | ||
256 | TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); | 256 | TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); |
@@ -266,13 +266,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
266 | 266 | ||
267 | // Check child position is correct. | 267 | // Check child position is correct. |
268 | Assert.AreEqual( | 268 | Assert.AreEqual( |
269 | new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), | 269 | new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), |
270 | sp1ChildClient.SceneAgent.AbsolutePosition); | 270 | sp1ChildClient.SceneAgent.AbsolutePosition); |
271 | 271 | ||
272 | TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); | 272 | TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); |
273 | TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage); | 273 | TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage); |
274 | } | 274 | } |
275 | 275 | ||
276 | private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage) | 276 | private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage) |
277 | { | 277 | { |
278 | receivedMessage = ""; | 278 | receivedMessage = ""; |