Adding special handling for help and script commands to TestClient, you can now run them without any logged in bots

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2286 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2008-10-09 17:42:18 +00:00
parent af97cb2d48
commit 96f66d4b13
2 changed files with 25 additions and 6 deletions

View File

@@ -137,6 +137,9 @@ namespace OpenMetaverse.TestClient
return;
string firstToken = tokens[0].ToLower();
string[] args = new string[tokens.Length - 1];
Array.Copy(tokens, 1, args, 0, args.Length);
// "all balance" will send the balance command to all currently logged in bots
if (firstToken == "all" && tokens.Length > 1)
@@ -153,8 +156,6 @@ namespace OpenMetaverse.TestClient
{
// Special login case: Only call it once, and allow it with
// no logged in avatars
string[] args = new string[tokens.Length - 1];
Array.Copy(tokens, 1, args, 0, args.Length);
ClientManager.Login(args);
}
else if (firstToken == "quit")
@@ -162,10 +163,13 @@ namespace OpenMetaverse.TestClient
ClientManager.Quit();
Logger.Log("All clients logged out and program finished running.", Helpers.LogLevel.Info);
}
else if (firstToken == "script")
{
// Execute only once
Commands[firstToken].Execute(args, fromAgentID);
}
else if (Commands.ContainsKey(firstToken))
{
string[] args = new string[tokens.Length - 1];
Array.Copy(tokens, 1, args, 0, args.Length);
string response = Commands[firstToken].Execute(args, fromAgentID);
if (!String.IsNullOrEmpty(response))