예제 #1
0
        private void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
        {
            if (null == GroupsCache)
            {
                GroupsCache = e.Groups;
            }
            else
            {
                lock (GroupsCache) { GroupsCache = e.Groups; }
            }
            GroupsEvent.Set();

            foreach (KeyValuePair <UUID, Group> DoCache in GroupsCache)
            {
                bool Retry = true;
                while (Retry)
                {
                    grid.Groups.RequestGroupRoles(DoCache.Value.ID);
                    if (RoleReply.WaitOne(TimeSpan.FromSeconds(30), false))
                    {
                        Retry = false;
                    }
                    else
                    {
                        MHE(Destinations.DEST_LOCAL, UUID.Zero, "There appears to have been a failure requesting the group roles for secondlife:///app/group/" + DoCache.Value.ID.ToString() + "/about - Trying again");
                    }
                }
            }
        }
예제 #2
0
 public virtual void GroupsHandler(object sender, CurrentGroupsEventArgs e)
 {
     mygroups = e.Groups;
     foreach (KeyValuePair <UUID, Group> entry in mygroups)
     {
         Client.Self.RequestJoinGroupChat(entry.Value.ID);
     }
 }
예제 #3
0
        public void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
        {
            Hashtable message = new Hashtable();

            message.Add("MessageType", "CurrentGroups");
            message.Add("Groups", e.Groups);
            enqueue(message);
        }
        private void OnGroupListLoaded(object sender, CurrentGroupsEventArgs e)
        {
            groups = e.Groups;
            InitChannels();

            if (this.ChannelListLoaded != null)
            {
                ChannelListLoaded(this.GetChannels());
            }
        }
예제 #5
0
 void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
 {
     if (null == GroupsCache)
     {
         GroupsCache = e.Groups;
     }
     else
     {
         lock (GroupsCache) { GroupsCache = e.Groups; }
     }
     GroupsEvent.Set();
 }
예제 #6
0
        public override void Groups_OnCurrentGroups(object sender, CurrentGroupsEventArgs e)
        {
            var groups = e.Groups;

            foreach (UUID key in groups.Keys)
            {
                Group g = groups[key];
                AddGroup2Key(g.Name, key);
                RegisterGroup(key, g);
            }
            //base.Groups_OnCurrentGroups(groups);
            //OnEvent("On-Current-Groups", paramNamesOnCurrentGroups, paramTypesOnCurrentGroups, groups);
        }
예제 #7
0
        private static void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
        {
            if (null == GroupsCache)
            {
                GroupsCache = e.Groups;
            }
            else
            {
                lock (GroupsCache) { GroupsCache = e.Groups; }
            }
            GroupsEvent.Set();

            foreach (KeyValuePair <UUID, Group> DoCache in GroupsCache)
            {
                bool Retry = true;
                int  count = 0;
                while (Retry)
                {
                    client.Groups.RequestGroupRoles(DoCache.Value.ID);
                    if (RoleReply.WaitOne(TimeSpan.FromSeconds(30), false))
                    {
                        Retry = false;
                    }
                    else
                    {
                        count++;
                        //MH.callbacks(MessageHandler.Destinations.DEST_LOCAL, UUID.Zero, "There appears to have been a failure requesting the group roles for secondlife:///app/group/" + DoCache.Value.ID.ToString() + "/about - Trying again");

                        if (count >= 5)
                        {
                            MH(Destinations.DEST_LOCAL, UUID.Zero, "Aborting group refresh attempt. Too many errors - Resetting cache and retrying");
                            GroupsEvent.Reset();
                            GroupsCache = new Dictionary <UUID, Group>();
                            client.Groups.CurrentGroups -= Groups_CurrentGroups;

                            ReloadGroupsCache();

                            return;
                        }
                    }
                }
            }
        }
예제 #8
0
        private void Groups_OnCurrentGroups(object sender, CurrentGroupsEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new MethodInvoker(delegate()
                {
                    Groups_OnCurrentGroups(sender, e);
                }));

                return;
            }

            lock (instance.State.Groups)
            {
                foreach (KeyValuePair <UUID, Group> g in e.Groups)
                {
                    if (!instance.State.Groups.ContainsKey(g.Key))
                    {
                        instance.State.Groups.Add(g.Key, g.Value);
                    }
                }
            }

            lock (instance.State.GroupStore)
            {
                foreach (Group group in this.instance.State.Groups.Values)
                {
                    if (!instance.State.GroupStore.ContainsKey(group.ID))
                    {
                        this.instance.State.GroupStore.Add(group.ID, group.Name);
                    }
                }
            }

            this.BeginInvoke(new MethodInvoker(delegate()
            {
                UpdateGroups();
            }));
        }
예제 #9
0
 void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
 {
     BeginInvoke(new MethodInvoker(UpdateDisplay));
 }
예제 #10
0
 void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
 {
     this.groups = e.Groups;
 }
예제 #11
0
 void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
 {
     RefreshGroups(e.Groups);
 }
예제 #12
0
 void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
 {
     RefreshGroups(e.Groups);
 }
예제 #13
0
        void Groups_CurrentGroups(object sender, CurrentGroupsEventArgs e)
        {
            Groups = e.Groups;

            Invoke(new MethodInvoker(UpdateGroups));
        }
예제 #14
0
 private void Self_Current_Groups(object sender, CurrentGroupsEventArgs e)
 {
     groups = e.Groups;
 }