Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Prims/PrimCountCommand.cs
John Hurliman 349830c983 * Object tracker dictionaries are now internal and only accessible through various methods and properties to prevent locking disasters. Basis of this code written by jradford in issue 342
* Added a Client.Self.Name property for the full name of the avatar which does smart caching
* Adds BackupCommand to TestClient (submitted by CheechBode in issue 314), backs up notecards and scripts from your inventory to hard drive. Needs more refining but it works
* Parsing problems in TestClient no longer crash the app

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1378 52acb1d6-8a22-11de-b505-999d5b087335
2007-08-29 08:55:53 +00:00

40 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.TestClient
{
public class PrimCountCommand: Command
{
public PrimCountCommand(TestClient testClient)
{
Name = "primcount";
Description = "Shows the number of objects currently being tracked.";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
int count = 0;
lock (Client.Network.Simulators)
{
for (int i = 0; i < Client.Network.Simulators.Count; i++)
{
int avcount = Client.Network.Simulators[i].Objects.AvatarCount;
int primcount = Client.Network.Simulators[i].Objects.PrimCount;
Console.WriteLine("{0} (Avatars: {1} Primitives: {2})",
Client.Network.Simulators[i].Name, avcount, primcount);
count += avcount;
count += primcount;
}
}
return "Tracking a total of " + count + " objects";
}
}
}