diff options
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs index 59c2042..e623ee9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs | |||
@@ -150,7 +150,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
150 | "debug lludp throttles set", | 150 | "debug lludp throttles set", |
151 | "debug lludp throttles set <param> <value> [<avatar-first-name> <avatar-last-name>]", | 151 | "debug lludp throttles set <param> <value> [<avatar-first-name> <avatar-last-name>]", |
152 | "Set a throttle parameter for the given client.", | 152 | "Set a throttle parameter for the given client.", |
153 | "Only current setting is 'adaptive' which must be 'true' or 'false'", | 153 | "Avaiable parameters are:\n" |
154 | + "adaptive - true/false, control adaptive throttle setting\n" | ||
155 | + "throttle-max - kbps, control maximum throttle setting for current and future clients\n", | ||
154 | HandleThrottleSetCommand); | 156 | HandleThrottleSetCommand); |
155 | 157 | ||
156 | m_console.Commands.AddCommand( | 158 | m_console.Commands.AddCommand( |
@@ -182,6 +184,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
182 | cdl.AddRow( | 184 | cdl.AddRow( |
183 | "Max scene throttle", | 185 | "Max scene throttle", |
184 | m_udpServer.MaxTotalDripRate != 0 ? string.Format("{0} kbps", m_udpServer.MaxTotalDripRate * 8 / 1000) : "unset"); | 186 | m_udpServer.MaxTotalDripRate != 0 ? string.Format("{0} kbps", m_udpServer.MaxTotalDripRate * 8 / 1000) : "unset"); |
187 | cdl.AddRow( | ||
188 | "Max new client throttle", | ||
189 | string.Format("{0} kbps", m_udpServer.ThrottleRates.Total * 8 / 1000)); | ||
185 | 190 | ||
186 | m_console.Output(cdl.ToString()); | 191 | m_console.Output(cdl.ToString()); |
187 | 192 | ||
@@ -357,6 +362,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
357 | } | 362 | } |
358 | }); | 363 | }); |
359 | } | 364 | } |
365 | else if (param == "throttle-max") | ||
366 | { | ||
367 | int newValue; | ||
368 | if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, rawValue, out newValue)) | ||
369 | return; | ||
370 | |||
371 | int newThrottleMaxKbps = newValue * 1000 / 8; | ||
372 | m_udpServer.ThrottleRates.Total = newThrottleMaxKbps; | ||
373 | |||
374 | m_udpServer.Scene.ForEachScenePresence(sp => | ||
375 | { | ||
376 | if (all || (sp.Firstname == firstName && sp.Lastname == lastName)) | ||
377 | { | ||
378 | MainConsole.Instance.OutputFormat( | ||
379 | "Setting param {0} to {1} for {2} ({3}) in {4}", | ||
380 | param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name); | ||
381 | |||
382 | LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; | ||
383 | udpClient.FlowThrottle.RequestedDripRate = newThrottleMaxKbps; | ||
384 | udpClient.FlowThrottle.MaxDripRate = newThrottleMaxKbps; | ||
385 | } | ||
386 | }); | ||
387 | } | ||
360 | } | 388 | } |
361 | 389 | ||
362 | private void HandleThrottleGetCommand(string module, string[] args) | 390 | private void HandleThrottleGetCommand(string module, string[] args) |
@@ -392,7 +420,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
392 | sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name); | 420 | sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name); |
393 | 421 | ||
394 | LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; | 422 | LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; |
395 | MainConsole.Instance.OutputFormat("Adaptive throttle: {0}", udpClient.FlowThrottle.Enabled); | 423 | |
424 | ConsoleDisplayList cdl = new ConsoleDisplayList(); | ||
425 | cdl.AddRow("Adaptive throttle", udpClient.FlowThrottle.Enabled); | ||
426 | cdl.AddRow("Max throttle", string.Format("{0} kbps", udpClient.FlowThrottle.RequestedDripRate / 8 * 1000)); | ||
396 | } | 427 | } |
397 | }); | 428 | }); |
398 | } | 429 | } |