diff options
author | Justin Clark-Casey (justincc) | 2013-07-04 00:02:53 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-07-04 00:02:53 +0100 |
commit | 25889b2d7ef08b27591aa61ab4950bdbc856d7a5 (patch) | |
tree | eacc3e7e0384915c2b9595568f2cf49f42b9f61d /OpenSim/Region | |
parent | Squoosh one last opportunity for Unknown Users to creep in. (diff) | |
download | opensim-SC_OLD-25889b2d7ef08b27591aa61ab4950bdbc856d7a5.zip opensim-SC_OLD-25889b2d7ef08b27591aa61ab4950bdbc856d7a5.tar.gz opensim-SC_OLD-25889b2d7ef08b27591aa61ab4950bdbc856d7a5.tar.bz2 opensim-SC_OLD-25889b2d7ef08b27591aa61ab4950bdbc856d7a5.tar.xz |
change "debug packet" command to "debug lludp packet" to conform with other "debug lludp" options
also moves the implementing code into LLUDPServer.cs along with other debug commands from OpenSim.cs
gets all debug lludp commands to only activate for the set scene if not root
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 59 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneManager.cs | 23 |
3 files changed, 59 insertions, 74 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 9325b12..6ff7f01 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -226,18 +226,6 @@ namespace OpenSim | |||
226 | "Force the update of all objects on clients", | 226 | "Force the update of all objects on clients", |
227 | HandleForceUpdate); | 227 | HandleForceUpdate); |
228 | 228 | ||
229 | m_console.Commands.AddCommand("Debug", false, "debug packet", | ||
230 | "debug packet <level> [<avatar-first-name> <avatar-last-name>]", | ||
231 | "Turn on packet debugging", | ||
232 | "If level > 255 then all incoming and outgoing packets are logged.\n" | ||
233 | + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n" | ||
234 | + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n" | ||
235 | + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n" | ||
236 | + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n" | ||
237 | + "If level <= 0 then no packets are logged.\n" | ||
238 | + "If an avatar name is given then only packets from that avatar are logged", | ||
239 | Debug); | ||
240 | |||
241 | m_console.Commands.AddCommand("General", false, "change region", | 229 | m_console.Commands.AddCommand("General", false, "change region", |
242 | "change region <region name>", | 230 | "change region <region name>", |
243 | "Change current console region", ChangeSelectedRegion); | 231 | "Change current console region", ChangeSelectedRegion); |
@@ -701,45 +689,6 @@ namespace OpenSim | |||
701 | RefreshPrompt(); | 689 | RefreshPrompt(); |
702 | } | 690 | } |
703 | 691 | ||
704 | /// <summary> | ||
705 | /// Turn on some debugging values for OpenSim. | ||
706 | /// </summary> | ||
707 | /// <param name="args"></param> | ||
708 | protected void Debug(string module, string[] args) | ||
709 | { | ||
710 | if (args.Length == 1) | ||
711 | return; | ||
712 | |||
713 | switch (args[1]) | ||
714 | { | ||
715 | case "packet": | ||
716 | string name = null; | ||
717 | if (args.Length == 5) | ||
718 | name = string.Format("{0} {1}", args[3], args[4]); | ||
719 | |||
720 | if (args.Length > 2) | ||
721 | { | ||
722 | int newDebug; | ||
723 | if (int.TryParse(args[2], out newDebug)) | ||
724 | { | ||
725 | SceneManager.SetDebugPacketLevelOnCurrentScene(newDebug, name); | ||
726 | // We provide user information elsewhere if any clients had their debug level set. | ||
727 | // MainConsole.Instance.OutputFormat("Debug packet level set to {0}", newDebug); | ||
728 | } | ||
729 | else | ||
730 | { | ||
731 | MainConsole.Instance.Output("Usage: debug packet 0..255"); | ||
732 | } | ||
733 | } | ||
734 | |||
735 | break; | ||
736 | |||
737 | default: | ||
738 | MainConsole.Instance.Output("Unknown debug command"); | ||
739 | break; | ||
740 | } | ||
741 | } | ||
742 | |||
743 | // see BaseOpenSimServer | 692 | // see BaseOpenSimServer |
744 | /// <summary> | 693 | /// <summary> |
745 | /// Many commands list objects for debugging. Some of the types are listed here | 694 | /// Many commands list objects for debugging. Some of the types are listed here |
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 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 780bd01..28f7896 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs | |||
@@ -477,29 +477,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
477 | return false; | 477 | return false; |
478 | } | 478 | } |
479 | 479 | ||
480 | /// <summary> | ||
481 | /// Set the debug packet level on each current scene. This level governs which packets are printed out to the | ||
482 | /// console. | ||
483 | /// </summary> | ||
484 | /// <param name="newDebug"></param> | ||
485 | /// <param name="name">Name of avatar to debug</param> | ||
486 | public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) | ||
487 | { | ||
488 | ForEachSelectedScene(scene => | ||
489 | scene.ForEachScenePresence(sp => | ||
490 | { | ||
491 | if (name == null || sp.Name == name) | ||
492 | { | ||
493 | m_log.DebugFormat( | ||
494 | "Packet debug for {0} ({1}) set to {2}", | ||
495 | sp.Name, sp.IsChildAgent ? "child" : "root", newDebug); | ||
496 | |||
497 | sp.ControllingClient.DebugPacketLevel = newDebug; | ||
498 | } | ||
499 | }) | ||
500 | ); | ||
501 | } | ||
502 | |||
503 | public List<ScenePresence> GetCurrentSceneAvatars() | 480 | public List<ScenePresence> GetCurrentSceneAvatars() |
504 | { | 481 | { |
505 | List<ScenePresence> avatars = new List<ScenePresence>(); | 482 | List<ScenePresence> avatars = new List<ScenePresence>(); |