2006-11-24 22:15:13 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using libsecondlife;
|
|
|
|
|
using libsecondlife.Packets;
|
|
|
|
|
|
2006-11-24 22:27:15 +00:00
|
|
|
namespace libsecondlife.TestClient
|
2006-11-24 22:15:13 +00:00
|
|
|
{
|
|
|
|
|
public class WhoCommand: Command
|
|
|
|
|
{
|
2006-12-21 08:53:08 +00:00
|
|
|
SecondLife Client;
|
|
|
|
|
|
|
|
|
|
public WhoCommand(TestClient testClient)
|
2006-11-24 22:15:13 +00:00
|
|
|
{
|
2006-12-21 08:53:08 +00:00
|
|
|
TestClient = testClient;
|
|
|
|
|
Client = (SecondLife)TestClient;
|
|
|
|
|
|
2006-11-24 22:15:13 +00:00
|
|
|
Name = "who";
|
|
|
|
|
Description = "Lists seen avatars.";
|
|
|
|
|
}
|
|
|
|
|
|
2006-12-21 08:53:08 +00:00
|
|
|
public override string Execute(string[] args, LLUUID fromAgentID)
|
2006-11-24 22:15:13 +00:00
|
|
|
{
|
|
|
|
|
StringBuilder result = new StringBuilder();
|
2006-12-19 04:16:34 +00:00
|
|
|
foreach (Avatar av in TestClient.AvatarList.Values)
|
2006-11-24 22:15:13 +00:00
|
|
|
{
|
2006-12-19 04:16:34 +00:00
|
|
|
result.AppendFormat("\n{0} {1} {2}/{3} ID: {4}", av.Name, av.GroupName, av.CurrentRegion != null ? av.CurrentRegion.Name : String.Empty, av.Position, av.ID);
|
2006-11-24 22:15:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|