aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/BotManager.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-09-24 23:03:39 +0100
committerJustin Clark-Casey (justincc)2014-09-24 23:44:48 +0100
commit6ac12a42ec81dbd7538c61554e410893000e5fb3 (patch)
tree127a87105db293bfd1aece0dfac6edf5ceff89e6 /OpenSim/Tools/pCampBot/BotManager.cs
parentRemove an unnecessary check at the bottom of Scene.CloseAgent() (diff)
downloadopensim-SC_OLD-6ac12a42ec81dbd7538c61554e410893000e5fb3.zip
opensim-SC_OLD-6ac12a42ec81dbd7538c61554e410893000e5fb3.tar.gz
opensim-SC_OLD-6ac12a42ec81dbd7538c61554e410893000e5fb3.tar.bz2
opensim-SC_OLD-6ac12a42ec81dbd7538c61554e410893000e5fb3.tar.xz
Add "debug lludp packet" command to pCampbot.
This allows one to log the packets received by a particular bot that are not duplicates of already received packets. Similar to the OpenSimulator command at the same name but currently any positive level logs all received packets. No facility yet for logging outgoing packets. For debug purposes.
Diffstat (limited to '')
-rw-r--r--OpenSim/Tools/pCampBot/BotManager.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index c7d8f05..46094d6 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -254,6 +254,16 @@ namespace pCampBot
254 "Shows the detailed status and settings of a particular bot.", HandleShowBotStatus); 254 "Shows the detailed status and settings of a particular bot.", HandleShowBotStatus);
255 255
256 m_console.Commands.AddCommand( 256 m_console.Commands.AddCommand(
257 "Debug",
258 false,
259 "debug lludp packet",
260 "debug lludp packet <level> <avatar-first-name> <avatar-last-name>",
261 "Turn on received packet logging.",
262 "If level > 0 then all received packets that are not duplicates are logged.\n"
263 + "If level <= 0 then no received packets are logged.",
264 HandleDebugLludpPacketCommand);
265
266 m_console.Commands.AddCommand(
257 "Bots", false, "show status", "show status", "Shows pCampbot status.", HandleShowStatus); 267 "Bots", false, "show status", "show status", "Shows pCampbot status.", HandleShowStatus);
258 268
259 m_bots = new List<Bot>(); 269 m_bots = new List<Bot>();
@@ -784,6 +794,38 @@ namespace pCampBot
784 } 794 }
785 } 795 }
786 796
797 private void HandleDebugLludpPacketCommand(string module, string[] args)
798 {
799 if (args.Length != 6)
800 {
801 MainConsole.Instance.OutputFormat("Usage: debug lludp packet <level> <bot-first-name> <bot-last-name>");
802 return;
803 }
804
805 int level;
806
807 if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[3], out level))
808 return;
809
810 string botFirstName = args[4];
811 string botLastName = args[5];
812
813 Bot bot;
814
815 lock (m_bots)
816 bot = m_bots.FirstOrDefault(b => b.FirstName == botFirstName && b.LastName == botLastName);
817
818 if (bot == null)
819 {
820 MainConsole.Instance.OutputFormat("No bot named {0} {1}", botFirstName, botLastName);
821 return;
822 }
823
824 bot.PacketDebugLevel = level;
825
826 MainConsole.Instance.OutputFormat("Set debug level of {0} to {1}", bot.Name, bot.PacketDebugLevel);
827 }
828
787 private void HandleShowRegions(string module, string[] cmd) 829 private void HandleShowRegions(string module, string[] cmd)
788 { 830 {
789 string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}"; 831 string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}";