diff --git a/Programs/examples/TestClient/ClientManager.cs b/Programs/examples/TestClient/ClientManager.cs index f591c701..941739ee 100644 --- a/Programs/examples/TestClient/ClientManager.cs +++ b/Programs/examples/TestClient/ClientManager.cs @@ -44,7 +44,7 @@ namespace OpenMetaverse.TestClient public class ClientManager { - public Dictionary Clients = new Dictionary(); + public Dictionary Clients = new Dictionary(); public Dictionary> SimPrims = new Dictionary>(); public bool Running = true; @@ -205,9 +205,6 @@ namespace OpenMetaverse.TestClient if (firstToken == "login") { - // Special login case: Only call it once, and allow it with - // no logged in avatars - Login(args); } else if (firstToken == "quit") @@ -217,10 +214,18 @@ namespace OpenMetaverse.TestClient } else if (firstToken == "help") { - // No reason to pass this to all bots, and we also want to allow it when there are no bots - HelpCommand command = new HelpCommand(null); - command.Client = new TestClient(this); - Console.WriteLine(command.Execute(args, UUID.Zero)); + if (Clients.Count > 0) + { + foreach (TestClient client in Clients.Values) + { + Console.WriteLine(client.Commands["help"].Execute(args, UUID.Zero)); + break; + } + } + else + { + Console.WriteLine("You must login at least one bot to use the help command"); + } } else if (firstToken == "script") { @@ -231,7 +236,7 @@ namespace OpenMetaverse.TestClient else { // Make an immutable copy of the Clients dictionary to safely iterate over - Dictionary clientsCopy = new Dictionary(Clients); + Dictionary clientsCopy = new Dictionary(Clients); int completed = 0; @@ -262,7 +267,7 @@ namespace OpenMetaverse.TestClient public void LogoutAll() { // make a copy of the clients list so that it can be iterated without fear of being changed during iteration - Dictionary clientsCopy = new Dictionary(Clients); + Dictionary clientsCopy = new Dictionary(Clients); foreach (TestClient client in clientsCopy.Values) Logout(client); diff --git a/Programs/examples/TestClient/Program.cs b/Programs/examples/TestClient/Program.cs index 886d35fc..8c1f2ac0 100644 --- a/Programs/examples/TestClient/Program.cs +++ b/Programs/examples/TestClient/Program.cs @@ -154,7 +154,6 @@ namespace OpenMetaverse.TestClient string[] scriptargs = new string[1]; scriptargs[0] = scriptFile; ScriptCommand command = new ScriptCommand(null); - command.Client = new TestClient(manager); Logger.Log(command.Execute(scriptargs, UUID.Zero), Helpers.LogLevel.Info); }