aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs49
1 files changed, 48 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 0393a29..e45de51 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -434,7 +434,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
434 } 434 }
435 #endregion BinaryStats 435 #endregion BinaryStats
436 436
437 m_throttle = new TokenBucket(null, sceneThrottleBps); 437 // FIXME: Can't add info here because don't know scene yet.
438// m_throttle
439// = new TokenBucket(
440// string.Format("server throttle bucket for {0}", Scene.Name), null, sceneThrottleBps);
441
442 m_throttle = new TokenBucket("server throttle bucket", null, sceneThrottleBps);
443
438 ThrottleRates = new ThrottleRates(configSource); 444 ThrottleRates = new ThrottleRates(configSource);
439 445
440 if (usePools) 446 if (usePools)
@@ -758,6 +764,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
758 MainConsole.Instance.Commands.AddCommand( 764 MainConsole.Instance.Commands.AddCommand(
759 "Debug", 765 "Debug",
760 false, 766 false,
767 "debug lludp throttle log",
768 "debug lludp throttle log <level> <avatar-first-name> <avatar-last-name>",
769 "Change debug logging level for throttles.",
770 "If level >= 0 then throttle debug logging is performed.\n"
771 + "If level <= 0 then no throttle debug logging is performed.",
772 HandleThrottleCommand);
773
774 MainConsole.Instance.Commands.AddCommand(
775 "Debug",
776 false,
761 "debug lludp toggle agentupdate", 777 "debug lludp toggle agentupdate",
762 "debug lludp toggle agentupdate", 778 "debug lludp toggle agentupdate",
763 "Toggle whether agentupdate packets are processed or simply discarded.", 779 "Toggle whether agentupdate packets are processed or simply discarded.",
@@ -795,6 +811,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
795 }); 811 });
796 } 812 }
797 813
814 private void HandleThrottleCommand(string module, string[] args)
815 {
816 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene)
817 return;
818
819 if (args.Length != 7)
820 {
821 MainConsole.Instance.OutputFormat("Usage: debug lludp throttle log <level> <avatar-first-name> <avatar-last-name>");
822 return;
823 }
824
825 int level;
826 if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[4], out level))
827 return;
828
829 string firstName = args[5];
830 string lastName = args[6];
831
832 Scene.ForEachScenePresence(sp =>
833 {
834 if (sp.Firstname == firstName && sp.Lastname == lastName)
835 {
836 MainConsole.Instance.OutputFormat(
837 "Throttle log level for {0} ({1}) set to {2} in {3}",
838 sp.Name, sp.IsChildAgent ? "child" : "root", level, Scene.Name);
839
840 ((LLClientView)sp.ControllingClient).UDPClient.ThrottleDebugLevel = level;
841 }
842 });
843 }
844
798 private void HandlePacketCommand(string module, string[] args) 845 private void HandlePacketCommand(string module, string[] args)
799 { 846 {
800 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) 847 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene)