2007-04-28 20:54:02 +00:00
|
|
|
using System;
|
2008-07-21 21:12:59 +00:00
|
|
|
using OpenMetaverse;
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2008-07-21 21:12:59 +00:00
|
|
|
namespace OpenMetaverse.TestClient
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
public class PrimCountCommand: Command
|
|
|
|
|
{
|
|
|
|
|
public PrimCountCommand(TestClient testClient)
|
|
|
|
|
{
|
|
|
|
|
Name = "primcount";
|
2007-08-20 09:26:21 +00:00
|
|
|
Description = "Shows the number of objects currently being tracked.";
|
2008-07-25 08:55:36 +00:00
|
|
|
Category = CommandCategory.TestClient;
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
int count = 0;
|
|
|
|
|
|
2007-08-20 09:26:21 +00:00
|
|
|
lock (Client.Network.Simulators)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
2007-08-20 09:26:21 +00:00
|
|
|
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
2008-01-03 21:55:49 +00:00
|
|
|
int avcount = Client.Network.Simulators[i].ObjectsAvatars.Count;
|
|
|
|
|
int primcount = Client.Network.Simulators[i].ObjectsPrimitives.Count;
|
2007-08-29 08:55:53 +00:00
|
|
|
|
2007-08-20 09:26:21 +00:00
|
|
|
Console.WriteLine("{0} (Avatars: {1} Primitives: {2})",
|
2007-08-29 08:55:53 +00:00
|
|
|
Client.Network.Simulators[i].Name, avcount, primcount);
|
2007-08-20 09:26:21 +00:00
|
|
|
|
2007-08-29 08:55:53 +00:00
|
|
|
count += avcount;
|
|
|
|
|
count += primcount;
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-20 09:26:21 +00:00
|
|
|
return "Tracking a total of " + count + " objects";
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|