aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ExportBot/Commands/WhoCommand.cs
blob: 83d8610ce55ea05e29e533a18954a116f094f1ae (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
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;

namespace libsecondlife.TestClient
{
    public class WhoCommand: Command
    {
        public WhoCommand(TestClient testClient)
		{
			Name = "who";
			Description = "Lists seen avatars.";
		}

        public override string Execute(string[] args, LLUUID fromAgentID)
		{
			StringBuilder result = new StringBuilder();
			foreach (Avatar av in Client.AvatarList.Values)
			{
				result.AppendFormat("\n{0} {1} {2}/{3} ID: {4}", av.Name, av.GroupName, 
                    (av.CurrentSim != null ? av.CurrentSim.Name : String.Empty), av.Position, av.ID);
			}

            return result.ToString();
		}
    }
}