aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-08-19 18:43:21 +0100
committerJustin Clark-Casey (justincc)2014-08-19 18:43:21 +0100
commit4e03d352c356ca9ebe22a1ac623dc85f4b7922e8 (patch)
tree58fa4db136d12d0fe0efc1d875df3268d5fbeef5 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
parentAdd "debug lludp drop out <add|remove> <packet-name>" console command for deb... (diff)
downloadopensim-SC-4e03d352c356ca9ebe22a1ac623dc85f4b7922e8.zip
opensim-SC-4e03d352c356ca9ebe22a1ac623dc85f4b7922e8.tar.gz
opensim-SC-4e03d352c356ca9ebe22a1ac623dc85f4b7922e8.tar.bz2
opensim-SC-4e03d352c356ca9ebe22a1ac623dc85f4b7922e8.tar.xz
Extend drop command to "debug lludp drop <in|out>..." to allow drop of inbound packets.
For test/debug purposes.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs25
1 files changed, 17 insertions, 8 deletions
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
698 HandlePacketCommand); 698 HandlePacketCommand);
699 699
700 MainConsole.Instance.Commands.AddCommand( 700 MainConsole.Instance.Commands.AddCommand(
701 "Debug", false, "debug lludp drop out", 701 "Debug", false, "debug lludp drop",
702 "debug lludp drop out <add|remove> <packet-name>", 702 "debug lludp drop <in|out> <add|remove> <packet-name>",
703 "Drop all outbound packets that match the given name", 703 "Drop all in or outbound packets that match the given name",
704 "For test purposes.", 704 "For test purposes.",
705 HandleDropCommand); 705 HandleDropCommand);
706 706
@@ -834,36 +834,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP
834 834
835 if (args.Length != 6) 835 if (args.Length != 6)
836 { 836 {
837 MainConsole.Instance.Output("Usage: debug lludp drop out <add|remove> <packet-name>"); 837 MainConsole.Instance.Output("Usage: debug lludp drop <in|out> <add|remove> <packet-name>");
838 return; 838 return;
839 } 839 }
840 840
841 string direction = args[3];
841 string subCommand = args[4]; 842 string subCommand = args[4];
842 string packetName = args[5]; 843 string packetName = args[5];
843 844
844 if (subCommand == "add") 845 if (subCommand == "add")
845 { 846 {
846 MainConsole.Instance.OutputFormat( 847 MainConsole.Instance.OutputFormat(
847 "Adding packet {0} to out drop list for all connections in {1}", packetName, Scene.Name); 848 "Adding packet {0} to {1} drop list for all connections in {2}", direction, packetName, Scene.Name);
848 849
849 Scene.ForEachScenePresence( 850 Scene.ForEachScenePresence(
850 sp => 851 sp =>
851 { 852 {
852 LLClientView llcv = (LLClientView)sp.ControllingClient; 853 LLClientView llcv = (LLClientView)sp.ControllingClient;
853 llcv.AddOutPacketToDropSet(packetName); 854
855 if (direction == "in")
856 llcv.AddInPacketToDropSet(packetName);
857 else if (direction == "out")
858 llcv.AddOutPacketToDropSet(packetName);
854 } 859 }
855 ); 860 );
856 } 861 }
857 else if (subCommand == "remove") 862 else if (subCommand == "remove")
858 { 863 {
859 MainConsole.Instance.OutputFormat( 864 MainConsole.Instance.OutputFormat(
860 "Removing packet {0} from out drop list for all connections in {1}", packetName, Scene.Name); 865 "Removing packet {0} from {1} drop list for all connections in {2}", direction, packetName, Scene.Name);
861 866
862 Scene.ForEachScenePresence( 867 Scene.ForEachScenePresence(
863 sp => 868 sp =>
864 { 869 {
865 LLClientView llcv = (LLClientView)sp.ControllingClient; 870 LLClientView llcv = (LLClientView)sp.ControllingClient;
866 llcv.RemoveOutPacketFromDropSet(packetName); 871
872 if (direction == "in")
873 llcv.RemoveInPacketFromDropSet(packetName);
874 else if (direction == "out")
875 llcv.RemoveOutPacketFromDropSet(packetName);
867 } 876 }
868 ); 877 );
869 } 878 }