aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/BotManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tools/pCampBot/BotManager.cs')
-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}";