From 1d33a40f59fc15bd85004cc68e802a0b274dad30 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 6 Oct 2014 23:29:41 +0100 Subject: Add "debug lludp set scene-throttle-max " console command to allow us to potentially set the scene max throttle on the fly. --- .../ClientStack/Linden/UDP/LLUDPServerCommands.cs | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs index 438331a..f0f186a 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs @@ -156,6 +156,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_console.Commands.AddCommand( "Debug", false, + "debug lludp set", + "debug lludp set ", + "Set a parameter for the server.", + "Only current setting is 'scene-throttle-max' which sets the current max cumulative kbit/s provided for this scene to clients", + HandleSetCommand); + + m_console.Commands.AddCommand( + "Debug", + false, "debug lludp toggle agentupdate", "debug lludp toggle agentupdate", "Toggle whether agentupdate packets are processed or simply discarded.", @@ -363,6 +372,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP }); } + private void HandleSetCommand(string module, string[] args) + { + if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene) + return; + + if (args.Length != 5) + { + MainConsole.Instance.OutputFormat("Usage: debug lludp set "); + return; + } + + string param = args[3]; + string rawValue = args[4]; + + int newValue; + + if (param == "scene-throttle-max") + { + if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, rawValue, out newValue)) + return; + + m_udpServer.Throttle.RequestedDripRate = newValue * 8 * 1000; + } + + m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name); + } + private void HandlePacketCommand(string module, string[] args) { if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene) -- cgit v1.1