diff options
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 8eb2e06..ff31ef5 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -513,6 +513,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
513 | EnablePoolStats(); | 513 | EnablePoolStats(); |
514 | 514 | ||
515 | MainConsole.Instance.Commands.AddCommand( | 515 | MainConsole.Instance.Commands.AddCommand( |
516 | "Debug", false, "debug lludp packet", | ||
517 | "debug lludp packet <level> [<avatar-first-name> <avatar-last-name>]", | ||
518 | "Turn on packet debugging", | ||
519 | "If level > 255 then all incoming and outgoing packets are logged.\n" | ||
520 | + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n" | ||
521 | + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n" | ||
522 | + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n" | ||
523 | + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n" | ||
524 | + "If level <= 0 then no packets are logged.\n" | ||
525 | + "If an avatar name is given then only packets from that avatar are logged", | ||
526 | HandlePacketCommand); | ||
527 | |||
528 | MainConsole.Instance.Commands.AddCommand( | ||
516 | "Debug", | 529 | "Debug", |
517 | false, | 530 | false, |
518 | "debug lludp start", | 531 | "debug lludp start", |
@@ -553,8 +566,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
553 | HandleStatusCommand); | 566 | HandleStatusCommand); |
554 | } | 567 | } |
555 | 568 | ||
569 | private void HandlePacketCommand(string module, string[] args) | ||
570 | { | ||
571 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
572 | return; | ||
573 | |||
574 | string name = null; | ||
575 | |||
576 | if (args.Length == 6) | ||
577 | name = string.Format("{0} {1}", args[4], args[5]); | ||
578 | |||
579 | if (args.Length > 3) | ||
580 | { | ||
581 | int newDebug; | ||
582 | if (int.TryParse(args[3], out newDebug)) | ||
583 | { | ||
584 | m_scene.ForEachScenePresence(sp => | ||
585 | { | ||
586 | if (name == null || sp.Name == name) | ||
587 | { | ||
588 | m_log.DebugFormat( | ||
589 | "Packet debug for {0} ({1}) set to {2} in {3}", | ||
590 | sp.Name, sp.IsChildAgent ? "child" : "root", newDebug, m_scene.Name); | ||
591 | |||
592 | sp.ControllingClient.DebugPacketLevel = newDebug; | ||
593 | } | ||
594 | }); | ||
595 | } | ||
596 | else | ||
597 | { | ||
598 | MainConsole.Instance.Output("Usage: debug lludp packet 0..255 [<first-name> <last-name>]"); | ||
599 | } | ||
600 | } | ||
601 | } | ||
602 | |||
556 | private void HandleStartCommand(string module, string[] args) | 603 | private void HandleStartCommand(string module, string[] args) |
557 | { | 604 | { |
605 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
606 | return; | ||
607 | |||
558 | if (args.Length != 4) | 608 | if (args.Length != 4) |
559 | { | 609 | { |
560 | MainConsole.Instance.Output("Usage: debug lludp start <in|out|all>"); | 610 | MainConsole.Instance.Output("Usage: debug lludp start <in|out|all>"); |
@@ -572,6 +622,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
572 | 622 | ||
573 | private void HandleStopCommand(string module, string[] args) | 623 | private void HandleStopCommand(string module, string[] args) |
574 | { | 624 | { |
625 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
626 | return; | ||
627 | |||
575 | if (args.Length != 4) | 628 | if (args.Length != 4) |
576 | { | 629 | { |
577 | MainConsole.Instance.Output("Usage: debug lludp stop <in|out|all>"); | 630 | MainConsole.Instance.Output("Usage: debug lludp stop <in|out|all>"); |
@@ -589,6 +642,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
589 | 642 | ||
590 | private void HandlePoolCommand(string module, string[] args) | 643 | private void HandlePoolCommand(string module, string[] args) |
591 | { | 644 | { |
645 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
646 | return; | ||
647 | |||
592 | if (args.Length != 4) | 648 | if (args.Length != 4) |
593 | { | 649 | { |
594 | MainConsole.Instance.Output("Usage: debug lludp pool <on|off>"); | 650 | MainConsole.Instance.Output("Usage: debug lludp pool <on|off>"); |
@@ -621,6 +677,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
621 | 677 | ||
622 | private void HandleStatusCommand(string module, string[] args) | 678 | private void HandleStatusCommand(string module, string[] args) |
623 | { | 679 | { |
680 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
681 | return; | ||
682 | |||
624 | MainConsole.Instance.OutputFormat( | 683 | MainConsole.Instance.OutputFormat( |
625 | "IN LLUDP packet processing for {0} is {1}", m_scene.Name, IsRunningInbound ? "enabled" : "disabled"); | 684 | "IN LLUDP packet processing for {0} is {1}", m_scene.Name, IsRunningInbound ? "enabled" : "disabled"); |
626 | 685 | ||