Esempio n. 1
0
        /// <summary>
        /// Get a list of current friends
        /// </summary>
        /// <param name="args">optional testClient command arguments</param>
        /// <param name="fromAgentID">The <seealso cref="OpenMetaverse.UUID"/>
        /// of the agent making the request</param>
        /// <returns></returns>
        public override CmdResult ExecuteRequest(CmdRequest args)
        {
            int argsUsed;
            IEnumerable <SimObject> objs = WorldSystem.GetPrimitives(args, out argsUsed);

            if (argsUsed == 0)
            {
                return(Success(FriendsCommand.ListFriends(Client)));
            }
            foreach (SimObject o in objs)
            {
                if (!(o is SimAvatar))
                {
                    Failure("Not avatar " + o);
                    continue;
                }
                WriteLine("Adding friend: " + o);
                UUID oID = o.ID;
                if (UUIDFactory.IsNullOrZero(oID))
                {
                    Failure("cant find " + o + " id ");
                }
                else
                {
                    Client.Friends.OfferFriendship(oID);
                }
            }
            return(Success("Ran " + Name));
        }
Esempio n. 2
0
        /// <summary>
        /// Get a list of current friends
        /// </summary>
        /// <param name="args">optional testClient command arguments</param>
        /// <param name="fromAgentID">The <seealso cref="OpenMetaverse.UUID"/>
        /// of the agent making the request</param>
        /// <returns></returns>
        public override CmdResult ExecuteRequest(CmdRequest args)
        {
            int argsUsed;
            IEnumerable <SimObject> objs = WorldSystem.GetPrimitives(args, out argsUsed);

            if (argsUsed == 0)
            {
                return(Success(FriendsCommand.ListFriends(Client)));
            }
            foreach (SimObject o in objs)
            {
                if (!(o is SimAvatar))
                {
                    Failure("Not avatar " + o);
                    continue;
                }
                WriteLine("TerminateFriendship: " + o);
                Client.Friends.TerminateFriendship(o.ID);
            }
            return(Success("Ran " + Name));
        }