当前位置: 首页>>代码示例>>C#>>正文


C# Framework.EstateBan类代码示例

本文整理汇总了C#中OpenSim.Framework.EstateBan的典型用法代码示例。如果您正苦于以下问题:C# EstateBan类的具体用法?C# EstateBan怎么用?C# EstateBan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EstateBan类属于OpenSim.Framework命名空间,在下文中一共展示了EstateBan类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendBannedUserList

 public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID)
 {
     throw new System.NotImplementedException();
 }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:4,代码来源:VWHClientView.cs

示例2: EstateSettings

        public EstateSettings(Dictionary<string, object> map)
        {
            foreach (KeyValuePair<string, object> kvp in map)
            {
                PropertyInfo p = this.GetType().GetProperty(kvp.Key, BindingFlags.Public | BindingFlags.Instance);
                if (p == null)
                    continue;

                // EstateBans is a complex type, let's treat it as special
                if (p.Name == "EstateBans")
                    continue;

                if (p.PropertyType.IsArray)
                {
                    string[] elements = ((string)map[p.Name]).Split(new char[] { ',' });
                    UUID[] uuids = new UUID[elements.Length];
                    int i = 0;
                    foreach (string e in elements)
                        uuids[i++] = new UUID(e);
                    p.SetValue(this, uuids, null);
                }
                else
                {
                    object value = p.GetValue(this, null);
                    if (value is String)
                        p.SetValue(this, map[p.Name], null);
                    else if (value is UInt32)
                        p.SetValue(this, UInt32.Parse((string)map[p.Name]), null);
                    else if (value is Boolean)
                        p.SetValue(this, Boolean.Parse((string)map[p.Name]), null);
                    else if (value is UUID)
                        p.SetValue(this, UUID.Parse((string)map[p.Name]), null);
                }
            }

            // EstateBans are special
            if (map.ContainsKey("EstateBans"))
            {
                var banData = ((Dictionary<string, object>)map["EstateBans"]).Values;
                EstateBan[] bans = new EstateBan[banData.Count];
                int b = 0;
                foreach (Dictionary<string, object> ban in banData)
                    bans[b++] = new EstateBan(ban);
                PropertyInfo bansProperty = this.GetType().GetProperty("EstateBans", BindingFlags.Public | BindingFlags.Instance);
                bansProperty.SetValue(this, bans, null);
            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:47,代码来源:EstateSettings.cs

示例3: llManageEstateAccess

        public LSL_Integer llManageEstateAccess(int action, string avatar)
        {
            m_host.AddScriptLPS(1);
            EstateSettings estate = World.RegionInfo.EstateSettings;
            bool isAccount = false;
            bool isGroup = false;

            if (!estate.IsEstateOwner(m_host.OwnerID) || !estate.IsEstateManagerOrOwner(m_host.OwnerID))
                return 0;

            UUID id = new UUID();
            if (!UUID.TryParse(avatar, out id))
                return 0;

            UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, id);
            isAccount = account != null ? true : false;
            if (!isAccount)
            {
                IGroupsModule groups = World.RequestModuleInterface<IGroupsModule>();
                if (groups != null)
                {
                    GroupRecord group = groups.GetGroupRecord(id);
                    isGroup = group != null ? true : false;
                    if (!isGroup)
                        return 0;
                }
                else
                    return 0;
            }

            switch (action)
            {
                case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_ADD:
                    if (!isAccount) return 0;
                    if (estate.HasAccess(id)) return 1;
                    if (estate.IsBanned(id))
                        estate.RemoveBan(id);
                    estate.AddEstateUser(id);
                    break;
                case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_REMOVE:
                    if (!isAccount || !estate.HasAccess(id)) return 0;
                    estate.RemoveEstateUser(id);
                    break;
                case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_ADD:
                    if (!isGroup) return 0;
                    if (estate.GroupAccess(id)) return 1;
                    estate.AddEstateGroup(id);
                    break;
                case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_REMOVE:
                    if (!isGroup || !estate.GroupAccess(id)) return 0;
                    estate.RemoveEstateGroup(id);
                    break;
                case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_ADD:
                    if (!isAccount) return 0;
                    if (estate.IsBanned(id)) return 1;
                    EstateBan ban = new EstateBan();
                    ban.EstateID = estate.EstateID;
                    ban.BannedUserID = id;
                    estate.AddBan(ban);
                    break;
                case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_REMOVE:
                    if (!isAccount || !estate.IsBanned(id)) return 0;
                    estate.RemoveBan(id);
                    break;
                default: return 0;
            }
            return 1;
        }
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:68,代码来源:LSL_Api.cs

示例4: SendBannedUserList

 public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID)
 {
 }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:3,代码来源:MyNpcCharacter.cs

示例5: EstateBanUser

        public EstateResult EstateBanUser(UUID AgentId, bool isBan)
        {
            if (AgentId == UUID.Zero)
                return EstateResult.InvalidReq; // not found
            if (AgentId == m_scene.RegionInfo.EstateSettings.EstateOwner)
                return EstateResult.InvalidReq; // never process EO
            if (m_scene.IsEstateOwnerPartner(AgentId))
                return EstateResult.InvalidReq; // never process EO
            if (AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID)
                return EstateResult.InvalidReq; // never process owner

            EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;

            bool alreadyInList = false;

            for (int i = 0; i < banlistcheck.Length; i++)
            {
                if (AgentId == banlistcheck[i].BannedUserID)
                {
                    alreadyInList = true;
                    break;
                }
            }

            if (!isBan)
            {   // This is an unban.
                if (!alreadyInList)
                    return EstateResult.AlreadySet;
                m_scene.RegionInfo.EstateSettings.RemoveBan(AgentId);
                SaveEstateDataAndUpdateRegions((uint)EstateSettings.EstateSaveOptions.EstateSaveBans);
                return EstateResult.Success;
            }

            // This is a ban.
            
            // A user cannot be in both the banned and access lists.
            // if they are being banned, remove them from access.
            EstateAllowUser(AgentId, false);    
            if (alreadyInList)
                return EstateResult.AlreadySet;

            EstateBan item = new EstateBan();
            item.BannedUserID = AgentId;
            item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID;
            item.BannedHostAddress = "0.0.0.0";
            item.BannedHostIPMask = "0.0.0.0";
            m_scene.RegionInfo.EstateSettings.AddBan(item);
            SaveEstateDataAndUpdateRegions((uint)EstateSettings.EstateSaveOptions.EstateSaveBans);

            // Banned, now shoo them away.
            ScenePresence sp = m_scene.GetScenePresence(AgentId);
            if (sp != null)
            {
                if (!sp.IsChildAgent)
                {
                    UserProfileData UserProfile = m_scene.CommsManager.UserService.GetUserProfile(AgentId);
                    if ((UserProfile != null) && (UserProfile.HomeRegionID == m_scene.RegionInfo.RegionID))
                    {
                        // Can't send them to their home region, already there and now banned.
                        sp.ControllingClient.Kick("You have been banned from your Home location. You must login directly to a different region.");
                        System.Threading.Thread.Sleep(1000);
                        sp.Scene.IncomingCloseAgent(AgentId);
                    }
                    else
                    {
                        sp.ControllingClient.SendTeleportLocationStart();
                        m_scene.TeleportClientHome(AgentId, sp.ControllingClient);
                    }
                }
            }
            return EstateResult.Success;
        }
开发者ID:zwagoth,项目名称:halcyon,代码行数:72,代码来源:EstateManagementModule.cs

示例6: handleEstateAccessDeltaRequest


//.........这里部分代码省略.........
                {
                    if ((estateAccessType & 1) != 0) // All estates
                    {
                        List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
                        EstateSettings estateSettings;

                        foreach (int estateID in estateIDs)
                        {
                            if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
                            {
                                estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
                                estateSettings.RemoveEstateGroup(user);
                                estateSettings.Save();
                            }
                        }
                    }

                    Scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
                    Scene.RegionInfo.EstateSettings.Save();

                    TriggerEstateInfoChange();
                    remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID);
                }
                else
                {
                    remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                }
            }

            if ((estateAccessType & 64) != 0) // Ban add
            {
                if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false))
                {
                    EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans;

                    bool alreadyInList = false;

                    for (int i = 0; i < banlistcheck.Length; i++)
                    {
                        if (user == banlistcheck[i].BannedUserID)
                        {
                            alreadyInList = true;
                            break;
                        }

                    }
                    if (!alreadyInList)
                    {

                        if ((estateAccessType & 1) != 0) // All estates
                        {
                            List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
                            EstateSettings estateSettings;

                            foreach (int estateID in estateIDs)
                            {
                                if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
                                {
                                    EstateBan bitem = new EstateBan();

                                    bitem.BannedUserID = user;
                                    bitem.EstateID = (uint)estateID;
                                    bitem.BannedHostAddress = "0.0.0.0";
                                    bitem.BannedHostIPMask = "0.0.0.0";

                                    estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
开发者ID:Michelle-Argus,项目名称:opensim,代码行数:67,代码来源:EstateManagementModule.cs

示例7: AddToRegionBanlist

        /// <summary>
        /// Add en entry into region banlist
        /// </summary>
        /// <param name="item"></param>
        public void AddToRegionBanlist(EstateBan item)
        {

        }
开发者ID:ChrisD,项目名称:opensim,代码行数:8,代码来源:NHibernateRegionData.cs

示例8: RemoveFromRegionBanlist

        /// <summary>
        /// remove an entry from the region banlist
        /// </summary>
        /// <param name="item"></param>
        public void RemoveFromRegionBanlist(EstateBan item)
        {

        }
开发者ID:ChrisD,项目名称:opensim,代码行数:8,代码来源:NHibernateRegionData.cs

示例9: GetEstateRegions

        public List<UUID> GetEstateRegions(uint estateID)
        {
            using (MySqlConnection conn = GetConnection())
            {
                using (MySqlCommand cmd = conn.CreateCommand())
                {
                    cmd.CommandText = "select RegionID from estate_map where EstateID = ?EstateID";
                    cmd.Parameters.AddWithValue("?EstateID", estateID);

                    IDataReader r = cmd.ExecuteReader();

                    List<UUID> regions = new List<UUID>();
                    while (r.Read())
                    {
                        EstateBan eb = new EstateBan();

                        UUID uuid = new UUID();
                        UUID.TryParse(r["RegionID"].ToString(), out uuid);

                        regions.Add(uuid);
                    }
                    r.Close();
                    return regions;
                }
            }
        }
开发者ID:BogusCurry,项目名称:halcyon,代码行数:26,代码来源:MySQLEstateData.cs

示例10: FromOSD

        public void FromOSD(OSD v)
        {
            OSDMap values = (OSDMap) v;
            EstateID = (uint) values["EstateID"].AsInteger();
            EstateName = values["EstateName"].AsString();
            AbuseEmailToEstateOwner = values["AbuseEmailToEstateOwner"].AsInteger() == 1;
            DenyAnonymous = values["DenyAnonymous"].AsInteger() == 1;
            ResetHomeOnTeleport = values["ResetHomeOnTeleport"].AsInteger() == 1;
            FixedSun = values["FixedSun"].AsInteger() == 1;
            DenyTransacted = values["DenyTransacted"].AsInteger() == 1;
            BlockDwell = values["BlockDwell"].AsInteger() == 1;
            DenyIdentified = values["DenyIdentified"].AsInteger() == 1;
            AllowVoice = values["AllowVoice"].AsInteger() == 1;
            UseGlobalTime = values["UseGlobalTime"].AsInteger() == 1;
            PricePerMeter = values["PricePerMeter"].AsInteger();
            TaxFree = values["TaxFree"].AsInteger() == 1;
            AllowDirectTeleport = values["AllowDirectTeleport"].AsInteger() == 1;
            RedirectGridX = values["RedirectGridX"].AsInteger();
            RedirectGridY = values["RedirectGridY"].AsInteger();
            ParentEstateID = (uint) values["ParentEstateID"].AsInteger();
            SunPosition = values["SunPosition"].AsReal();
            EstateSkipScripts = values["EstateSkipScripts"].AsInteger() == 1;
            BillableFactor = (float) values["BillableFactor"].AsReal();
            PublicAccess = values["PublicAccess"].AsInteger() == 1;
            AbuseEmail = values["AbuseEmail"].AsString();
            EstateOwner = values["EstateOwner"].AsUUID();
            AllowLandmark = values["AllowLandmark"].AsInteger() == 1;
            AllowParcelChanges = values["AllowParcelChanges"].AsInteger() == 1;
            AllowSetHome = values["AllowSetHome"].AsInteger() == 1;
            DenyMinors = values["DenyMinors"].AsInteger() == 1;
            //We always try to pull this in if it exists
            if (values.ContainsKey("EstatePass"))
                EstatePass = values["EstatePass"].AsString();

            OSDMap Managers = values["EstateManagers"] as OSDMap;
#if (!ISWIN)
            List<UUID> list = new List<UUID>();
            foreach (OSD id in Managers.Values)
                list.Add(id.AsUUID());
            EstateManagers = list.ToArray();
#else
            EstateManagers = Managers.Values.Select(ID => ID.AsUUID()).ToArray();
#endif

            OSDMap Ban = values["EstateBans"] as OSDMap;
            List<EstateBan> NewBan = new List<EstateBan>();
            foreach (OSD BannedUser in Ban.Values)
            {
                EstateBan ban = new EstateBan();
                ban.FromOSD(BannedUser);
                NewBan.Add(ban);
            }
            EstateBans = NewBan.ToArray();

            OSDMap Access = values["EstateAccess"] as OSDMap;
#if (!ISWIN)
            List<UUID> list1 = new List<UUID>();
            foreach (OSD uuid in Access.Values)
                list1.Add(uuid.AsUUID());
            EstateAccess = list1.ToArray();
#else
            EstateAccess = Access.Values.Select(UUID => UUID.AsUUID()).ToArray();
#endif

            OSDMap Groups = values["EstateGroups"] as OSDMap;
#if (!ISWIN)
            List<UUID> list2 = new List<UUID>();
            foreach (OSD uuid in Groups.Values)
                list2.Add(uuid.AsUUID());
            EstateGroups = list2.ToArray();
#else
            EstateGroups = Groups.Values.Select(UUID => UUID.AsUUID()).ToArray();
#endif
        }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:74,代码来源:EstateSettings.cs

示例11: handleEstateAccessDeltaRequest


//.........这里部分代码省略.........
                        foreach (EstateSettings estate in estateIDs)
                        {
                            if (estate.EstateID != m_scene.RegionInfo.EstateSettings.EstateID)
                            {
                                estate.RemoveEstateGroup (user);
                                estate.Save ();
                            }
                        }
                    }
                    m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
                    if ((estateAccessType & (int)AccessDeltaRequest.MoreToCome) == 0) //1024 means more than one is being sent
                    {
                        m_scene.RegionInfo.EstateSettings.Save();
                        TriggerEstateInfoChange();
                    }
                }
                else
                {
                    remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                }
            }
            if ((estateAccessType & (int)AccessDeltaRequest.AddBannedUser) != 0) // Ban add
            {
                if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
                {
                    IEstateConnector connector = Aurora.DataManager.DataManager.RequestPlugin<IEstateConnector> ();
                    if ((estateAccessType & 1) != 0 && connector != null) // All estates
                    {
                        List<EstateSettings> estateIDs = connector.GetEstates (remote_client.AgentId);
                        foreach (EstateSettings estate in estateIDs)
                        {
                            if (estate.EstateID != m_scene.RegionInfo.EstateSettings.EstateID)
                            {
                                EstateBan[] innerbanlistcheck = estate.EstateBans;

                                bool inneralreadyInList = false;

                                for (int i = 0; i < innerbanlistcheck.Length; i++)
                                {
                                    if (user == innerbanlistcheck[i].BannedUserID)
                                    {
                                        inneralreadyInList = true;
                                        break;
                                    }

                                }
                                if (!inneralreadyInList)
                                {
                                    EstateBan item = new EstateBan ();

                                    item.BannedUserID = user;
                                    item.EstateID = estate.EstateID;
                                    IScenePresence SP = m_scene.GetScenePresence (user);
                                    item.BannedHostAddress = (SP != null) ? ((System.Net.IPEndPoint)SP.ControllingClient.GetClientEP ()).Address.ToString () : "0.0.0.0";
                                    item.BannedHostIPMask = (SP != null) ? ((System.Net.IPEndPoint)SP.ControllingClient.GetClientEP ()).Address.ToString () : "0.0.0.0";
                                    item.BannedHostNameMask = (SP != null) ? ((System.Net.IPEndPoint)SP.ControllingClient.GetClientEP ()).Address.ToString () : "0.0.0.0";
                                    estate.AddBan (item);
                                    estate.Save ();
                                }
                            }
                        }
                    }
                    EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;

                    bool alreadyInList = false;
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:66,代码来源:EstateManagementModule.cs

示例12: handleEstateAccessDeltaRequest

        private void handleEstateAccessDeltaRequest(IClientAPI remote_client, UUID invoice, int estateAccessType, UUID user)
        {
            // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups..  etc.

            if (user == m_scene.RegionInfo.EstateSettings.EstateOwner)
                return; // never process EO
            if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID)
                return; // never process owner

            switch (estateAccessType)
            {
                case 64:
                    if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
                    {
                        EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;

                        bool alreadyInList = false;

                        for (int i = 0; i < banlistcheck.Length; i++)
                        {
                            if (user == banlistcheck[i].BannedUserID)
                            {
                                alreadyInList = true;
                                break;
                            }

                        }
                        if (!alreadyInList)
                        {

                            EstateBan item = new EstateBan();

                            item.BannedUserID = user;
                            item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID;
                            item.BannedHostAddress = "0.0.0.0";
                            item.BannedHostIPMask = "0.0.0.0";

                            m_scene.RegionInfo.EstateSettings.AddBan(item);
                            m_scene.RegionInfo.EstateSettings.Save();

                            ScenePresence s = m_scene.GetScenePresence(user);
                            if (s != null)
                            {
                                if (!s.IsChildAgent)
                                {
                                    s.ControllingClient.SendTeleportLocationStart();
                                    m_scene.TeleportClientHome(user, s.ControllingClient);
                                }
                            }

                        }
                        else
                        {
                            remote_client.SendAlertMessage("User is already on the region ban list");
                        }
                        //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
                        remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
                    }
                    else
                    {
                        remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                    }
                    break;
                case 128:
                    if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
                    {
                        EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;

                        bool alreadyInList = false;
                        EstateBan listitem = null;

                        for (int i = 0; i < banlistcheck.Length; i++)
                        {
                            if (user == banlistcheck[i].BannedUserID)
                            {
                                alreadyInList = true;
                                listitem = banlistcheck[i];
                                break;
                            }

                        }
                        if (alreadyInList && listitem != null)
                        {
                            m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
                            m_scene.RegionInfo.EstateSettings.Save();
                        }
                        else
                        {
                            remote_client.SendAlertMessage("User is not on the region ban list");
                        }
                        //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
                        remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
                    }
                    else
                    {
                        remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                    }
                    break;
                case 256:

//.........这里部分代码省略.........
开发者ID:ChrisD,项目名称:opensim,代码行数:101,代码来源:EstateManagementModule.cs

示例13: T022_EstateSettingsBanList

        public void T022_EstateSettingsBanList()
        {
            // Letting estate store generate rows to database for us
            EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID);

            EstateBan estateBan1 = new EstateBan();
            estateBan1.BannedUserID = DataTestUtil.UUID_MIN;

            EstateBan estateBan2 = new EstateBan();
            estateBan2.BannedUserID = DataTestUtil.UUID_MAX;

            originalSettings.EstateBans = new EstateBan[] { estateBan1, estateBan2 };

            // Saving settings.
            db.StoreEstateSettings(originalSettings);

            // Loading settings to another instance variable.
            EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID);

            Assert.AreEqual(2, loadedSettings.EstateBans.Length);
            Assert.AreEqual(DataTestUtil.UUID_MIN, loadedSettings.EstateBans[0].BannedUserID);

            Assert.AreEqual(DataTestUtil.UUID_MAX, loadedSettings.EstateBans[1].BannedUserID);

        }
开发者ID:Ideia-Boa,项目名称:diva-distribution,代码行数:25,代码来源:BasicEstateTest.cs

示例14: AddBan

 public void AddBan(EstateBan ban)
 {
     if (ban == null)
         return;
     if (!IsBanned(ban.BannedUserID))
         l_EstateBans.Add(ban);
 }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:7,代码来源:EstateSettings.cs

示例15: LoadBanList

        private void LoadBanList(EstateSettings es)
		{
			es.ClearBans();

            List<string> query = null;
            try
            {
                query = GD.Query(new string[] { "ID", "`Key`" }, new object[] { es.EstateID, "EstateBans" }, "estates", "Value");
            }
            catch
            {
            }
            if (query == null || query.Count == 0)
                return; //Couldn't find it, return then.

            OSDMap estateInfo = (OSDMap)OSDParser.DeserializeLLSDXml(query[0]);
            foreach (OSD map in estateInfo.Values)
            {
                OSDMap estateBan = (OSDMap)map;
				EstateBan eb = new EstateBan();

                eb.BannedUserID = estateBan["BannedUserID"].AsUUID();
                eb.BannedHostAddress = estateBan["BannedHostAddress"].AsString();
                eb.BannedHostIPMask = estateBan["BannedHostIPMask"].AsString();
				es.AddBan(eb);
			}
		}
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:27,代码来源:LocalEstateConnector.cs


注:本文中的OpenSim.Framework.EstateBan类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。