Added a special WaitForLoginCommand (waitforlogin) to TestClient that allows the command line or a script to wait until all current logins have completed before continuing. Automated scripting of TestClient will need to use this command

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2716 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2009-05-08 19:19:53 +00:00
parent 9801078b08
commit 9a3bbecc54
2 changed files with 46 additions and 6 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
namespace OpenMetaverse.TestClient
{
public class WaitForLoginCommand : Command
{
public WaitForLoginCommand(TestClient testClient)
{
Name = "waitforlogin";
Description = "Waits until all bots that are currently attempting to login have succeeded or failed";
Category = CommandCategory.TestClient;
}
public override string Execute(string[] args, UUID fromAgentID)
{
while (ClientManager.Instance.PendingLogins > 0)
{
System.Threading.Thread.Sleep(1000);
Logger.Log("Pending logins: " + ClientManager.Instance.PendingLogins, Helpers.LogLevel.Info);
}
return "All pending logins have completed, currently tracking " + ClientManager.Instance.Clients.Count + " bots";
}
}
}