aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/mass test client/Commands/Prims/PrimCountCommand.cs
blob: 5d07e8b056793dc6ac4dc64cad1a0925e45776c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 prims that have been received.";
		}

        public override string Execute(string[] args, LLUUID fromAgentID)
		{
            int count = 0;

            lock (Client.SimPrims)
            {
                foreach (Dictionary<uint, Primitive> prims in Client.SimPrims.Values)
                {
                    count += prims.Count;
                }
            }

			return count.ToString();
		}
    }
}