diff options
author | Justin Clark-Casey (justincc) | 2014-09-30 18:41:04 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-11-25 23:18:38 +0000 |
commit | e144958e03a5c2bd723b43db75a926452af60e43 (patch) | |
tree | d00ad0f856d39002dacc899db6cf60fc1e933935 | |
parent | Eliminate a few unnecessary calculations in the maintenance loop. (diff) | |
download | opensim-SC_OLD-e144958e03a5c2bd723b43db75a926452af60e43.zip opensim-SC_OLD-e144958e03a5c2bd723b43db75a926452af60e43.tar.gz opensim-SC_OLD-e144958e03a5c2bd723b43db75a926452af60e43.tar.bz2 opensim-SC_OLD-e144958e03a5c2bd723b43db75a926452af60e43.tar.xz |
Add "debug lludp throttle set" command to allow setting of parameters at runtime
Can currently only set adaptive true|false, where adaptive = false
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | 4 |
2 files changed, 52 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 6e31322..259e1ba 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -782,6 +782,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
782 | MainConsole.Instance.Commands.AddCommand( | 782 | MainConsole.Instance.Commands.AddCommand( |
783 | "Debug", | 783 | "Debug", |
784 | false, | 784 | false, |
785 | "debug lludp throttle set", | ||
786 | "debug lludp throttle set <param> <value> <avatar-first-name> <avatar-last-name>", | ||
787 | "Set a throttle parameter for the given client.", | ||
788 | "Only current setting is 'adaptive' which must be 'true' or 'false'", | ||
789 | HandleThrottleSetCommand); | ||
790 | |||
791 | MainConsole.Instance.Commands.AddCommand( | ||
792 | "Debug", | ||
793 | false, | ||
785 | "debug lludp toggle agentupdate", | 794 | "debug lludp toggle agentupdate", |
786 | "debug lludp toggle agentupdate", | 795 | "debug lludp toggle agentupdate", |
787 | "Toggle whether agentupdate packets are processed or simply discarded.", | 796 | "Toggle whether agentupdate packets are processed or simply discarded.", |
@@ -850,6 +859,46 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
850 | }); | 859 | }); |
851 | } | 860 | } |
852 | 861 | ||
862 | private void HandleThrottleSetCommand(string module, string[] args) | ||
863 | { | ||
864 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) | ||
865 | return; | ||
866 | |||
867 | if (args.Length != 8) | ||
868 | { | ||
869 | MainConsole.Instance.OutputFormat( | ||
870 | "Usage: debug lludp throttle set <param> <value> <avatar-first-name> <avatar-last-name>"); | ||
871 | return; | ||
872 | } | ||
873 | |||
874 | string param = args[4]; | ||
875 | string rawValue = args[5]; | ||
876 | string firstName = args[6]; | ||
877 | string lastName = args[7]; | ||
878 | |||
879 | if (param == "adaptive") | ||
880 | { | ||
881 | bool newValue; | ||
882 | if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newValue)) | ||
883 | return; | ||
884 | |||
885 | Scene.ForEachScenePresence(sp => | ||
886 | { | ||
887 | if (sp.Firstname == firstName && sp.Lastname == lastName) | ||
888 | { | ||
889 | MainConsole.Instance.OutputFormat( | ||
890 | "Setting param {0} to {1} for {2} ({3}) in {4}", | ||
891 | param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", Scene.Name); | ||
892 | |||
893 | LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; | ||
894 | udpClient.FlowThrottle.Enabled = newValue; | ||
895 | // udpClient.FlowThrottle.MaxDripRate = 0; | ||
896 | // udpClient.FlowThrottle.AdjustedDripRate = 0; | ||
897 | } | ||
898 | }); | ||
899 | } | ||
900 | } | ||
901 | |||
853 | private void HandleThrottleStatusCommand(string module, string[] args) | 902 | private void HandleThrottleStatusCommand(string module, string[] args) |
854 | { | 903 | { |
855 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) | 904 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) |
@@ -865,7 +914,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
865 | string lastName = args[5]; | 914 | string lastName = args[5]; |
866 | 915 | ||
867 | Scene.ForEachScenePresence(sp => | 916 | Scene.ForEachScenePresence(sp => |
868 | { | 917 | { |
869 | if (sp.Firstname == firstName && sp.Lastname == lastName) | 918 | if (sp.Firstname == firstName && sp.Lastname == lastName) |
870 | { | 919 | { |
871 | MainConsole.Instance.OutputFormat( | 920 | MainConsole.Instance.OutputFormat( |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs index 658d9bb..e4a12bd 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | |||
@@ -340,10 +340,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
340 | public Int64 MaxDripRate | 340 | public Int64 MaxDripRate |
341 | { | 341 | { |
342 | get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); } | 342 | get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); } |
343 | protected set { m_maxDripRate = (value == 0 ? 0 : Math.Max(value,m_minimumFlow)); } | 343 | set { m_maxDripRate = (value == 0 ? 0 : Math.Max(value,m_minimumFlow)); } |
344 | } | 344 | } |
345 | 345 | ||
346 | public bool Enabled { get; private set; } | 346 | public bool Enabled { get; set; } |
347 | 347 | ||
348 | // <summary> | 348 | // <summary> |
349 | // | 349 | // |