Наследование: Universe.Framework.Modules.IDataTransferable
        /// <summary>
        ///     Get all the mutes from the database
        /// </summary>
        /// <param name="AgentID"></param>
        /// <param name="Cached"></param>
        /// <returns></returns>
        public MuteList[] GetMutes(UUID AgentID, out bool Cached)
        {
            Cached = false;
            MuteList[] List = new MuteList[0];
            if (MuteListConnector == null)
                return List;
            lock (MuteListCache)
            {
                if (!MuteListCache.TryGetValue(AgentID, out List))
                {
                    List = MuteListConnector.GetMuteList(AgentID).ToArray();
                    MuteListCache.Add(AgentID, List);
                }
                else
                    Cached = true;
            }

            return List;
        }
 /// <summary>
 ///     Update the mute in the database
 /// </summary>
 /// <param name="MuteID"></param>
 /// <param name="Name"></param>
 /// <param name="Flags"></param>
 /// <param name="AgentID"></param>
 public void UpdateMuteList(UUID MuteID, string Name, int Flags, UUID AgentID)
 {
     if (MuteID == UUID.Zero)
         return;
     MuteList Mute = new MuteList
                         {
                             MuteID = MuteID,
                             MuteName = Name,
                             MuteType = Flags.ToString()
                         };
     MuteListConnector.UpdateMute(Mute, AgentID);
     lock (MuteListCache)
         MuteListCache.Remove(AgentID);
 }
Пример #3
0
        public override void FromOSD(OSDMap map)
        {
            AgentInfo = new IAgentInfo();
            AgentInfo.FromOSD((OSDMap) (map["AgentInfo"]));
            UserAccount = new UserAccount();
            UserAccount.FromOSD((OSDMap)(map["UserAccount"]));
            if (!map.ContainsKey("ActiveGroup"))
                ActiveGroup = null;
            else
            {
                ActiveGroup = new GroupMembershipData();
                ActiveGroup.FromOSD((OSDMap)(map["ActiveGroup"]));
            }
            GroupMemberships = ((OSDArray) map["GroupMemberships"]).ConvertAll<GroupMembershipData>((o) =>
                                                                                                        {
                                                                                                            GroupMembershipData
                                                                                                                group =
                                                                                                                    new GroupMembershipData
                                                                                                                        ();
                                                                                                            group
                                                                                                                .FromOSD
                                                                                                                ((OSDMap
                                                                                                                 ) o);
                                                                                                            return group;
                                                                                                        });
            OfflineMessages = ((OSDArray) map["OfflineMessages"]).ConvertAll<GridInstantMessage>((o) =>
                                                                                                     {
                                                                                                         GridInstantMessage
                                                                                                             group =
                                                                                                                 new GridInstantMessage
                                                                                                                     ();
                                                                                                         group.FromOSD(
                                                                                                             (OSDMap) o);
                                                                                                         return group;
                                                                                                     });
            MuteList = ((OSDArray) map["MuteList"]).ConvertAll<MuteList>((o) =>
                                                                             {
                                                                                 MuteList group = new MuteList();
                                                                                 group.FromOSD((OSDMap) o);
                                                                                 return group;
                                                                             });

            if (map.ContainsKey("Appearance"))
            {
                Appearance = new AvatarAppearance();
                Appearance.FromOSD((OSDMap)map["Appearance"]);
            }
            if (map.ContainsKey("FriendOnlineStatuses"))
                FriendOnlineStatuses = ((OSDArray)map["FriendOnlineStatuses"]).ConvertAll<UUID>((o) => { return o; });
            if (map.ContainsKey("Friends"))
                Friends = ((OSDArray)map["Friends"]).ConvertAll<FriendInfo>((o) =>
                {
                    FriendInfo f = new FriendInfo();
                    f.FromOSD((OSDMap)o);
                    return f;
                });
        }
        public void UpdateMute(MuteList mute, UUID AgentID)
        {
            object remoteValue = DoRemote(mute, AgentID);
            if (remoteValue != null || m_doRemoteOnly)
                return;

            GenericUtils.AddGeneric(AgentID, "MuteList", mute.MuteID.ToString(), mute.ToOSD(), GD);
        }
Пример #5
0
 /// <summary>
 ///     Update the mute in the database
 /// </summary>
 /// <param name="muteID"></param>
 /// <param name="muteName"></param>
 /// <param name="flags"></param>
 /// <param name="agentID"></param>
 public void UpdateMuteList (UUID muteID, string muteName, int flags, UUID agentID)
 {
     if (muteID == UUID.Zero)
         return;
     MuteList Mute = new MuteList {
         MuteID = muteID,
         MuteName = muteName,
         MuteType = flags.ToString ()
     };
     MuteListConnector.UpdateMute (Mute, agentID);
     lock (MuteListCache)
         MuteListCache.Remove (agentID);
 }
Пример #6
0
        /// <summary>
        ///     Get all the mutes from the database
        /// </summary>
        /// <param name="agentID"></param>
        /// <param name="cached"></param>
        /// <returns></returns>
        public MuteList [] GetMutes (UUID agentID, out bool cached)
        {
            cached = false;
            MuteList [] muteList = new MuteList [0];
            if (MuteListConnector == null)
                return muteList;
            lock (MuteListCache) {
                if (!MuteListCache.TryGetValue (agentID, out muteList)) {
                    muteList = MuteListConnector.GetMuteList (agentID).ToArray ();
                    MuteListCache.Add (agentID, muteList);
                } else
                    cached = true;
            }

            return muteList;
        }
        public void UpdateMute (MuteList mute, UUID AgentID)
        {
            if (m_doRemoteOnly) {
                DoRemote (mute, AgentID);
                return;
            }

            GenericUtils.AddGeneric (AgentID, "MuteList", mute.MuteID.ToString (), mute.ToOSD (), GD);
        }