aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs87
1 files changed, 33 insertions, 54 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
index ac6c0b4..012a57d 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
@@ -48,11 +48,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
48 48
49 public void Register() 49 public void Register()
50 { 50 {
51/*
51 m_console.Commands.AddCommand( 52 m_console.Commands.AddCommand(
52 "Comms", false, "show server throttles", 53 "Comms", false, "show server throttles",
53 "show server throttles", 54 "show server throttles",
54 "Show information about server throttles", 55 "Show information about server throttles",
55 HandleShowServerThrottlesCommand); 56 HandleShowServerThrottlesCommand);
56 57
57 m_console.Commands.AddCommand( 58 m_console.Commands.AddCommand(
58 "Debug", false, "debug lludp packet", 59 "Debug", false, "debug lludp packet",
@@ -206,13 +207,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
206 HandleClientGetCommand); 207 HandleClientGetCommand);
207 208
208 m_console.Commands.AddCommand( 209 m_console.Commands.AddCommand(
209 "Debug", 210 "Debug",
210 false, 211 false,
211 "debug lludp client set", 212 "debug lludp client set",
212 "debug lludp client set <param> <value> [<avatar-first-name> <avatar-last-name>]", 213 "debug lludp client set <param> <value> [<avatar-first-name> <avatar-last-name>]",
213 "Set a debug parameter for a particular client. If no name is given then the value is set on all clients.", 214 "Set a debug parameter for a particular client. If no name is given then the value is set on all clients.",
214 "process-unacked-sends - Do we take action if a sent reliable packet has not been acked.", 215 "process-unacked-sends - Do we take action if a sent reliable packet has not been acked.",
215 HandleClientSetCommand); 216 HandleClientSetCommand);
217*/
216 } 218 }
217 219
218 private void HandleShowServerThrottlesCommand(string module, string[] args) 220 private void HandleShowServerThrottlesCommand(string module, string[] args)
@@ -224,24 +226,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
224 ConsoleDisplayList cdl = new ConsoleDisplayList(); 226 ConsoleDisplayList cdl = new ConsoleDisplayList();
225 cdl.AddRow("Adaptive throttles", m_udpServer.ThrottleRates.AdaptiveThrottlesEnabled); 227 cdl.AddRow("Adaptive throttles", m_udpServer.ThrottleRates.AdaptiveThrottlesEnabled);
226 228
227 long maxSceneDripRate = m_udpServer.Throttle.MaxDripRate; 229 long maxSceneDripRate = (long)m_udpServer.Throttle.MaxDripRate;
228 cdl.AddRow( 230 cdl.AddRow(
229 "Max scene throttle", 231 "Max scene throttle",
230 maxSceneDripRate != 0 ? string.Format("{0} kbps", maxSceneDripRate * 8 / 1000) : "unset"); 232 maxSceneDripRate != 0 ? string.Format("{0} kbps", maxSceneDripRate * 8 / 1000) : "unset");
231 233
232 int maxClientDripRate = m_udpServer.ThrottleRates.Total; 234 int maxClientDripRate = m_udpServer.ThrottleRates.Total;
233 cdl.AddRow( 235 cdl.AddRow(
234 "Max new client throttle", 236 "Max new client throttle",
235 maxClientDripRate != 0 ? string.Format("{0} kbps", maxClientDripRate * 8 / 1000) : "unset"); 237 maxClientDripRate != 0 ? string.Format("{0} kbps", maxClientDripRate * 8 / 1000) : "unset");
236 238
237 m_console.Output(cdl.ToString()); 239 m_console.Output(cdl.ToString());
238 240
239 m_console.OutputFormat("{0}\n", GetServerThrottlesReport(m_udpServer)); 241 m_console.OutputFormat("{0}\n", GetServerThrottlesReport(m_udpServer));
240 } 242 }
241 243
242 private string GetServerThrottlesReport(LLUDPServer udpServer) 244 private string GetServerThrottlesReport(LLUDPServer udpServer)
243 { 245 {
244 StringBuilder report = new StringBuilder(); 246 StringBuilder report = new StringBuilder();
245 247
246 report.AppendFormat( 248 report.AppendFormat(
247 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}\n", 249 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}\n",
@@ -252,7 +254,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
252 "Cloud", 254 "Cloud",
253 "Task", 255 "Task",
254 "Texture", 256 "Texture",
255 "Asset"); 257 "Asset");
256 258
257 report.AppendFormat( 259 report.AppendFormat(
258 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}\n", 260 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}\n",
@@ -263,7 +265,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
263 "kb/s", 265 "kb/s",
264 "kb/s", 266 "kb/s",
265 "kb/s", 267 "kb/s",
266 "kb/s"); 268 "kb/s");
267 269
268 ThrottleRates throttleRates = udpServer.ThrottleRates; 270 ThrottleRates throttleRates = udpServer.ThrottleRates;
269 report.AppendFormat( 271 report.AppendFormat(
@@ -275,16 +277,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
275 (throttleRates.Cloud * 8) / 1000, 277 (throttleRates.Cloud * 8) / 1000,
276 (throttleRates.Task * 8) / 1000, 278 (throttleRates.Task * 8) / 1000,
277 (throttleRates.Texture * 8) / 1000, 279 (throttleRates.Texture * 8) / 1000,
278 (throttleRates.Asset * 8) / 1000); 280 (throttleRates.Asset * 8) / 1000);
279 281
280 return report.ToString(); 282 return report.ToString();
281 } 283 }
282 284
283 protected string GetColumnEntry(string entry, int maxLength, int columnPadding) 285 protected string GetColumnEntry(string entry, int maxLength, int columnPadding)
284 { 286 {
285 return string.Format( 287 return string.Format(
286 "{0,-" + maxLength + "}{1,-" + columnPadding + "}", 288 "{0,-" + maxLength + "}{1,-" + columnPadding + "}",
287 entry.Length > maxLength ? entry.Substring(0, maxLength) : entry, 289 entry.Length > maxLength ? entry.Substring(0, maxLength) : entry,
288 ""); 290 "");
289 } 291 }
290 292
@@ -373,7 +375,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
373 MainConsole.Instance.OutputFormat( 375 MainConsole.Instance.OutputFormat(
374 "Usage: debug lludp throttles set <param> <value> [<avatar-first-name> <avatar-last-name>]"); 376 "Usage: debug lludp throttles set <param> <value> [<avatar-first-name> <avatar-last-name>]");
375 return; 377 return;
376 } 378 }
377 379
378 string param = args[4]; 380 string param = args[4];
379 string rawValue = args[5]; 381 string rawValue = args[5];
@@ -465,7 +467,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
465 MainConsole.Instance.OutputFormat( 467 MainConsole.Instance.OutputFormat(
466 "Usage: debug lludp throttles get [<avatar-first-name> <avatar-last-name>]"); 468 "Usage: debug lludp throttles get [<avatar-first-name> <avatar-last-name>]");
467 return; 469 return;
468 } 470 }
469 471
470 string firstName = null; 472 string firstName = null;
471 string lastName = null; 473 string lastName = null;
@@ -489,7 +491,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
489 ConsoleDisplayList cdl = new ConsoleDisplayList(); 491 ConsoleDisplayList cdl = new ConsoleDisplayList();
490 cdl.AddRow("adaptive", udpClient.FlowThrottle.AdaptiveEnabled); 492 cdl.AddRow("adaptive", udpClient.FlowThrottle.AdaptiveEnabled);
491 cdl.AddRow("current", string.Format("{0} kbps", udpClient.FlowThrottle.DripRate * 8 / 1000)); 493 cdl.AddRow("current", string.Format("{0} kbps", udpClient.FlowThrottle.DripRate * 8 / 1000));
492 cdl.AddRow("request", string.Format("{0} kbps", udpClient.FlowThrottle.RequestedDripRate * 8 / 1000)); 494 cdl.AddRow("request", string.Format("{0} kbps", udpClient.FlowThrottle.RequestedDripRate * 8 / 1000));
493 cdl.AddRow("max", string.Format("{0} kbps", udpClient.FlowThrottle.MaxDripRate * 8 / 1000)); 495 cdl.AddRow("max", string.Format("{0} kbps", udpClient.FlowThrottle.MaxDripRate * 8 / 1000));
494 496
495 m_console.Output(cdl.ToString()); 497 m_console.Output(cdl.ToString());
@@ -505,14 +507,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
505 m_console.OutputFormat("Debug settings for {0}", m_udpServer.Scene.Name); 507 m_console.OutputFormat("Debug settings for {0}", m_udpServer.Scene.Name);
506 ConsoleDisplayList cdl = new ConsoleDisplayList(); 508 ConsoleDisplayList cdl = new ConsoleDisplayList();
507 509
508 long maxSceneDripRate = m_udpServer.Throttle.MaxDripRate; 510 long maxSceneDripRate = (long)m_udpServer.Throttle.MaxDripRate;
509 cdl.AddRow( 511 cdl.AddRow(
510 "max-scene-throttle", 512 "max-scene-throttle",
511 maxSceneDripRate != 0 ? string.Format("{0} kbps", maxSceneDripRate * 8 / 1000) : "unset"); 513 maxSceneDripRate != 0 ? string.Format("{0} kbps", maxSceneDripRate * 8 / 1000) : "unset");
512 514
513 int maxClientDripRate = m_udpServer.ThrottleRates.Total; 515 int maxClientDripRate = m_udpServer.ThrottleRates.Total;
514 cdl.AddRow( 516 cdl.AddRow(
515 "max-new-client-throttle", 517 "max-new-client-throttle",
516 maxClientDripRate != 0 ? string.Format("{0} kbps", maxClientDripRate * 8 / 1000) : "unset"); 518 maxClientDripRate != 0 ? string.Format("{0} kbps", maxClientDripRate * 8 / 1000) : "unset");
517 519
518 m_console.Output(cdl.ToString()); 520 m_console.Output(cdl.ToString());
@@ -527,7 +529,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
527 { 529 {
528 MainConsole.Instance.OutputFormat("Usage: debug lludp set <param> <value>"); 530 MainConsole.Instance.OutputFormat("Usage: debug lludp set <param> <value>");
529 return; 531 return;
530 } 532 }
531 533
532 string param = args[3]; 534 string param = args[3];
533 string rawValue = args[4]; 535 string rawValue = args[4];
@@ -550,12 +552,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
550 } 552 }
551 else 553 else
552 { 554 {
553 return; 555 return;
554 } 556 }
555 557
556 m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name); 558 m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name);
557 } 559 }
558 560
561/* not in use, nothing to set/get from lludp
559 private void HandleClientGetCommand(string module, string[] args) 562 private void HandleClientGetCommand(string module, string[] args)
560 { 563 {
561 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene) 564 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
@@ -582,11 +585,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
582 m_console.OutputFormat( 585 m_console.OutputFormat(
583 "Client debug parameters for {0} ({1}) in {2}", 586 "Client debug parameters for {0} ({1}) in {2}",
584 sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name); 587 sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
585
586 ConsoleDisplayList cdl = new ConsoleDisplayList();
587 cdl.AddRow("process-unacked-sends", udpClient.ProcessUnackedSends);
588
589 m_console.Output(cdl.ToString());
590 } 588 }
591 }); 589 });
592 } 590 }
@@ -600,7 +598,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
600 { 598 {
601 MainConsole.Instance.OutputFormat("Usage: debug lludp client set <param> <value> [<avatar-first-name> <avatar-last-name>]"); 599 MainConsole.Instance.OutputFormat("Usage: debug lludp client set <param> <value> [<avatar-first-name> <avatar-last-name>]");
602 return; 600 return;
603 } 601 }
604 602
605 string param = args[4]; 603 string param = args[4];
606 string rawValue = args[5]; 604 string rawValue = args[5];
@@ -609,28 +607,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
609 607
610 if (args.Length == 8) 608 if (args.Length == 8)
611 name = string.Format("{0} {1}", args[6], args[7]); 609 name = string.Format("{0} {1}", args[6], args[7]);
612 610 // nothing here now
613 if (param == "process-unacked-sends")
614 {
615 bool newValue;
616
617 if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newValue))
618 return;
619
620 m_udpServer.Scene.ForEachScenePresence(
621 sp =>
622 {
623 if ((name == null || sp.Name == name) && sp.ControllingClient is LLClientView)
624 {
625 LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
626 udpClient.ProcessUnackedSends = newValue;
627
628 m_console.OutputFormat("{0} set to {1} for {2} in {3}", param, newValue, sp.Name, m_udpServer.Scene.Name);
629 }
630 });
631 }
632 } 611 }
633 612*/
634 private void HandlePacketCommand(string module, string[] args) 613 private void HandlePacketCommand(string module, string[] args)
635 { 614 {
636 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene) 615 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
@@ -718,12 +697,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
718 697
719 string direction = args[3]; 698 string direction = args[3];
720 string subCommand = args[4]; 699 string subCommand = args[4];
721 string packetName = args[5]; 700 string packetName = args[5];
722 701
723 if (subCommand == "add") 702 if (subCommand == "add")
724 { 703 {
725 MainConsole.Instance.OutputFormat( 704 MainConsole.Instance.OutputFormat(
726 "Adding packet {0} to {1} drop list for all connections in {2}", 705 "Adding packet {0} to {1} drop list for all connections in {2}",
727 direction, packetName, m_udpServer.Scene.Name); 706 direction, packetName, m_udpServer.Scene.Name);
728 707
729 m_udpServer.Scene.ForEachScenePresence( 708 m_udpServer.Scene.ForEachScenePresence(
@@ -741,7 +720,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
741 else if (subCommand == "remove") 720 else if (subCommand == "remove")
742 { 721 {
743 MainConsole.Instance.OutputFormat( 722 MainConsole.Instance.OutputFormat(
744 "Removing packet {0} from {1} drop list for all connections in {2}", 723 "Removing packet {0} from {1} drop list for all connections in {2}",
745 direction, packetName, m_udpServer.Scene.Name); 724 direction, packetName, m_udpServer.Scene.Name);
746 725
747 m_udpServer.Scene.ForEachScenePresence( 726 m_udpServer.Scene.ForEachScenePresence(
@@ -889,10 +868,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
889 MainConsole.Instance.OutputFormat("OQRE in {0}", m_udpServer.Scene.Name); 868 MainConsole.Instance.OutputFormat("OQRE in {0}", m_udpServer.Scene.Name);
890 MainConsole.Instance.OutputFormat("Running: {0}", m_udpServer.OqrEngine.IsRunning); 869 MainConsole.Instance.OutputFormat("Running: {0}", m_udpServer.OqrEngine.IsRunning);
891 MainConsole.Instance.OutputFormat( 870 MainConsole.Instance.OutputFormat(
892 "Requests waiting: {0}", 871 "Requests waiting: {0}",
893 m_udpServer.OqrEngine.IsRunning ? m_udpServer.OqrEngine.JobsWaiting.ToString() : "n/a"); 872 m_udpServer.OqrEngine.IsRunning ? m_udpServer.OqrEngine.JobsWaiting.ToString() : "n/a");
894 } 873 }
895 else 874 else
896 { 875 {
897 MainConsole.Instance.OutputFormat("Unrecognized OQRE subcommand {0}", subCommand); 876 MainConsole.Instance.OutputFormat("Unrecognized OQRE subcommand {0}", subCommand);
898 } 877 }