Пример #1
0
 private void Directory_OnDirPeopleReply(object sender, DirPeopleReplyEventArgs e)
 {
     BeginInvoke(new MethodInvoker(() =>
     {
         PeopleReply(e.QueryID, e.MatchedPeople);
     }));
 }
Пример #2
0
        private void KeyResolvHandler(object sender, DirPeopleReplyEventArgs e)
        {
            if (query != e.QueryID)
                return;

            resolvedMasterKey = e.MatchedPeople[0].AgentID;
            keyResolution.Set();
            query = UUID.Zero;
        }
Пример #3
0
 private void Directory_DirPeople(object sender, DirPeopleReplyEventArgs e)
 {
     if (e.MatchedPeople.Count > 0)
     {
         foreach (DirectoryManager.AgentSearchData agent in e.MatchedPeople)
         {
             WriteLine("{0} {1} ({2})", agent.FirstName, agent.LastName, agent.AgentID);
         }
     }
     else
     {
         WriteLine("Didn't find any people that matched your query :(");
     }
     waitQuery.Set();
 }
        void Directory_DirPeopleReply(object sender, DirPeopleReplyEventArgs e)
        {
            if (e.QueryID != this.queryID) return;

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

            lvwFindPeople.BeginUpdate();

            foreach (DirectoryManager.AgentSearchData person in e.MatchedPeople)
            {
                string fullName = person.FirstName + " " + person.LastName;
                findPeopleResults.Add(fullName, person.AgentID);

                ListViewItem item = lvwFindPeople.Items.Add(fullName);
                item.SubItems.Add(person.Online ? "Yes" : "No");
            }

            lvwFindPeople.Sort();
            lvwFindPeople.EndUpdate();
        }
Пример #5
0
        //Separate thread
        private void Directory_OnDirPeopleReply(object sender, DirPeopleReplyEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke((MethodInvoker)delegate { Directory_OnDirPeopleReply(sender, e); });
                return;
            }

            BeginInvoke((MethodInvoker)delegate { PeopleReply(e.QueryID, e.MatchedPeople); });
        }
Пример #6
0
        void Directory_DirPeopleReply(object sender, DirPeopleReplyEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Directory_DirPeopleReply(sender, e)));
                return;
            }

            if (console.QueryID != e.QueryID) return;

            totalResults += e.MatchedPeople.Count;
            lblResultCount.Text = totalResults.ToString() + " people found";

            txtPersonName.Enabled = true;
            btnFind.Enabled = true;

            btnNext.Enabled = (totalResults > 100);
            btnPrevious.Enabled = (startResult > 0);
        }
 /// <summary>Raises the DirPeopleReply event</summary>
 /// <param name="e">A DirPeopleReplyEventArgs object containing the
 /// data returned from the data server</param>
 protected virtual void OnDirPeople(DirPeopleReplyEventArgs e)
 {
     EventHandler<DirPeopleReplyEventArgs> handler = m_DirPeople;
     if (handler != null)
         handler(this, e);
 }
Пример #8
0
 //Separate thread
 private void Directory_OnDirPeopleReply(object sender, DirPeopleReplyEventArgs e)
 {
     BeginInvoke((MethodInvoker)delegate {
         PeopleReply(queryID, e.MatchedPeople);
     });
 }
Пример #9
0
        void Directory_DirPeopleReply(object sender, DirPeopleReplyEventArgs e)
        {
            if(e.QueryID!=queryid)
                    return;

            people_found += e.MatchedPeople.Count;
            Gtk.Application.Invoke(delegate {

            this.label_info.Text="Search returned "+people_found.ToString()+" results";

             if (e.MatchedPeople.Count == 0)
                return;

            foreach(OpenMetaverse.DirectoryManager.AgentSearchData person in e.MatchedPeople)
            {

                if (person.AgentID == UUID.Zero)
                    continue;
                    store.AppendValues (person.Online,person.FirstName+" "+person.LastName,person.AgentID);
                    if(!MainClass.name_cache.av_names.ContainsKey(person.AgentID))
                        MainClass.name_cache.av_names.Add(person.AgentID,person.FirstName+" "+person.LastName);
            }

            });
        }
Пример #10
0
 public void Directory_DirPeopleReply(object sender, DirPeopleReplyEventArgs e)
 {
     Hashtable item = new Hashtable();
     item.Add("MessageType", "DirPeopleReply");
     List<Hashtable> results = new List<Hashtable>();
     foreach (DirectoryManager.AgentSearchData person in e.MatchedPeople)
     {
         Hashtable result = new Hashtable();
         result.Add("AgentID", person.AgentID);
         result.Add("FirstName", person.FirstName);
         result.Add("LastName", person.LastName);
         results.Add(result);
     }
     item.Add("Results", results);
     enqueue(item);
 }
Пример #11
0
 private void PeopleSearchReply(object sender, DirPeopleReplyEventArgs e)
 {
     if (e.QueryID != QueryID) return;
     Importing.Client.Directory.DirPeopleReply -= PeopleSearchReply;
     foreach (var match in e.MatchedPeople)
     {
         if (match.FirstName + " " + match.LastName == NewName)
         {
             NewID = match.AgentID;
             return;
         }
     }
     WaitOnCreate.Set();
 }
Пример #12
0
 public virtual void Directory_OnDirPeopleReply(Object sender, DirPeopleReplyEventArgs e) { OnEvent("On-Dir-People-Reply", paramNamesOnDirPeopleReply, paramTypesOnDirPeopleReply, e.QueryID, e.MatchedPeople); }
Пример #13
0
        /*
        // obsoleted packet call
        public void Avatars_OnDirPeopleReply(Packet packet, Simulator simulator)
        {
            DirPeopleReplyPacket reply = (DirPeopleReplyPacket)packet;
            DebugUtilities.WriteDebug("Got DirPeopleReply!");
            if (reply.QueryReplies.Length < 1) {
                DebugUtilities.WriteWarning(session + " " + MethodName + " Error - empty people directory reply");
            } else {
                int replyCount = reply.QueryReplies.Length;
                DebugUtilities.WriteInfo(session + " " + MethodName + " Proccesing " + replyCount.ToString() + " DirPeople replies");
                for ( int i = 0 ; i <  replyCount ; i++ ) {
                    string avatarName = Utils.BytesToString(reply.QueryReplies[i].FirstName) + " " + Utils.BytesToString(reply.QueryReplies[i].LastName);
                    UUID avatarKey = reply.QueryReplies[i].AgentID;
                    DebugUtilities.WriteDebug(session + " " + MethodName + " Reply " + (i + 1).ToString() + " of " + replyCount.ToString() + " Key : " + avatarKey.ToString() + " Name : " + avatarName);

                    if ( !avatarKeys.ContainsKey(avatarName) ) // || avatarKeys[avatarName] == null ) { // apparently dictionary entries cannot be null
                        lock ( avatarKeys ) {
                            avatarKeys[avatarName.ToLower()] = avatarKey;
                        }
                    }

                    lock(KeyLookupEvents)
                    {
                         if ( KeyLookupEvents.ContainsKey(avatarName.ToLower())) {
                                 KeyLookupEvents[avatarName.ToLower()].Set();
                            DebugUtilities.WriteDebug(avatarName.ToLower() + " KLE set!");
                         }
                    }
                }
            }
        } */
        // using new Directory functionality
        public void Avatars_OnDirPeopleReply(object sender, DirPeopleReplyEventArgs e)
        {
            if (e.MatchedPeople.Count < 1)
            {
                DebugUtilities.WriteWarning(session + " " + MethodName + " Error - empty people directory reply");
            }
            else
            {
                int replyCount = e.MatchedPeople.Count;

                DebugUtilities.WriteInfo(session + " " + MethodName + " Proccesing " + replyCount.ToString() + " DirPeople replies");
                for ( int i = 0 ; i <  replyCount ; i++ )
                {
                    string avatarName = e.MatchedPeople[i].FirstName + " " + e.MatchedPeople[i].LastName;
                    UUID avatarKey = e.MatchedPeople[i].AgentID;
                    DebugUtilities.WriteDebug(session + " " + MethodName + " Reply " + (i + 1).ToString() + " of " + replyCount.ToString() + " Key : " + avatarKey.ToString() + " Name : " + avatarName);

                    if ( !avatarKeys.ContainsKey(avatarName) ) { /* || avatarKeys[avatarName] == null )	 // apparently dictionary entries cannot be null */
                        lock ( avatarKeys )
                        {
                            avatarKeys[avatarName.ToLower()] = avatarKey;
                        }
                    }

                    lock(KeyLookupEvents)
                    {
                         if ( KeyLookupEvents.ContainsKey(avatarName.ToLower()))
                         {
                                 KeyLookupEvents[avatarName.ToLower()].Set();
                            DebugUtilities.WriteDebug(avatarName.ToLower() + " KLE set!");
                         }
                    }
                }
            }
        }