Ejemplo n.º 1
0
        void Avatars_AvatarGroupsReply(object sender, AvatarGroupsReplyEventArgs e)
        {
            if (e.AvatarID != agentID)
            {
                return;
            }

            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Avatars_AvatarGroupsReply(sender, e)));
                return;
            }

            lvwGroups.BeginUpdate();

            foreach (AvatarGroup g in e.Groups)
            {
                if (!lvwGroups.Items.ContainsKey(g.GroupID.ToString()))
                {
                    ListViewItem item = new ListViewItem();
                    item.Name = g.GroupID.ToString();
                    item.Text = g.GroupName;
                    item.Tag  = g;
                    item.SubItems.Add(new ListViewItem.ListViewSubItem(item, g.GroupTitle));

                    lvwGroups.Items.Add(item);
                }
            }

            lvwGroups.EndUpdate();
        }
Ejemplo n.º 2
0
        private void Avatars_OnGroupsReply(object sender, AvatarGroupsReplyEventArgs e)
        {
            if (e.AvatarID != agentID)
            {
                return;
            }

            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Avatars_OnGroupsReply(sender, e)));
                return;
            }

            //lvGroups.Items.Clear();

            foreach (AvatarGroup group in e.Groups)
            {
                ListViewItem lvi = new ListViewItem();
                lvi.Text = group.GroupName;
                lvi.Tag  = group;

                if (!lvGroups.Items.Contains(lvi))
                {
                    lvGroups.Items.Add(lvi);
                }
            }
        }
Ejemplo n.º 3
0
        // CALLBACKS

        // These are all assigned to LibSL callbacks in Connect.cs. This determines their argument order.
        // The if(!active) check is to ensure they don't get called after we've logged off. This is a
        // LibSL bug.

        // These almost all perform the same task:
        // 1) Create a hashtable
        // 2) Place various passed-in arguments in the hashtable
        // 3) Optionally, loop through one of the arguments if necessary, and add this to the hashtable
        //    as a bunch more hashtables.
        // 4) Enqueue the hashtable in the message queue. This is periodically emptied by the client.

        public void Avatars_AvatarGroupsReply(object sender, AvatarGroupsReplyEventArgs e)
        {
            Hashtable item = new Hashtable();

            item.Add("MessageType", "AvatarGroups");
            item.Add("AvatarID", e.AvatarID);
            item.Add("Groups", e.Groups);
            enqueue(item);
        }
Ejemplo n.º 4
0
        public override void Avatars_OnAvatarGroups(object sender, AvatarGroupsReplyEventArgs e)
        {
            SimAvatar A = DeclareAvatarProfile(e.AvatarID);

            A.AddGoupRoles(e.Groups);
            foreach (AvatarGroup grp in e.Groups)
            {
                AddGroup2Key(grp.GroupName, grp.GroupID);
                //TODO SendNewEvent("On-Avatar-Properties", GetAvatar(avatarID, null), grp);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Loop through all (pending) replies for groups
 /// and process them if they contain any avatar key we're looking for.
 /// </summary>
 /// <param name="sender">parameter ignored</param>
 /// <param name="e">List of UUID/Avatar names</param>
 /// <returns>void</returns>
 public void Avatar_OnAvatarGroups(
     object?sender,
     AvatarGroupsReplyEventArgs e
     )
 {
     lock (avatarGroups)
     {
         avatarGroups[e.AvatarID] = e.Groups;
     }
     if (GroupsLookupEvents.ContainsKey(e.AvatarID))
     {
         GroupsLookupEvents[e.AvatarID].Set();
     }
 }
Ejemplo n.º 6
0
        void Avatars_AvatarGroupsReply(object sender, AvatarGroupsReplyEventArgs e)
        {
            lock (ReceivedProfileEvent)
            {
                foreach (AvatarGroup group in e.Groups)
                {
                    Groups.Add(group.GroupID);
                }

                ReceivedGroups = true;

                if (ReceivedInterests && ReceivedProperties && ReceivedGroups)
                {
                    ReceivedProfileEvent.Set();
                }
            }
        }