From 263633e274082135b21b8183b92280b768d18883 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 18 Jul 2008 02:40:47 +0000 Subject: Patch #9151 Makes the estate dialog fully functional. Implements all client facing functionality. Moves estate data from estate_settings.xml, which is used to provide defaults, to the region data store. Creates one estate for each region, and places the region in it. Converts all region bans to estate bans. --- OpenSim/Framework/EstateBan.cs | 43 +++ OpenSim/Framework/EstateSettings.cs | 660 ++++++++++++++++----------------- OpenSim/Framework/IClientAPI.cs | 10 +- OpenSim/Framework/RegionBanListItem.cs | 47 --- OpenSim/Framework/RegionInfo.cs | 41 +- OpenSim/Framework/RegionSettings.cs | 13 +- 6 files changed, 388 insertions(+), 426 deletions(-) create mode 100644 OpenSim/Framework/EstateBan.cs delete mode 100644 OpenSim/Framework/RegionBanListItem.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/EstateBan.cs b/OpenSim/Framework/EstateBan.cs new file mode 100644 index 0000000..c213344 --- /dev/null +++ b/OpenSim/Framework/EstateBan.cs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using libsecondlife; +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSim.Framework +{ + public class EstateBan + { + public uint estateID = 1; + public LLUUID bannedUUID = LLUUID.Zero; + public string bannedIP = string.Empty; + public string bannedIPHostMask = string.Empty; + public string bannedNameMask = string.Empty; + } +} diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index 2865844..b48a1db 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs @@ -28,6 +28,7 @@ using System; using System.IO; using System.Reflection; +using System.Collections.Generic; using libsecondlife; using log4net; @@ -38,451 +39,440 @@ namespace OpenSim.Framework private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private ConfigurationMember configMember; - //Settings to this island - private float m_billableFactor; - - private uint m_estateID; - private LLUUID m_estateManager0; - private LLUUID m_estateManager1; - private LLUUID m_estateManager2; - private LLUUID m_estateManager3; - private LLUUID m_estateManager4; - private LLUUID m_estateManager5; - private LLUUID m_estateManager6; - private LLUUID m_estateManager7; - private LLUUID m_estateManager8; - private LLUUID m_estateManager9; - private string m_estateName; - - private uint m_parentEstateID; - private int m_pricePerMeter; - private int m_redirectGridX; - private int m_redirectGridY; + public delegate void SaveDelegate(EstateSettings rs); - public EstateSettings() + public event SaveDelegate OnSave; + + // Only the client uses these + // + private uint m_EstateID = 100; + + public uint EstateID { - // Temporary hack to prevent multiple loadings. - if (configMember == null) - { - configMember = - new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", - loadConfigurationOptions, handleIncomingConfiguration, true); - configMember.performConfigurationRetrieve(); - } + get { return m_EstateID; } + set { m_EstateID = value; } } - public float billableFactor + private string m_EstateName; + + public string EstateName { - get { return m_billableFactor; } - set - { - m_billableFactor = value; - configMember.forceSetConfigurationOption("billable_factor", m_billableFactor.ToString()); - } + get { return m_EstateName; } + set { m_EstateName = value; } } - public uint estateID + private uint m_ParentEstateID = 100; + + public uint ParentEstateID { - get { return m_estateID; } - set - { - m_estateID = value; - configMember.forceSetConfigurationOption("estate_id", m_estateID.ToString()); - } + get { return m_ParentEstateID; } + set { m_ParentEstateID = value; } } - public uint parentEstateID + private float m_BillableFactor; + + public float BillableFactor { - get { return m_parentEstateID; } - set - { - m_parentEstateID = value; - configMember.forceSetConfigurationOption("parent_estate_id", m_parentEstateID.ToString()); - } + get { return m_BillableFactor; } + set { m_BillableFactor = value; } } - public int redirectGridX + private int m_PricePerMeter; + + public int PricePerMeter { - get { return m_redirectGridX; } - set - { - m_redirectGridX = value; - configMember.forceSetConfigurationOption("redirect_grid_x", m_redirectGridX.ToString()); - } + get { return m_PricePerMeter; } + set { m_PricePerMeter = value; } } - public int redirectGridY + private int m_RedirectGridX; + + public int RedirectGridX { - get { return m_redirectGridY; } - set - { - m_redirectGridY = value; - configMember.forceSetConfigurationOption("redirect_grid_y", m_redirectGridY.ToString()); - } + get { return m_RedirectGridX; } + set { m_RedirectGridX = value; } } - public int pricePerMeter + private int m_RedirectGridY; + + public int RedirectGridY { - get { return m_pricePerMeter; } - set - { - m_pricePerMeter = value; - configMember.forceSetConfigurationOption("price_per_meter", m_pricePerMeter.ToString()); - } + get { return m_RedirectGridY; } + set { m_RedirectGridY = value; } } - // Estate name + // Used by the sim + // + private bool m_UseGlobalTime = true; - public string estateName + public bool UseGlobalTime { - get { return m_estateName; } - set - { - m_estateName = value; - configMember.forceSetConfigurationOption("estate_name", m_estateName.ToString()); - } + get { return m_UseGlobalTime; } + set { m_UseGlobalTime = value; } } - public LLUUID[] estateManagers + private bool m_FixedSun = false; + + public bool FixedSun { - get - { - // returns a condensed array of LLUUIDs - return GetEstateManagers(); - } - set - { - // Sets a Condensed array of LLUUIDS - int i = 0; - for (i = 0; i < value.Length; i++) - { - switch (i) - { - case 0: - m_estateManager0 = value[i]; - break; - case 1: - m_estateManager1 = value[i]; - break; - case 2: - m_estateManager2 = value[i]; - break; - case 3: - m_estateManager3 = value[i]; - break; - case 4: - m_estateManager4 = value[i]; - break; - case 5: - m_estateManager5 = value[i]; - break; - case 6: - m_estateManager6 = value[i]; - break; - case 7: - m_estateManager7 = value[i]; - break; - case 8: - m_estateManager8 = value[i]; - break; - case 9: - m_estateManager9 = value[i]; - break; - } - } - - // Clear the rest of them.. as they're no longer valid - for (int j = i; j < 10; j++) - { - switch (j) - { - case 0: - m_estateManager0 = LLUUID.Zero; - break; - case 1: - m_estateManager1 = LLUUID.Zero; - break; - case 2: - m_estateManager2 = LLUUID.Zero; - break; - case 3: - m_estateManager3 = LLUUID.Zero; - break; - case 4: - m_estateManager4 = LLUUID.Zero; - break; - case 5: - m_estateManager5 = LLUUID.Zero; - break; - case 6: - m_estateManager6 = LLUUID.Zero; - break; - case 7: - m_estateManager7 = LLUUID.Zero; - break; - case 8: - m_estateManager8 = LLUUID.Zero; - break; - case 9: - m_estateManager9 = LLUUID.Zero; - break; - } - } - - for (i = 0; i < 10; i++) - { - // Writes out the Estate managers to the XML file. - configMember.forceSetConfigurationOption("estate_manager_" + i, (GetEstateManagerAtPos(i)).ToString()); - } - } + get { return m_FixedSun; } + set { m_FixedSun = value; } } - #region EstateManager Get Methods to sort out skipped spots in the XML (suser error) + private double m_SunPosition = 0.0; - private LLUUID GetEstateManagerAtPos(int pos) + public double SunPosition { - // This is a helper for writing them out to the xml file - switch (pos) - { - case 0: - return m_estateManager0; + get { return m_SunPosition; } + set { m_SunPosition = value; } + } - case 1: - return m_estateManager1; + private bool m_AllowVoice = true; - case 2: - return m_estateManager2; + public bool AllowVoice + { + get { return m_AllowVoice; } + set { m_AllowVoice = value; } + } - case 3: - return m_estateManager3; + private bool m_AllowDirectTeleport = true; - case 4: - return m_estateManager4; + public bool AllowDirectTeleport + { + get { return m_AllowDirectTeleport; } + set { m_AllowDirectTeleport = value; } + } - case 5: - return m_estateManager5; + private bool m_DenyAnonymous = false; - case 6: - return m_estateManager6; + public bool DenyAnonymous + { + get { return m_DenyAnonymous; } + set { m_DenyAnonymous = value; } + } - case 7: - return m_estateManager7; + private bool m_DenyIdentified = false; - case 8: - return m_estateManager8; + public bool DenyIdentified + { + get { return m_DenyIdentified; } + set { m_DenyIdentified = value; } + } - case 9: - return m_estateManager9; + private bool m_DenyTransacted = false; - default: - return LLUUID.Zero; - } + public bool DenyTransacted + { + get { return m_DenyTransacted; } + set { m_DenyTransacted = value; } } - private LLUUID[] GetEstateManagers() + private bool m_AbuseEmailToEstateOwner = false; + + public bool AbuseEmailToEstateOwner { - int numEstateManagers = GetNumberOfEstateManagers(); - LLUUID[] rEstateManagers = new LLUUID[numEstateManagers]; + get { return m_AbuseEmailToEstateOwner; } + set { m_AbuseEmailToEstateOwner = value; } + } - int pos = 0; + private bool m_BlockDwell = false; - for (int i = 0; i < numEstateManagers; i++) - { - pos = GetNextEstateManager(pos); - - rEstateManagers[i] = GetEstateManagerAtPos(pos); - pos++; - } - return rEstateManagers; + public bool BlockDwell + { + get { return m_BlockDwell; } + set { m_BlockDwell = value; } } - private int GetNextEstateManager(int startpos) + private bool m_EstateSkipScripts = false; + + public bool EstateSkipScripts { - // This is a utility function that skips over estate managers set to LLUUID.Zero - int i = startpos; - for (i = startpos; i < 10; i++) - { - if (GetEstateManagerAtPos(i) != LLUUID.Zero) return i; - } - return i; + get { return m_EstateSkipScripts; } + set { m_EstateSkipScripts = value; } } - private int GetNumberOfEstateManagers() + private bool m_ResetHomeOnTeleport = false; + + public bool ResetHomeOnTeleport { - // This function returns the number of estate managers set - // Regardless of whether there is a skipped spot - int numEstateManagers = 0; - if (m_estateManager0 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager1 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager2 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager3 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager4 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager5 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager6 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager7 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager8 != LLUUID.Zero) numEstateManagers++; - if (m_estateManager9 != LLUUID.Zero) numEstateManagers++; + get { return m_ResetHomeOnTeleport; } + set { m_ResetHomeOnTeleport = value; } + } - return numEstateManagers; + private bool m_TaxFree = false; + + public bool TaxFree + { + get { return m_TaxFree; } + set { m_TaxFree = value; } } - public void AddEstateManager(LLUUID avatarID) + private bool m_PublicAccess = true; + + public bool PublicAccess { - LLUUID[] testateManagers = GetEstateManagers(); - LLUUID[] nestateManagers = new LLUUID[testateManagers.Length + 1]; + get { return m_PublicAccess; } + set { m_PublicAccess = value; } + } - int i = 0; - for (i = 0; i < testateManagers.Length; i++) - { - nestateManagers[i] = testateManagers[i]; - } + // All those lists... + // + private List l_EstateManagers = new List(); - nestateManagers[i] = avatarID; + public LLUUID[] EstateManagers + { + get { return l_EstateManagers.ToArray(); } + set { l_EstateManagers = new List(value); } + } - //Saves it to the estate settings file - estateManagers = nestateManagers; + private List l_EstateBans = new List(); + + public EstateBan[] EstateBans + { + get { return l_EstateBans.ToArray(); } + set { l_EstateBans = new List(value); } } - public void RemoveEstateManager(LLUUID avatarID) + private List l_EstateAccess = new List(); + + public LLUUID[] EstateAccess { - int notfoundparam = 11; // starting high so the condense routine (max ten) doesn't run if we don't find it. - LLUUID[] testateManagers = GetEstateManagers(); // temporary estate managers list + get { return l_EstateAccess.ToArray(); } + set { l_EstateAccess = new List(value); } + } + private List l_EstateGroups = new List(); - int i = 0; - int foundpos = notfoundparam; + public LLUUID[] EstateGroups + { + get { return l_EstateGroups.ToArray(); } + set { l_EstateGroups = new List(value); } + } - // search for estate manager. - for (i = 0; i < testateManagers.Length; i++) + public EstateSettings() + { + if (configMember == null) { - if (testateManagers[i] == avatarID) - { - foundpos = i; - break; - } + // Load legacy defaults + // + configMember = + new ConfigurationMember(Path.Combine(Util.configDir(), + "estate_settings.xml"), "ESTATE SETTINGS", + loadConfigurationOptions, + handleIncomingConfiguration, true); + + l_EstateManagers.Clear(); + configMember.performConfigurationRetrieve(); } - if (foundpos < notfoundparam) - { - LLUUID[] restateManagers = new LLUUID[testateManagers.Length - 1]; + } - // fill new estate managers array up to the found spot - for (int j = 0; j < foundpos; j++) - restateManagers[j] = testateManagers[j]; + public void Save() + { + if(OnSave != null) + OnSave(this); + } - // skip over the estate manager we're removing and compress - for (int j = foundpos + 1; j < testateManagers.Length; j++) - restateManagers[j - 1] = testateManagers[j]; + public void AddEstateManager(LLUUID avatarID) + { + if(avatarID == null || avatarID == LLUUID.Zero) + return; + if(!l_EstateManagers.Contains(avatarID)) + l_EstateManagers.Add(avatarID); + } - estateManagers = restateManagers; - } - else - { - m_log.Error("[ESTATESETTINGS]: Unable to locate estate manager : " + avatarID.ToString() + " for removal"); - } + public void RemoveEstateManager(LLUUID avatarID) + { + if(l_EstateManagers.Contains(avatarID)) + l_EstateManagers.Remove(avatarID); } - #endregion + public bool IsEstateManager(LLUUID avatarID) + { + return l_EstateManagers.Contains(avatarID); + } + + public bool IsBanned(LLUUID avatarID) + { + foreach (EstateBan ban in l_EstateBans) + if(ban.bannedUUID == avatarID) + return true; + return false; + } + + public void AddBan(EstateBan ban) + { + if(ban == null) + return; + if(!IsBanned(ban.bannedUUID)) + l_EstateBans.Add(ban); + } + + public void ClearBans() + { + l_EstateBans.Clear(); + } + + public void RemoveBan(LLUUID avatarID) + { + foreach (EstateBan ban in new List(l_EstateBans)) + if(ban.bannedUUID == avatarID) + l_EstateBans.Remove(ban); + } public void loadConfigurationOptions() { - configMember.addConfigurationOption("billable_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, - "0.0", true); - configMember.addConfigurationOption("estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty, "100", - true); - configMember.addConfigurationOption("parent_estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - String.Empty, "1", true); - configMember.addConfigurationOption("max_agents", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "40", - true); - - configMember.addConfigurationOption("redirect_grid_x", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, - "0", true); - configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, - "0", true); - configMember.addConfigurationOption("price_per_meter", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - String.Empty, "1", true); - - configMember.addConfigurationOption("water_height", ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, String.Empty, - "20.0", true); - - configMember.addConfigurationOption("estate_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - String.Empty, "TestEstate", true); - configMember.addConfigurationOption("estate_manager_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_4", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_5", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_6", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_7", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_8", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_9", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, - String.Empty, "00000000-0000-0000-0000-000000000000", true); + configMember.addConfigurationOption("billable_factor", + ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, + String.Empty, "0.0", true); + +// configMember.addConfigurationOption("estate_id", +// ConfigurationOption.ConfigurationTypes.TYPE_UINT32, +// String.Empty, "100", true); + +// configMember.addConfigurationOption("parent_estate_id", +// ConfigurationOption.ConfigurationTypes.TYPE_UINT32, +// String.Empty, "1", true); + + configMember.addConfigurationOption("redirect_grid_x", + ConfigurationOption.ConfigurationTypes.TYPE_INT32, + String.Empty, "0", true); + + configMember.addConfigurationOption("redirect_grid_y", + ConfigurationOption.ConfigurationTypes.TYPE_INT32, + String.Empty, "0", true); + + configMember.addConfigurationOption("price_per_meter", + ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + String.Empty, "1", true); + + configMember.addConfigurationOption("estate_name", + ConfigurationOption.ConfigurationTypes.TYPE_STRING, + String.Empty, "My Estate", true); + + configMember.addConfigurationOption("estate_manager_0", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_1", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_2", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_3", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_4", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_5", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_6", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_7", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_8", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("estate_manager_9", + ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + String.Empty, "00000000-0000-0000-0000-000000000000", true); + + configMember.addConfigurationOption("region_flags", + ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + String.Empty, "336723974", true); } public bool handleIncomingConfiguration(string configuration_key, object configuration_result) { switch (configuration_key) { - case "billable_factor": - m_billableFactor = (float) configuration_result; + case "region_flags": + Simulator.RegionFlags flags = (Simulator.RegionFlags)(uint)configuration_result; + if((flags & (Simulator.RegionFlags)(1<<29)) != 0) + m_AllowVoice = true; + if((flags & Simulator.RegionFlags.AllowDirectTeleport) != 0) + m_AllowDirectTeleport = true; + if((flags & Simulator.RegionFlags.DenyAnonymous) != 0) + m_DenyAnonymous = true; + if((flags & Simulator.RegionFlags.DenyIdentified) != 0) + m_DenyIdentified = true; + if((flags & Simulator.RegionFlags.DenyTransacted) != 0) + m_DenyTransacted = true; + if((flags & Simulator.RegionFlags.AbuseEmailToEstateOwner) != 0) + m_AbuseEmailToEstateOwner = true; + if((flags & Simulator.RegionFlags.BlockDwell) != 0) + m_BlockDwell = true; + if((flags & Simulator.RegionFlags.EstateSkipScripts) != 0) + m_EstateSkipScripts = true; + if((flags & Simulator.RegionFlags.ResetHomeOnTeleport) != 0) + m_ResetHomeOnTeleport = true; + if((flags & Simulator.RegionFlags.TaxFree) != 0) + m_TaxFree = true; + if((flags & Simulator.RegionFlags.PublicAllowed) != 0) + m_PublicAccess = true; break; - case "estate_id": - m_estateID = (uint) configuration_result; - break; - case "parent_estate_id": - m_parentEstateID = (uint) configuration_result; + case "billable_factor": + m_BillableFactor = (float) configuration_result; break; +// case "estate_id": +// m_EstateID = (uint) configuration_result; +// break; +// case "parent_estate_id": +// m_ParentEstateID = (uint) configuration_result; +// break; case "redirect_grid_x": - m_redirectGridX = (int) configuration_result; + m_RedirectGridX = (int) configuration_result; break; case "redirect_grid_y": - m_redirectGridY = (int) configuration_result; + m_RedirectGridY = (int) configuration_result; break; case "price_per_meter": - m_pricePerMeter = Convert.ToInt32(configuration_result); + m_PricePerMeter = Convert.ToInt32(configuration_result); break; - case "estate_name": - m_estateName = (string) configuration_result; + m_EstateName = (string) configuration_result; break; case "estate_manager_0": - m_estateManager0 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_1": - m_estateManager1 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_2": - m_estateManager2 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_3": - m_estateManager3 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_4": - m_estateManager4 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_5": - m_estateManager5 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_6": - m_estateManager6 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_7": - m_estateManager7 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_8": - m_estateManager8 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; case "estate_manager_9": - m_estateManager9 = (LLUUID) configuration_result; + AddEstateManager((LLUUID)configuration_result); break; } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index f34b9c4..bb44eb9 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -285,7 +285,8 @@ namespace OpenSim.Framework public delegate void SetEstateTerrainDetailTexture(IClientAPI remoteClient, int corner, LLUUID side); public delegate void SetEstateTerrainTextureHeights(IClientAPI remoteClient, int corner, float lowVal, float highVal); public delegate void CommitEstateTerrainTextureRequest(IClientAPI remoteClient); - public delegate void SetRegionTerrainSettings(float waterHeight, float terrainRaiseLimit, float terrainLowerLimit, bool fixedSun, float sunHour); + public delegate void SetRegionTerrainSettings(float waterHeight, float terrainRaiseLimit, float terrainLowerLimit, bool estateSun, bool fixedSun, float sunHour, bool globalSun, bool estateFixed, float estateSunHour); + public delegate void EstateChangeInfo(IClientAPI client, LLUUID invoice, LLUUID senderID, UInt32 param1, UInt32 param2); public delegate void BakeTerrain(IClientAPI remoteClient ); public delegate void EstateRestartSimRequest(IClientAPI remoteClient, int secondsTilReboot); public delegate void EstateChangeCovenantRequest(IClientAPI remoteClient, LLUUID newCovenantID); @@ -349,6 +350,7 @@ namespace OpenSim.Framework // [Obsolete("LLClientView Specific - Replace with more suitable arguments.")] event ModifyTerrain OnModifyTerrain; event BakeTerrain OnBakeTerrain; + event EstateChangeInfo OnEstateChangeInfo; // [Obsolete("LLClientView Specific.")] event SetAppearance OnSetAppearance; // [Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")] @@ -628,11 +630,11 @@ namespace OpenSim.Framework void SendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID); - void SendBannedUserList(LLUUID invoice, List banlist, uint estateID); + void SendBannedUserList(LLUUID invoice, EstateBan[] banlist, uint estateID); void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args); - void SendEstateCovenantInformation(); - void SendDetailedEstateData(LLUUID invoice,string estateName, uint estateID); + void SendEstateCovenantInformation(LLUUID covenant); + void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant); void SendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags); void SendLandAccessListData(List avatars, uint accessFlag, int localLandID); diff --git a/OpenSim/Framework/RegionBanListItem.cs b/OpenSim/Framework/RegionBanListItem.cs deleted file mode 100644 index edf6a22..0000000 --- a/OpenSim/Framework/RegionBanListItem.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSim Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using libsecondlife; -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework -{ - public class RegionBanListItem - { - public LLUUID regionUUID = LLUUID.Zero; - public LLUUID bannedUUID = LLUUID.Zero; - public string bannedIP = string.Empty; - public string bannedIPHostMask = string.Empty; - - public RegionBanListItem() - { - - } - } -} diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index e899947..ee64bf2 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -193,7 +193,6 @@ namespace OpenSim.Framework public bool commFailTF = false; public ConfigurationMember configMember; - public LLUUID CovenantID = LLUUID.Zero; public string DataStore = String.Empty; public bool isSandbox = false; private EstateSettings m_estateSettings; @@ -212,7 +211,6 @@ namespace OpenSim.Framework public LLUUID lastMapUUID = LLUUID.Zero; public string lastMapRefresh = "0"; - public List regionBanlist = new List(); // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. @@ -279,6 +277,8 @@ namespace OpenSim.Framework return m_estateSettings; } + + set { m_estateSettings = value; } } public RegionSettings RegionSettings @@ -364,28 +364,6 @@ namespace OpenSim.Framework configMember.performConfigurationRetrieve(); } - public bool CheckIfUserBanned(LLUUID user) - { - - RegionBanListItem[] bl = regionBanlist.ToArray(); - - bool banned = false; - - for (int i = 0; i < bl.Length; i++) - { - if (bl[i] == null) - continue; - - if (bl[i].bannedUUID == user) - { - banned = true; - break; - } - } - - return banned; - } - public void loadConfigurationOptionsFromMe() { configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID_NULL_FREE, @@ -415,9 +393,6 @@ namespace OpenSim.Framework "External Host Name", m_externalHostName, true); configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Master Avatar UUID", MasterAvatarAssignedUUID.ToString(), true); - configMember.addConfigurationOption("estate_covanant_uuid", - ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Estate Covenant", - CovenantID.ToString(), true); configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", MasterAvatarFirstName, true); @@ -461,9 +436,6 @@ namespace OpenSim.Framework "External Host Name", "127.0.0.1", false); configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Master Avatar UUID", LLUUID.Zero.ToString(), true); - configMember.addConfigurationOption("estate_covanant_uuid", - ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Estate Covenant", - LLUUID.Zero.ToString(), true); configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false, @@ -538,10 +510,6 @@ namespace OpenSim.Framework case "master_avatar_uuid": MasterAvatarAssignedUUID = (LLUUID) configuration_result; break; - case "estate_covanant_uuid": - CovenantID = (LLUUID) configuration_result; - break; - case "master_avatar_first": MasterAvatarFirstName = (string) configuration_result; break; @@ -563,11 +531,6 @@ namespace OpenSim.Framework return true; } - public void SaveEstatecovenantUUID(LLUUID notecard) - { - if (null == configMember) return; - configMember.forceSetConfigurationOption("estate_covanant_uuid", notecard.ToString()); - } public void SaveLastMapUUID(LLUUID mapUUID) { if (null == configMember) return; diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index be57c1b..13fabaf 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs @@ -162,6 +162,8 @@ namespace OpenSim.Framework (flags & Simulator.RegionFlags.SkipPhysics) != 0; m_FixedSun = (flags & Simulator.RegionFlags.SunFixed) != 0; + m_Sandbox = + (flags & Simulator.RegionFlags.Sandbox) != 0; break; case "max_agents": m_AgentLimit = (int)value; @@ -231,7 +233,8 @@ namespace OpenSim.Framework public void Save() { - OnSave(this); + if(OnSave != null) + OnSave(this); } private LLUUID m_RegionUUID = LLUUID.Zero; @@ -474,6 +477,14 @@ namespace OpenSim.Framework set { m_UseEstateSun = value; } } + private bool m_Sandbox = false; + + public bool Sandbox + { + get { return m_Sandbox; } + set { m_Sandbox = value; } + } + private LLVector3 m_SunVector; public LLVector3 SunVector -- cgit v1.1