diff options
author | Melanie | 2019-08-20 23:28:59 +0100 |
---|---|---|
committer | Melanie | 2019-08-20 23:28:59 +0100 |
commit | 0fd17c08ae642fac17b24dfad06c61cfe5739483 (patch) | |
tree | 4871c96eab2f5b118cb09d670a3a4ba024cf1210 /OpenSim/Tools | |
parent | change PGSQL migration (diff) | |
download | opensim-SC-0fd17c08ae642fac17b24dfad06c61cfe5739483.zip opensim-SC-0fd17c08ae642fac17b24dfad06c61cfe5739483.tar.gz opensim-SC-0fd17c08ae642fac17b24dfad06c61cfe5739483.tar.bz2 opensim-SC-0fd17c08ae642fac17b24dfad06c61cfe5739483.tar.xz |
Massive console refactor. Greatly simplify interface.
Diffstat (limited to 'OpenSim/Tools')
-rwxr-xr-x[-rw-r--r--] | OpenSim/Tools/pCampBot/BotManager.cs | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 60e6ce3..2b6fbce 100644..100755 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -352,7 +352,7 @@ namespace pCampBot | |||
352 | } | 352 | } |
353 | else | 353 | else |
354 | { | 354 | { |
355 | MainConsole.Instance.OutputFormat("No behaviour with abbreviated name {0} found", abName); | 355 | MainConsole.Instance.Output("No behaviour with abbreviated name {0} found", null, abName); |
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
@@ -365,8 +365,8 @@ namespace pCampBot | |||
365 | { | 365 | { |
366 | if (BotConnectingState != BotManagerBotConnectingState.Ready) | 366 | if (BotConnectingState != BotManagerBotConnectingState.Ready) |
367 | { | 367 | { |
368 | MainConsole.Instance.OutputFormat( | 368 | MainConsole.Instance.Output( |
369 | "Bot connecting status is {0}. Please wait for previous process to complete.", BotConnectingState); | 369 | "Bot connecting status is {0}. Please wait for previous process to complete.", null, BotConnectingState); |
370 | return; | 370 | return; |
371 | } | 371 | } |
372 | 372 | ||
@@ -486,8 +486,9 @@ namespace pCampBot | |||
486 | BotManager bm, List<IBehaviour> behaviours, | 486 | BotManager bm, List<IBehaviour> behaviours, |
487 | string firstName, string lastName, string password, string loginUri, string startLocation, string wearSetting) | 487 | string firstName, string lastName, string password, string loginUri, string startLocation, string wearSetting) |
488 | { | 488 | { |
489 | MainConsole.Instance.OutputFormat( | 489 | MainConsole.Instance.Output( |
490 | "[BOT MANAGER]: Creating bot {0} {1}, behaviours are {2}", | 490 | "[BOT MANAGER]: Creating bot {0} {1}, behaviours are {2}", |
491 | null, | ||
491 | firstName, lastName, string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray())); | 492 | firstName, lastName, string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray())); |
492 | 493 | ||
493 | Bot pb = new Bot(bm, behaviours, firstName, lastName, password, startLocation, loginUri); | 494 | Bot pb = new Bot(bm, behaviours, firstName, lastName, password, startLocation, loginUri); |
@@ -552,7 +553,7 @@ namespace pCampBot | |||
552 | botsToConnect = Math.Min(botsToConnect, disconnectedBots); | 553 | botsToConnect = Math.Min(botsToConnect, disconnectedBots); |
553 | } | 554 | } |
554 | 555 | ||
555 | MainConsole.Instance.OutputFormat("Connecting {0} bots", botsToConnect); | 556 | MainConsole.Instance.Output("Connecting {0} bots", null, botsToConnect); |
556 | 557 | ||
557 | ConnectBots(botsToConnect); | 558 | ConnectBots(botsToConnect); |
558 | } | 559 | } |
@@ -562,7 +563,7 @@ namespace pCampBot | |||
562 | { | 563 | { |
563 | if (cmd.Length < 3 || cmd.Length > 4) | 564 | if (cmd.Length < 3 || cmd.Length > 4) |
564 | { | 565 | { |
565 | MainConsole.Instance.OutputFormat("Usage: add behaviour <abbreviated-behaviour> [<bot-number>]"); | 566 | MainConsole.Instance.Output("Usage: add behaviour <abbreviated-behaviour> [<bot-number>]"); |
566 | return; | 567 | return; |
567 | } | 568 | } |
568 | 569 | ||
@@ -585,7 +586,7 @@ namespace pCampBot | |||
585 | 586 | ||
586 | if (bot == null) | 587 | if (bot == null) |
587 | { | 588 | { |
588 | MainConsole.Instance.OutputFormat("Error: No bot found with number {0}", botNumber); | 589 | MainConsole.Instance.Output("Error: No bot found with number {0}", null, botNumber); |
589 | return; | 590 | return; |
590 | } | 591 | } |
591 | 592 | ||
@@ -606,8 +607,9 @@ namespace pCampBot | |||
606 | behavioursAdded.Add(behaviour); | 607 | behavioursAdded.Add(behaviour); |
607 | } | 608 | } |
608 | 609 | ||
609 | MainConsole.Instance.OutputFormat( | 610 | MainConsole.Instance.Output( |
610 | "Added behaviours {0} to bot {1}", | 611 | "Added behaviours {0} to bot {1}", |
612 | null, | ||
611 | string.Join(", ", behavioursAdded.ConvertAll<string>(b => b.Name).ToArray()), bot.Name); | 613 | string.Join(", ", behavioursAdded.ConvertAll<string>(b => b.Name).ToArray()), bot.Name); |
612 | } | 614 | } |
613 | } | 615 | } |
@@ -616,7 +618,7 @@ namespace pCampBot | |||
616 | { | 618 | { |
617 | if (cmd.Length < 3 || cmd.Length > 4) | 619 | if (cmd.Length < 3 || cmd.Length > 4) |
618 | { | 620 | { |
619 | MainConsole.Instance.OutputFormat("Usage: remove behaviour <abbreviated-behaviour> [<bot-number>]"); | 621 | MainConsole.Instance.Output("Usage: remove behaviour <abbreviated-behaviour> [<bot-number>]"); |
620 | return; | 622 | return; |
621 | } | 623 | } |
622 | 624 | ||
@@ -639,7 +641,7 @@ namespace pCampBot | |||
639 | 641 | ||
640 | if (bot == null) | 642 | if (bot == null) |
641 | { | 643 | { |
642 | MainConsole.Instance.OutputFormat("Error: No bot found with number {0}", botNumber); | 644 | MainConsole.Instance.Output("Error: No bot found with number {0}", null, botNumber); |
643 | return; | 645 | return; |
644 | } | 646 | } |
645 | 647 | ||
@@ -664,8 +666,9 @@ namespace pCampBot | |||
664 | } | 666 | } |
665 | } | 667 | } |
666 | 668 | ||
667 | MainConsole.Instance.OutputFormat( | 669 | MainConsole.Instance.Output( |
668 | "Removed behaviours {0} from bot {1}", | 670 | "Removed behaviours {0} from bot {1}", |
671 | null, | ||
669 | string.Join(", ", behavioursRemoved.ConvertAll<string>(b => b.Name).ToArray()), bot.Name); | 672 | string.Join(", ", behavioursRemoved.ConvertAll<string>(b => b.Name).ToArray()), bot.Name); |
670 | } | 673 | } |
671 | } | 674 | } |
@@ -701,7 +704,7 @@ namespace pCampBot | |||
701 | 704 | ||
702 | private void DisconnectBotsInternal(List<Bot> connectedBots, int disconnectCount) | 705 | private void DisconnectBotsInternal(List<Bot> connectedBots, int disconnectCount) |
703 | { | 706 | { |
704 | MainConsole.Instance.OutputFormat("Disconnecting {0} bots", disconnectCount); | 707 | MainConsole.Instance.Output("Disconnecting {0} bots", null, disconnectCount); |
705 | 708 | ||
706 | int disconnectedBots = 0; | 709 | int disconnectedBots = 0; |
707 | 710 | ||
@@ -731,7 +734,7 @@ namespace pCampBot | |||
731 | { | 734 | { |
732 | if (bot.ConnectionState == ConnectionState.Connected) | 735 | if (bot.ConnectionState == ConnectionState.Connected) |
733 | { | 736 | { |
734 | MainConsole.Instance.OutputFormat("Sitting bot {0} on ground.", bot.Name); | 737 | MainConsole.Instance.Output("Sitting bot {0} on ground.", null, bot.Name); |
735 | bot.SitOnGround(); | 738 | bot.SitOnGround(); |
736 | } | 739 | } |
737 | } | 740 | } |
@@ -746,7 +749,7 @@ namespace pCampBot | |||
746 | { | 749 | { |
747 | if (bot.ConnectionState == ConnectionState.Connected) | 750 | if (bot.ConnectionState == ConnectionState.Connected) |
748 | { | 751 | { |
749 | MainConsole.Instance.OutputFormat("Standing bot {0} from ground.", bot.Name); | 752 | MainConsole.Instance.Output("Standing bot {0} from ground.", null, bot.Name); |
750 | bot.Stand(); | 753 | bot.Stand(); |
751 | } | 754 | } |
752 | } | 755 | } |
@@ -761,7 +764,7 @@ namespace pCampBot | |||
761 | 764 | ||
762 | if (connectedBots > 0) | 765 | if (connectedBots > 0) |
763 | { | 766 | { |
764 | MainConsole.Instance.OutputFormat("Please disconnect {0} connected bots first", connectedBots); | 767 | MainConsole.Instance.Output("Please disconnect {0} connected bots first", null, connectedBots); |
765 | return; | 768 | return; |
766 | } | 769 | } |
767 | } | 770 | } |
@@ -785,8 +788,8 @@ namespace pCampBot | |||
785 | if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newSendAgentUpdatesSetting)) | 788 | if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newSendAgentUpdatesSetting)) |
786 | return; | 789 | return; |
787 | 790 | ||
788 | MainConsole.Instance.OutputFormat( | 791 | MainConsole.Instance.Output("Setting SEND_AGENT_UPDATES to {0} for all bots", |
789 | "Setting SEND_AGENT_UPDATES to {0} for all bots", newSendAgentUpdatesSetting); | 792 | null, newSendAgentUpdatesSetting); |
790 | 793 | ||
791 | lock (m_bots) | 794 | lock (m_bots) |
792 | m_bots.ForEach(b => b.Client.Settings.SEND_AGENT_UPDATES = newSendAgentUpdatesSetting); | 795 | m_bots.ForEach(b => b.Client.Settings.SEND_AGENT_UPDATES = newSendAgentUpdatesSetting); |
@@ -801,7 +804,7 @@ namespace pCampBot | |||
801 | { | 804 | { |
802 | if (args.Length != 6) | 805 | if (args.Length != 6) |
803 | { | 806 | { |
804 | MainConsole.Instance.OutputFormat("Usage: debug lludp packet <level> <bot-first-name> <bot-last-name>"); | 807 | MainConsole.Instance.Output("Usage: debug lludp packet <level> <bot-first-name> <bot-last-name>"); |
805 | return; | 808 | return; |
806 | } | 809 | } |
807 | 810 | ||
@@ -820,26 +823,26 @@ namespace pCampBot | |||
820 | 823 | ||
821 | if (bot == null) | 824 | if (bot == null) |
822 | { | 825 | { |
823 | MainConsole.Instance.OutputFormat("No bot named {0} {1}", botFirstName, botLastName); | 826 | MainConsole.Instance.Output("No bot named {0} {1}", null, botFirstName, botLastName); |
824 | return; | 827 | return; |
825 | } | 828 | } |
826 | 829 | ||
827 | bot.PacketDebugLevel = level; | 830 | bot.PacketDebugLevel = level; |
828 | 831 | ||
829 | MainConsole.Instance.OutputFormat("Set debug level of {0} to {1}", bot.Name, bot.PacketDebugLevel); | 832 | MainConsole.Instance.Output("Set debug level of {0} to {1}", null, bot.Name, bot.PacketDebugLevel); |
830 | } | 833 | } |
831 | 834 | ||
832 | private void HandleShowRegions(string module, string[] cmd) | 835 | private void HandleShowRegions(string module, string[] cmd) |
833 | { | 836 | { |
834 | string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}"; | 837 | string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}"; |
835 | MainConsole.Instance.OutputFormat(outputFormat, "Name", "Handle", "X", "Y"); | 838 | MainConsole.Instance.Output(outputFormat, null, "Name", "Handle", "X", "Y"); |
836 | 839 | ||
837 | lock (RegionsKnown) | 840 | lock (RegionsKnown) |
838 | { | 841 | { |
839 | foreach (GridRegion region in RegionsKnown.Values) | 842 | foreach (GridRegion region in RegionsKnown.Values) |
840 | { | 843 | { |
841 | MainConsole.Instance.OutputFormat( | 844 | MainConsole.Instance.Output( |
842 | outputFormat, region.Name, region.RegionHandle, region.X, region.Y); | 845 | outputFormat, null, region.Name, region.RegionHandle, region.X, region.Y); |
843 | } | 846 | } |
844 | } | 847 | } |
845 | } | 848 | } |
@@ -908,7 +911,7 @@ namespace pCampBot | |||
908 | 911 | ||
909 | if (bot == null) | 912 | if (bot == null) |
910 | { | 913 | { |
911 | MainConsole.Instance.OutputFormat("Error: No bot found with number {0}", botNumber); | 914 | MainConsole.Instance.Output("Error: No bot found with number {0}", null, botNumber); |
912 | return; | 915 | return; |
913 | } | 916 | } |
914 | 917 | ||