From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- .../Region/CoreModules/Avatar/Chat/ChatModule.cs | 30 ++++++------- .../Avatar/Chat/Tests/ChatModuleTests.cs | 52 +++++++++++----------- 2 files changed, 41 insertions(+), 41 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/Chat') 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 m_enabled = false; return; } - + m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance); m_saydistance = m_config.GetInt("say_distance", m_saydistance); m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance); @@ -123,7 +123,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat } } } - + public virtual void Close() { } @@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat { } - public virtual Type ReplaceableInterface + public virtual Type ReplaceableInterface { get { return null; } } @@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat return; } - switch (sourceType) + switch (sourceType) { case ChatSourceType.Agent: ScenePresence avatar = (scene as Scene).GetScenePresence(c.Sender.AgentId); @@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat } destination = UUID.Zero; // Avatars cant "SayTo" ownerID = c.Sender.AgentId; - + hidePos = fromPos; break; @@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat message = message.Substring(0, 1000); // m_log.DebugFormat( -// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", +// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", // fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); HashSet receiverIDs = new HashSet(); @@ -317,13 +317,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat } } }); - + scene.EventManager.TriggerOnChatToClients( fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); } static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30); - + public virtual void OnChatBroadcast(Object sender, OSChatMessage c) { if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; @@ -341,7 +341,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat // broadcast chat works by redistributing every incoming chat // message to each avatar in the scene. string fromName = c.From; - + UUID fromID = UUID.Zero; UUID ownerID = UUID.Zero; ChatSourceType sourceType = ChatSourceType.Object; @@ -353,15 +353,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat ownerID = c.Sender.AgentId; sourceType = ChatSourceType.Agent; } - else if (c.SenderUUID != UUID.Zero) + else if (c.SenderUUID != UUID.Zero) { fromID = c.SenderUUID; ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; } - + // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); HashSet receiverIDs = new HashSet(); - + if (c.Scene != null) { ((Scene)c.Scene).ForEachRootClient @@ -374,7 +374,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat (null != c.SenderObject) && (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) return; - + client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, (byte)sourceType, (byte)ChatAudibleLevel.Fully); receiverIDs.Add(client.AgentId); @@ -400,7 +400,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat /// /// /// - /// true if the message was sent to the receiver, false if it was not sent due to failing a + /// true if the message was sent to the receiver, false if it was not sent due to failing a /// precondition protected virtual bool TrySendChatMessage( ScenePresence presence, Vector3 fromPos, Vector3 regionPos, @@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat presence.ControllingClient.SendChatMessage( message, (byte) type, fromPos, fromName, fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); - + return true; } 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 { [TestFixture] public class ChatModuleTests : OpenSimTestCase - { + { [TestFixtureSetUp] public void FixtureInit() { @@ -66,14 +66,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests } private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB) - { - // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the + { + // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the // CapabilitiesModule complain when it can't set up HTTP endpoints. BaseHttpServer httpServer = new BaseHttpServer(99999); MainServer.AddHttpServer(httpServer); MainServer.Instance = httpServer; - // We need entity transfer modules so that when sp2 logs into the east region, the region calls + // We need entity transfer modules so that when sp2 logs into the east region, the region calls // EntityTransferModuleto set up a child agent on the west region. // XXX: However, this is not an entity transfer so is misleading. EntityTransferModule etmA = new EntityTransferModule(); @@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests modulesConfig.Set("SimulationServices", lscm.Name); SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); - SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); + SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule()); } @@ -111,8 +111,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests Vector3 sp2Position = new Vector3(250, 128, 20); SceneHelpers sh = new SceneHelpers(); - TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); - TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); + TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); + TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); SetupNeighbourRegions(sceneWest, sceneEast); @@ -124,12 +124,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // physics is irrelevant to this test. sp1.Flying = true; - // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to + // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to // make the connection. For this test, will simplify this chain by making the connection directly. ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid); TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; - sp1.AbsolutePosition = sp1Position; + sp1.AbsolutePosition = sp1Position; ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid); TestClient sp2Client = (TestClient)sp2.ControllingClient; @@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid); TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; - sp2.AbsolutePosition = sp2Position; + sp2.AbsolutePosition = sp2Position; // We must update the scenes in order to make the root new root agents trigger position updates in their // children. @@ -147,19 +147,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // Check child positions are correct. Assert.AreEqual( - new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), + new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), sp1ChildClient.SceneAgent.AbsolutePosition); Assert.AreEqual( - new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), + new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), sp2ChildClient.SceneAgent.AbsolutePosition); string receivedSp1ChatMessage = ""; string receivedSp2ChatMessage = ""; - sp1ChildClient.OnReceivedChatMessage + sp1ChildClient.OnReceivedChatMessage += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; - sp2ChildClient.OnReceivedChatMessage + sp2ChildClient.OnReceivedChatMessage += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); @@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // Check child position is correct. Assert.AreEqual( - new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), + new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), sp1ChildClient.SceneAgent.AbsolutePosition); TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); @@ -202,8 +202,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests Vector3 sp2Position = new Vector3(128, 6, 20); SceneHelpers sh = new SceneHelpers(); - TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); - TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); + TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); + TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); SetupNeighbourRegions(sceneNorth, sceneSouth); @@ -215,12 +215,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // physics is irrelevant to this test. sp1.Flying = true; - // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to + // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to // make the connection. For this test, will simplify this chain by making the connection directly. ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid); TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; - sp1.AbsolutePosition = sp1Position; + sp1.AbsolutePosition = sp1Position; ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid); TestClient sp2Client = (TestClient)sp2.ControllingClient; @@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid); TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; - sp2.AbsolutePosition = sp2Position; + sp2.AbsolutePosition = sp2Position; // We must update the scenes in order to make the root new root agents trigger position updates in their // children. @@ -238,19 +238,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // Check child positions are correct. Assert.AreEqual( - new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), + new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), sp1ChildClient.SceneAgent.AbsolutePosition); Assert.AreEqual( - new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), + new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), sp2ChildClient.SceneAgent.AbsolutePosition); string receivedSp1ChatMessage = ""; string receivedSp2ChatMessage = ""; - sp1ChildClient.OnReceivedChatMessage + sp1ChildClient.OnReceivedChatMessage += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; - sp2ChildClient.OnReceivedChatMessage + sp2ChildClient.OnReceivedChatMessage += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); @@ -266,13 +266,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // Check child position is correct. Assert.AreEqual( - new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), + new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), sp1ChildClient.SceneAgent.AbsolutePosition); TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage); } - + private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage) { receivedMessage = ""; -- cgit v1.1