mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Add "debug lludp set scene-throttle-max <value>" console command to allow us to potentially set the scene max throttle on the fly.
This commit is contained in:
@@ -153,6 +153,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
"Only current setting is 'adaptive' which must be 'true' or 'false'",
|
||||
HandleThrottleSetCommand);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"Debug",
|
||||
false,
|
||||
"debug lludp set",
|
||||
"debug lludp set <param> <value>",
|
||||
"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,
|
||||
@@ -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 <param> <value>");
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user