aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorOren Hurvitz2014-06-27 12:03:51 +0300
committerJustin Clark-Casey2014-08-02 00:56:16 +0100
commitaf344aa532785911d7f21e0232a284f912c1ebf1 (patch)
treeca9fa1bf17ee7df6ce8478d5da5daaec358677aa
parentFixed the logic that decides if a packet was queued (it was reversed) (diff)
downloadopensim-SC_OLD-af344aa532785911d7f21e0232a284f912c1ebf1.zip
opensim-SC_OLD-af344aa532785911d7f21e0232a284f912c1ebf1.tar.gz
opensim-SC_OLD-af344aa532785911d7f21e0232a284f912c1ebf1.tar.bz2
opensim-SC_OLD-af344aa532785911d7f21e0232a284f912c1ebf1.tar.xz
Added "debug packet --all" option, which changes the packet logging level for both current and future clients
The existing "--default" option only changes the logging level for future clients.
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs34
1 files changed, 26 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 2577a77..f52401a 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -674,7 +674,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
674 674
675 MainConsole.Instance.Commands.AddCommand( 675 MainConsole.Instance.Commands.AddCommand(
676 "Debug", false, "debug lludp packet", 676 "Debug", false, "debug lludp packet",
677 "debug lludp packet [--default] <level> [<avatar-first-name> <avatar-last-name>]", 677 "debug lludp packet [--default | --all] <level> [<avatar-first-name> <avatar-last-name>]",
678 "Turn on packet debugging", 678 "Turn on packet debugging",
679 "If level > 255 then all incoming and outgoing packets are logged.\n" 679 "If level > 255 then all incoming and outgoing packets are logged.\n"
680 + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n" 680 + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
@@ -683,7 +683,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
683 + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n" 683 + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n"
684 + "If level <= 0 then no packets are logged.\n" 684 + "If level <= 0 then no packets are logged.\n"
685 + "If --default is specified then the level becomes the default logging level for all subsequent agents.\n" 685 + "If --default is specified then the level becomes the default logging level for all subsequent agents.\n"
686 + "In this case, you cannot also specify an avatar name.\n" 686 + "If --all is specified then the level becomes the default logging level for all current and subsequent agents.\n"
687 + "In these cases, you cannot also specify an avatar name.\n"
687 + "If an avatar name is given then only packets from that avatar are logged.", 688 + "If an avatar name is given then only packets from that avatar are logged.",
688 HandlePacketCommand); 689 HandlePacketCommand);
689 690
@@ -742,20 +743,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
742 return; 743 return;
743 744
744 bool setAsDefaultLevel = false; 745 bool setAsDefaultLevel = false;
745 OptionSet optionSet = new OptionSet().Add("default", o => setAsDefaultLevel = o != null); 746 bool setAll = false;
747 OptionSet optionSet = new OptionSet()
748 .Add("default", o => setAsDefaultLevel = (o != null))
749 .Add("all", o => setAll = (o != null));
746 List<string> filteredArgs = optionSet.Parse(args); 750 List<string> filteredArgs = optionSet.Parse(args);
747 751
748 string name = null; 752 string name = null;
749 753
750 if (filteredArgs.Count == 6) 754 if (filteredArgs.Count == 6)
751 { 755 {
752 if (!setAsDefaultLevel) 756 if (!(setAsDefaultLevel || setAll))
753 { 757 {
754 name = string.Format("{0} {1}", filteredArgs[4], filteredArgs[5]); 758 name = string.Format("{0} {1}", filteredArgs[4], filteredArgs[5]);
755 } 759 }
756 else 760 else
757 { 761 {
758 MainConsole.Instance.OutputFormat("ERROR: Cannot specify a user name when setting default logging level"); 762 MainConsole.Instance.OutputFormat("ERROR: Cannot specify a user name when setting default/all logging level");
759 return; 763 return;
760 } 764 }
761 } 765 }
@@ -765,11 +769,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
765 int newDebug; 769 int newDebug;
766 if (int.TryParse(filteredArgs[3], out newDebug)) 770 if (int.TryParse(filteredArgs[3], out newDebug))
767 { 771 {
768 if (setAsDefaultLevel) 772 if (setAsDefaultLevel || setAll)
769 { 773 {
770 DefaultClientPacketDebugLevel = newDebug; 774 DefaultClientPacketDebugLevel = newDebug;
775
771 MainConsole.Instance.OutputFormat( 776 MainConsole.Instance.OutputFormat(
772 "Debug packet debug for new clients set to {0} in {1}", DefaultClientPacketDebugLevel, m_scene.Name); 777 "Packet debug for {0} clients set to {1} in {2}",
778 (setAll ? "all" : "future"), DefaultClientPacketDebugLevel, m_scene.Name);
779
780 if (setAll)
781 {
782 m_scene.ForEachScenePresence(sp =>
783 {
784 MainConsole.Instance.OutputFormat(
785 "Packet debug for {0} ({1}) set to {2} in {3}",
786 sp.Name, sp.IsChildAgent ? "child" : "root", newDebug, m_scene.Name);
787
788 sp.ControllingClient.DebugPacketLevel = newDebug;
789 });
790 }
773 } 791 }
774 else 792 else
775 { 793 {
@@ -788,7 +806,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
788 } 806 }
789 else 807 else
790 { 808 {
791 MainConsole.Instance.Output("Usage: debug lludp packet [--default] 0..255 [<first-name> <last-name>]"); 809 MainConsole.Instance.Output("Usage: debug lludp packet [--default | --all] 0..255 [<first-name> <last-name>]");
792 } 810 }
793 } 811 }
794 } 812 }