Ejemplo n.º 1
0
        /// <summary>
        /// Creates AgentDisplayName object from OSD
        /// </summary>
        /// <param name="data">Incoming OSD data</param>
        /// <returns>AgentDisplayName object</returns>
        public static AgentDisplayName FromOSD(OSD data)
        {
            AgentDisplayName ret = new AgentDisplayName();

            OSDMap map = (OSDMap)data;
            ret.ID = map["id"];
            ret.UserName = map["username"];
            ret.DisplayName = map["display_name"];
            ret.LegacyFirstName = map["legacy_first_name"];
            ret.LegacyLastName = map["legacy_last_name"];
            ret.IsDefaultDisplayName = map["is_display_name_default"];
            ret.NextUpdate = map["display_name_next_update"];
            ret.Updated = map["last_updated"];

            return ret;
        }
Ejemplo n.º 2
0
 public DisplayNameUpdateEventArgs(string oldDisplayName, AgentDisplayName displayName)
 {
     this.oldDisplayName = oldDisplayName;
     this.displayName = displayName;
 }
Ejemplo n.º 3
0
 /// <summary>Default constructor</summary>
 public SetDisplayNameReplyEventArgs(int status, string reason, AgentDisplayName displayName)
 {
     m_Status = status;
     m_Reason = reason;
     m_DisplayName = displayName;
 }
Ejemplo n.º 4
0
        private void DisplayNameReceived(bool success, AgentDisplayName[] names, UUID[] badIDs)
        {
            //if (success)
            //{
            //    this.BeginInvoke(new MethodInvoker(delegate()
            //    {
            //        List<FriendInfo> friendslist = this.instance.State.AvatarFriends;

            //        if (friendslist.Count > 0)
            //        {
            //            foreach (FriendInfo friend in friendslist)
            //            {
            //                if (friend.UUID == names[0].ID)
            //                {
            //                    if (names[0].DisplayName != string.Empty)
            //                    {
            //                        if (!names[0].DisplayName.ToLower().Contains("resident") && !names[0].DisplayName.ToLower().Contains(" "))
            //                        {
            //                            friend.Name = names[0].DisplayName + " (" + names[0].UserName + ")";

            //                            int s = lbxFriends.FindString(names[0].LegacyFullName);

            //                            if (s > -1)
            //                            {
            //                                lbxFriends.Items[s] = friend.Name;
            //                            }
            //                        }
            //                    }
            //                }
            //            }
            //        }
            //    }));
            //}
        }
Ejemplo n.º 5
0
        void ProcessDisplayNames(AgentDisplayName[] names)
        {
            Dictionary<UUID, string> ret = new Dictionary<UUID, string>();

            foreach (var name in names)
            {
                // Remove from the list of active requests
                lock (activeRequests)
                {
                    activeRequests.Remove(name.ID);
                }

                if (InvalidName(name.DisplayName)) continue;

                ret.Add(name.ID, FormatName(name));

                name.Updated = DateTime.Now;
                lock (this.names)
                {
                    this.names[name.ID] = name;
                }
            }

            TriggerEvent(ret);
            TriggerCacheSave();
        }
Ejemplo n.º 6
0
        string FormatName(AgentDisplayName n)
        {
            switch (Mode)
            {
                case NameMode.OnlyDisplayName:
                    return n.DisplayName;

                case NameMode.Smart:
                    if (n.IsDefaultDisplayName)
                        return n.DisplayName;
                    else
                        return string.Format("{0} ({1})", n.DisplayName, n.UserName);

                case NameMode.DisplayNameAndUserName:
                    return string.Format("{0} ({1})", n.DisplayName, n.UserName);

                default:
                    return n.LegacyFullName;
            }
        }
Ejemplo n.º 7
0
 private void DisplayNamesCallBack(bool status, AgentDisplayName[] nme, UUID[] badIDs)
 {
     if (status)
     {
         client.Self.SetDisplayNameReply += new EventHandler<SetDisplayNameReplyEventArgs>(Self_SetDisplayNameReply);
         client.Self.SetDisplayName(nme[0].DisplayName, newname);
     }
     else
     {
         MessageBox.Show("Could not retrieve old name.", "METAbolt", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 8
0
 private void DisplayNameReceived(bool success, AgentDisplayName[] names, UUID[] badIDs)
 {
     if (success)
     {
         this.BeginInvoke(new MethodInvoker(delegate()
         {
             if (!names[0].DisplayName.ToLower(CultureInfo.CurrentCulture).Contains("resident") && !names[0].DisplayName.ToLower(CultureInfo.CurrentCulture).Contains(" "))
             {
                 txtDisplayName.Text = names[0].DisplayName;
             }
             else
             {
                 txtDisplayName.Text = string.Empty;
             }
         }));
     }
 }