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:
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user