Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Friends/FriendsCommand.cs

38 lines
1.1 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Threading;
using libsecondlife;
using libsecondlife.Packets;
using System.Text;
namespace libsecondlife.TestClient
{
public class FriendsCommand : Command
{
ManualResetEvent GetCurrentGroupsEvent = new ManualResetEvent(false);
public FriendsCommand(TestClient testClient)
{
Name = "friends";
Description = "List avatar friends. Usage: friends";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
List<FriendsManager.FriendInfo> friends = Client.Friends.FriendsList();
if (friends.Count > 0)
{
StringBuilder sb = new StringBuilder();
foreach (FriendsManager.FriendInfo friend in friends)
{
sb.AppendLine(friend.Name);
}
return sb.ToString();
}
else
{
return "No friends";
}
}
}
}