From 4e03d352c356ca9ebe22a1ac623dc85f4b7922e8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 19 Aug 2014 18:43:21 +0100 Subject: Extend drop command to "debug lludp drop ..." to allow drop of inbound packets. For test/debug purposes. --- .../Region/ClientStack/Linden/UDP/LLUDPServer.cs | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 549573b..87aa37d 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); } ); } -- cgit v1.1