diff options
author | Justin Clark-Casey (justincc) | 2014-08-19 18:34:17 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-08-19 18:34:17 +0100 |
commit | 298376d5c7a8207f3c42f950cf9c212950038477 (patch) | |
tree | 87a1bbb16b146ec03a9fa57c03940f44c4fb9a77 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |
parent | minor:Give console feedback when we sit or stand pCampbot bots. (diff) | |
download | opensim-SC-298376d5c7a8207f3c42f950cf9c212950038477.zip opensim-SC-298376d5c7a8207f3c42f950cf9c212950038477.tar.gz opensim-SC-298376d5c7a8207f3c42f950cf9c212950038477.tar.bz2 opensim-SC-298376d5c7a8207f3c42f950cf9c212950038477.tar.xz |
Add "debug lludp drop out <add|remove> <packet-name>" console command for debug/test purposes.
This drops all outbound packets that match a given packet name.
Can currently only be applied to all connections in a scene.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 3c9bb1b..549573b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -698,6 +698,13 @@ 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", | ||
702 | "debug lludp drop out <add|remove> <packet-name>", | ||
703 | "Drop all outbound packets that match the given name", | ||
704 | "For test purposes.", | ||
705 | HandleDropCommand); | ||
706 | |||
707 | MainConsole.Instance.Commands.AddCommand( | ||
701 | "Debug", | 708 | "Debug", |
702 | false, | 709 | false, |
703 | "debug lludp start", | 710 | "debug lludp start", |
@@ -820,6 +827,48 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
820 | } | 827 | } |
821 | } | 828 | } |
822 | 829 | ||
830 | private void HandleDropCommand(string module, string[] args) | ||
831 | { | ||
832 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) | ||
833 | return; | ||
834 | |||
835 | if (args.Length != 6) | ||
836 | { | ||
837 | MainConsole.Instance.Output("Usage: debug lludp drop out <add|remove> <packet-name>"); | ||
838 | return; | ||
839 | } | ||
840 | |||
841 | string subCommand = args[4]; | ||
842 | string packetName = args[5]; | ||
843 | |||
844 | if (subCommand == "add") | ||
845 | { | ||
846 | MainConsole.Instance.OutputFormat( | ||
847 | "Adding packet {0} to out drop list for all connections in {1}", packetName, Scene.Name); | ||
848 | |||
849 | Scene.ForEachScenePresence( | ||
850 | sp => | ||
851 | { | ||
852 | LLClientView llcv = (LLClientView)sp.ControllingClient; | ||
853 | llcv.AddOutPacketToDropSet(packetName); | ||
854 | } | ||
855 | ); | ||
856 | } | ||
857 | else if (subCommand == "remove") | ||
858 | { | ||
859 | MainConsole.Instance.OutputFormat( | ||
860 | "Removing packet {0} from out drop list for all connections in {1}", packetName, Scene.Name); | ||
861 | |||
862 | Scene.ForEachScenePresence( | ||
863 | sp => | ||
864 | { | ||
865 | LLClientView llcv = (LLClientView)sp.ControllingClient; | ||
866 | llcv.RemoveOutPacketFromDropSet(packetName); | ||
867 | } | ||
868 | ); | ||
869 | } | ||
870 | } | ||
871 | |||
823 | private void HandleStartCommand(string module, string[] args) | 872 | private void HandleStartCommand(string module, string[] args) |
824 | { | 873 | { |
825 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) | 874 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) |