LIBOMV-630: TestClient improvements (patch by Kephra Nurmi)
Improved TestClient: added '@' as a command prefix to target one avatar only and to check, if a named avatar is logged in. Improved TestClient to add new commands: groupmembers GroupnameOrUUID - shows groupmembers UUIDs grouproles GroupnameOrUUID - shows grouproles UUID and Names invitegroup AvatarUUID GroupUUID RoleUUID* - invites an avatar into a group (without querying groupmembers first !-) added public Dictionary<UUID, Group> GroupsCache = null; to TestClient.cs to refactor copy and paste code of group commands. added friend.UUID to output of FriendsCommand.cs swapped output of UUID and name in GroupsCommand.cs git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2989 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenMetaverse.TestClient
|
||||
{
|
||||
public class InviteGroupCommand : Command
|
||||
{
|
||||
public InviteGroupCommand(TestClient testClient)
|
||||
{
|
||||
Name = "invitegroup";
|
||||
Description = "invite an avatar into a group. Usage: invitegroup AvatarUUID GroupUUID RoleUUID*";
|
||||
Category = CommandCategory.Groups;
|
||||
}
|
||||
|
||||
public override string Execute(string[] args, UUID fromAgentID)
|
||||
{
|
||||
if (args.Length < 2)
|
||||
return Description;
|
||||
|
||||
UUID avatar = UUID.Zero;
|
||||
UUID group = UUID.Zero;
|
||||
UUID role = UUID.Zero;
|
||||
List<UUID> roles = new List<UUID>();
|
||||
|
||||
if (!UUID.TryParse(args[0], out avatar))
|
||||
return "parse error avatar UUID";
|
||||
if (!UUID.TryParse(args[1], out group))
|
||||
return "parse error group UUID";
|
||||
for (int i = 2; i < args.Length; i++)
|
||||
if (UUID.TryParse(args[i], out role))
|
||||
roles.Add(role);
|
||||
|
||||
Client.Groups.Invite(group, roles, avatar);
|
||||
|
||||
return "invited "+avatar+" to "+group;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user