diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 15a90aff52..c839c05a3a 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12403,6 +12403,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// OpenMetaverse.packet public void ProcessInPacket(Packet packet) { + if (m_inPacketsToDrop != null) + if (m_inPacketsToDrop.Contains(packet.Type.ToString())) + return; + if (DebugPacketLevel > 0) { bool logPacket = true; @@ -13150,5 +13154,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP { return new HashSet(m_outPacketsToDrop); } + + private HashSet m_inPacketsToDrop; + + public bool AddInPacketToDropSet(string packetName) + { + if (m_inPacketsToDrop == null) + m_inPacketsToDrop = new HashSet(); + + return m_inPacketsToDrop.Add(packetName); + } + + public bool RemoveInPacketFromDropSet(string packetName) + { + if (m_inPacketsToDrop == null) + return false; + + return m_inPacketsToDrop.Remove(packetName); + } + + public HashSet GetInPacketDropSet() + { + return new HashSet(m_inPacketsToDrop); + } } } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 549573b048..87aa37dad1 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -698,9 +698,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP HandlePacketCommand); MainConsole.Instance.Commands.AddCommand( - "Debug", false, "debug lludp drop out", - "debug lludp drop out ", - "Drop all outbound packets that match the given name", + "Debug", false, "debug lludp drop", + "debug lludp drop ", + "Drop all in or outbound packets that match the given name", "For test purposes.", HandleDropCommand); @@ -834,36 +834,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (args.Length != 6) { - MainConsole.Instance.Output("Usage: debug lludp drop out "); + MainConsole.Instance.Output("Usage: debug lludp drop "); return; } + string direction = args[3]; string subCommand = args[4]; string packetName = args[5]; if (subCommand == "add") { MainConsole.Instance.OutputFormat( - "Adding packet {0} to out drop list for all connections in {1}", packetName, Scene.Name); + "Adding packet {0} to {1} drop list for all connections in {2}", direction, packetName, Scene.Name); Scene.ForEachScenePresence( sp => { LLClientView llcv = (LLClientView)sp.ControllingClient; - llcv.AddOutPacketToDropSet(packetName); + + if (direction == "in") + llcv.AddInPacketToDropSet(packetName); + else if (direction == "out") + llcv.AddOutPacketToDropSet(packetName); } ); } else if (subCommand == "remove") { MainConsole.Instance.OutputFormat( - "Removing packet {0} from out drop list for all connections in {1}", packetName, Scene.Name); + "Removing packet {0} from {1} drop list for all connections in {2}", direction, packetName, Scene.Name); Scene.ForEachScenePresence( sp => { LLClientView llcv = (LLClientView)sp.ControllingClient; - llcv.RemoveOutPacketFromDropSet(packetName); + + if (direction == "in") + llcv.RemoveInPacketFromDropSet(packetName); + else if (direction == "out") + llcv.RemoveOutPacketFromDropSet(packetName); } ); }