* Added per-sim avatar and prim tracking through Simulator.Objects, use Settings.ALWAYS_DECODE_OBJECTS = true to enable * Handle DisconnectSim packet and don't send CloseCircuit packets on sim-triggered disconnects * Interpolation timer now does angular velocity and linear movement interpolation for all objects in the object tracker(s) git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1363 52acb1d6-8a22-11de-b505-999d5b087335
39 lines
1.1 KiB
C#
39 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++)
|
|
{
|
|
Console.WriteLine("{0} (Avatars: {1} Primitives: {2})",
|
|
Client.Network.Simulators[i].Name,
|
|
Client.Network.Simulators[i].Objects.Avatars.Count,
|
|
Client.Network.Simulators[i].Objects.Prims.Count);
|
|
|
|
count += Client.Network.Simulators[i].Objects.Avatars.Count;
|
|
count += Client.Network.Simulators[i].Objects.Prims.Count;
|
|
}
|
|
}
|
|
|
|
return "Tracking a total of " + count + " objects";
|
|
}
|
|
}
|
|
}
|