aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2008-07-18 02:40:47 +0000
committerMelanie Thielker2008-07-18 02:40:47 +0000
commit263633e274082135b21b8183b92280b768d18883 (patch)
treef6104eef3633a8b454a4e8ac09d15182970c6bae
parentadded region port number to output of "show regions" command (diff)
downloadopensim-SC-263633e274082135b21b8183b92280b768d18883.zip
opensim-SC-263633e274082135b21b8183b92280b768d18883.tar.gz
opensim-SC-263633e274082135b21b8183b92280b768d18883.tar.bz2
opensim-SC-263633e274082135b21b8183b92280b768d18883.tar.xz
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.
-rw-r--r--OpenSim/Data/MSSQL/MSSQLDataStore.cs8
-rw-r--r--OpenSim/Data/MySQL/MySQLDataStore.cs143
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs386
-rw-r--r--OpenSim/Data/MySQL/Resources/013_RegionStore.sql103
-rw-r--r--OpenSim/Data/NHibernate/NHibernateRegionData.cs8
-rw-r--r--OpenSim/Data/Null/NullDataStore.cs16
-rw-r--r--OpenSim/Data/SQLite/Resources/006_RegionStore.sql92
-rw-r--r--OpenSim/Data/SQLite/SQLiteEstateData.cs333
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs114
-rw-r--r--OpenSim/Framework/EstateBan.cs (renamed from OpenSim/Framework/RegionBanListItem.cs)10
-rw-r--r--OpenSim/Framework/EstateSettings.cs660
-rw-r--r--OpenSim/Framework/IClientAPI.cs10
-rw-r--r--OpenSim/Framework/RegionInfo.cs41
-rw-r--r--OpenSim/Framework/RegionSettings.cs13
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs1
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs64
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs4
-rw-r--r--OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs41
-rw-r--r--OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs234
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs7
-rw-r--r--OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs25
-rw-r--r--OpenSim/Region/Environment/StorageManager.cs18
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs7
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs17
27 files changed, 1568 insertions, 809 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLDataStore.cs b/OpenSim/Data/MSSQL/MSSQLDataStore.cs
index 46e4107..c7d034f 100644
--- a/OpenSim/Data/MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Data/MSSQL/MSSQLDataStore.cs
@@ -548,9 +548,9 @@ namespace OpenSim.Data.MSSQL
548 /// </summary> 548 /// </summary>
549 /// <param name="regionUUID">the region UUID</param> 549 /// <param name="regionUUID">the region UUID</param>
550 /// <returns>the banlist list</returns> 550 /// <returns>the banlist list</returns>
551 public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID) 551 public List<EstateBan> LoadRegionBanList(LLUUID regionUUID)
552 { 552 {
553 List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>(); 553 List<EstateBan> regionbanlist = new List<EstateBan>();
554 return regionbanlist; 554 return regionbanlist;
555 } 555 }
556 556
@@ -558,7 +558,7 @@ namespace OpenSim.Data.MSSQL
558 /// STUB, add an item into region banlist 558 /// STUB, add an item into region banlist
559 /// </summary> 559 /// </summary>
560 /// <param name="item">the item</param> 560 /// <param name="item">the item</param>
561 public void AddToRegionBanlist(RegionBanListItem item) 561 public void AddToRegionBanlist(EstateBan item)
562 { 562 {
563 563
564 } 564 }
@@ -567,7 +567,7 @@ namespace OpenSim.Data.MSSQL
567 /// STUB, remove an item from region banlist 567 /// STUB, remove an item from region banlist
568 /// </summary> 568 /// </summary>
569 /// <param name="item"></param> 569 /// <param name="item"></param>
570 public void RemoveFromRegionBanlist(RegionBanListItem item) 570 public void RemoveFromRegionBanlist(EstateBan item)
571 { 571 {
572 572
573 } 573 }
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index 254e526..25956d5 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -53,7 +53,6 @@ namespace OpenSim.Data.MySQL
53 private const string m_terrainSelect = "select * from terrain limit 1"; 53 private const string m_terrainSelect = "select * from terrain limit 1";
54 private const string m_landSelect = "select * from land"; 54 private const string m_landSelect = "select * from land";
55 private const string m_landAccessListSelect = "select * from landaccesslist"; 55 private const string m_landAccessListSelect = "select * from landaccesslist";
56 private const string m_regionBanListSelect = "select * from regionban";
57 private const string m_regionSettingsSelect = "select * from regionsettings"; 56 private const string m_regionSettingsSelect = "select * from regionsettings";
58 private const string m_waitTimeoutSelect = "select @@wait_timeout"; 57 private const string m_waitTimeoutSelect = "select @@wait_timeout";
59 58
@@ -83,7 +82,6 @@ namespace OpenSim.Data.MySQL
83 private MySqlDataAdapter m_terrainDataAdapter; 82 private MySqlDataAdapter m_terrainDataAdapter;
84 private MySqlDataAdapter m_landDataAdapter; 83 private MySqlDataAdapter m_landDataAdapter;
85 private MySqlDataAdapter m_landAccessListDataAdapter; 84 private MySqlDataAdapter m_landAccessListDataAdapter;
86 private MySqlDataAdapter m_regionBanListDataAdapter;
87 private MySqlDataAdapter m_regionSettingsDataAdapter; 85 private MySqlDataAdapter m_regionSettingsDataAdapter;
88 86
89 private DataTable m_primTable; 87 private DataTable m_primTable;
@@ -92,7 +90,6 @@ namespace OpenSim.Data.MySQL
92 private DataTable m_terrainTable; 90 private DataTable m_terrainTable;
93 private DataTable m_landTable; 91 private DataTable m_landTable;
94 private DataTable m_landAccessListTable; 92 private DataTable m_landAccessListTable;
95 private DataTable m_regionBanListTable;
96 private DataTable m_regionSettingsTable; 93 private DataTable m_regionSettingsTable;
97 94
98 /// <value>Temporary attribute while this is experimental</value> 95 /// <value>Temporary attribute while this is experimental</value>
@@ -150,9 +147,6 @@ namespace OpenSim.Data.MySQL
150 MySqlCommand landAccessListSelectCmd = new MySqlCommand(m_landAccessListSelect, m_connection); 147 MySqlCommand landAccessListSelectCmd = new MySqlCommand(m_landAccessListSelect, m_connection);
151 m_landAccessListDataAdapter = new MySqlDataAdapter(landAccessListSelectCmd); 148 m_landAccessListDataAdapter = new MySqlDataAdapter(landAccessListSelectCmd);
152 149
153 MySqlCommand regionBanListSelectCmd = new MySqlCommand(m_regionBanListSelect, m_connection);
154 m_regionBanListDataAdapter = new MySqlDataAdapter(regionBanListSelectCmd);
155
156 MySqlCommand regionSettingsSelectCmd = new MySqlCommand(m_regionSettingsSelect, m_connection); 150 MySqlCommand regionSettingsSelectCmd = new MySqlCommand(m_regionSettingsSelect, m_connection);
157 m_regionSettingsDataAdapter = new MySqlDataAdapter(regionSettingsSelectCmd); 151 m_regionSettingsDataAdapter = new MySqlDataAdapter(regionSettingsSelectCmd);
158 152
@@ -192,11 +186,6 @@ namespace OpenSim.Data.MySQL
192 setupLandAccessCommands(m_landAccessListDataAdapter, m_connection); 186 setupLandAccessCommands(m_landAccessListDataAdapter, m_connection);
193 m_landAccessListDataAdapter.Fill(m_landAccessListTable); 187 m_landAccessListDataAdapter.Fill(m_landAccessListTable);
194 188
195 m_regionBanListTable = createRegionBanTable();
196 m_dataSet.Tables.Add(m_regionBanListTable);
197 SetupRegionBanCommands(m_regionBanListDataAdapter, m_connection);
198 m_regionBanListDataAdapter.Fill(m_regionBanListTable);
199
200 m_regionSettingsTable = createRegionSettingsTable(); 189 m_regionSettingsTable = createRegionSettingsTable();
201 m_dataSet.Tables.Add(m_regionSettingsTable); 190 m_dataSet.Tables.Add(m_regionSettingsTable);
202 SetupRegionSettingsCommands(m_regionSettingsDataAdapter, m_connection); 191 SetupRegionSettingsCommands(m_regionSettingsDataAdapter, m_connection);
@@ -774,99 +763,6 @@ namespace OpenSim.Data.MySQL
774 } 763 }
775 764
776 /// <summary> 765 /// <summary>
777 /// Load (fetch?) a region banlist
778 /// </summary>
779 /// <param name="regionUUID">The region UUID</param>
780 /// <returns>The Region banlist</returns>
781 public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID)
782 {
783 List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>();
784 lock (m_dataSet)
785 {
786 CheckConnection();
787 DataTable regionban = m_regionBanListTable;
788 string searchExp = "regionUUID = '" + regionUUID.ToString() + "'";
789 DataRow[] rawbanlist = regionban.Select(searchExp);
790 foreach (DataRow rawbanrow in rawbanlist)
791 {
792 RegionBanListItem rbli = new RegionBanListItem();
793 LLUUID tmpvalue = LLUUID.Zero;
794
795 rbli.regionUUID = regionUUID;
796
797 if (Helpers.TryParse((string)rawbanrow["bannedUUID"], out tmpvalue))
798 rbli.bannedUUID = tmpvalue;
799
800 rbli.bannedIP = (string)rawbanrow["bannedIp"];
801 rbli.bannedIPHostMask = (string)rawbanrow["bannedIpHostMask"];
802 regionbanlist.Add(rbli);
803 }
804 return regionbanlist;
805 }
806 }
807
808 /// <summary>
809 /// Add an item to region banlist
810 /// </summary>
811 /// <param name="item">The item</param>
812 public void AddToRegionBanlist(RegionBanListItem item)
813 {
814 lock (m_dataSet)
815 {
816 CheckConnection();
817 DataTable regionban = m_regionBanListTable;
818 string searchExp = "regionUUID = '" + item.regionUUID.ToString() + "' AND bannedUUID = '" + item.bannedUUID.ToString() + "'";
819 DataRow[] rawbanlist = regionban.Select(searchExp);
820 if (rawbanlist.Length == 0)
821 {
822 DataRow regionbanrow = regionban.NewRow();
823 regionbanrow["regionUUID"] = item.regionUUID.ToString();
824 regionbanrow["bannedUUID"] = item.bannedUUID.ToString();
825 regionbanrow["bannedIp"] = item.bannedIP.ToString();
826 regionbanrow["bannedIpHostMask"] = item.bannedIPHostMask.ToString();
827 regionban.Rows.Add(regionbanrow);
828 }
829 Commit();
830 }
831 }
832
833 /// <summary>
834 /// Remove an item from region banlist
835 /// </summary>
836 /// <param name="item">The item</param>
837 public void RemoveFromRegionBanlist(RegionBanListItem item)
838 {
839 lock (m_dataSet)
840 {
841 CheckConnection();
842 DataTable regionban = m_regionBanListTable;
843 string searchExp = "regionUUID = '" + item.regionUUID.ToString() + "' AND bannedUUID = '" + item.bannedUUID.ToString() + "'";
844 DataRow[] rawbanlist = regionban.Select(searchExp);
845 if (rawbanlist.Length > 0)
846 {
847 foreach (DataRow rbli in rawbanlist)
848 {
849 regionban.Rows.Remove(rbli);
850 }
851 }
852 Commit();
853 }
854
855 using
856 (
857 MySqlCommand cmd =
858 new MySqlCommand("delete from regionban where regionUUID = ?regionUUID AND bannedUUID = ?bannedUUID", m_connection)
859 )
860 {
861 cmd.Parameters.Add(new MySqlParameter("?regionUUID", item.regionUUID.ToString()));
862 cmd.Parameters.Add(new MySqlParameter("?bannedUUID", item.bannedUUID.ToString()));
863 CheckConnection();
864 cmd.ExecuteNonQuery();
865 }
866
867 }
868
869 /// <summary>
870 /// 766 ///
871 /// </summary> 767 /// </summary>
872 /// <param name="regionUUID"></param> 768 /// <param name="regionUUID"></param>
@@ -918,7 +814,6 @@ namespace OpenSim.Data.MySQL
918 m_terrainDataAdapter.Update(m_terrainTable); 814 m_terrainDataAdapter.Update(m_terrainTable);
919 m_landDataAdapter.Update(m_landTable); 815 m_landDataAdapter.Update(m_landTable);
920 m_landAccessListDataAdapter.Update(m_landAccessListTable); 816 m_landAccessListDataAdapter.Update(m_landAccessListTable);
921 m_regionBanListDataAdapter.Update(m_regionBanListTable);
922 m_regionSettingsDataAdapter.Update(m_regionSettingsTable); 817 m_regionSettingsDataAdapter.Update(m_regionSettingsTable);
923 818
924 m_dataSet.AcceptChanges(); 819 m_dataSet.AcceptChanges();
@@ -1006,6 +901,7 @@ namespace OpenSim.Data.MySQL
1006 createCol(regionsettings, "terrain_raise_limit", typeof (Double)); 901 createCol(regionsettings, "terrain_raise_limit", typeof (Double));
1007 createCol(regionsettings, "terrain_lower_limit", typeof (Double)); 902 createCol(regionsettings, "terrain_lower_limit", typeof (Double));
1008 createCol(regionsettings, "use_estate_sun", typeof (Int32)); 903 createCol(regionsettings, "use_estate_sun", typeof (Int32));
904 createCol(regionsettings, "sandbox", typeof (Int32));
1009 createCol(regionsettings, "fixed_sun", typeof (Int32)); 905 createCol(regionsettings, "fixed_sun", typeof (Int32));
1010 createCol(regionsettings, "sun_position", typeof (Double)); 906 createCol(regionsettings, "sun_position", typeof (Double));
1011 createCol(regionsettings, "covenant", typeof(String)); 907 createCol(regionsettings, "covenant", typeof(String));
@@ -1016,21 +912,6 @@ namespace OpenSim.Data.MySQL
1016 } 912 }
1017 913
1018 /// <summary> 914 /// <summary>
1019 /// Create the "regionban" table
1020 /// </summary>
1021 /// <returns></returns>
1022 private static DataTable createRegionBanTable()
1023 {
1024 DataTable regionban = new DataTable("regionban");
1025 createCol(regionban, "regionUUID", typeof(String));
1026 createCol(regionban, "bannedUUID", typeof(String));
1027 createCol(regionban, "bannedIp", typeof(String));
1028 createCol(regionban, "bannedIpHostMask", typeof(String));
1029 return regionban;
1030
1031 }
1032
1033 /// <summary>
1034 /// Create the "prims" table 915 /// Create the "prims" table
1035 /// </summary> 916 /// </summary>
1036 /// <returns></returns> 917 /// <returns></returns>
@@ -1417,6 +1298,7 @@ namespace OpenSim.Data.MySQL
1417 newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]); 1298 newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
1418 newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]); 1299 newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
1419 newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]); 1300 newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
1301 newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
1420 newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); 1302 newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
1421 newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); 1303 newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
1422 newSettings.Covenant = new LLUUID((String) row["covenant"]); 1304 newSettings.Covenant = new LLUUID((String) row["covenant"]);
@@ -1676,6 +1558,7 @@ namespace OpenSim.Data.MySQL
1676 row["terrain_raise_limit"] = settings.TerrainRaiseLimit; 1558 row["terrain_raise_limit"] = settings.TerrainRaiseLimit;
1677 row["terrain_lower_limit"] = settings.TerrainLowerLimit; 1559 row["terrain_lower_limit"] = settings.TerrainLowerLimit;
1678 row["use_estate_sun"] = settings.UseEstateSun; 1560 row["use_estate_sun"] = settings.UseEstateSun;
1561 row["sandbox"] = settings.Sandbox;
1679 row["fixed_sun"] = settings.FixedSun; 1562 row["fixed_sun"] = settings.FixedSun;
1680 row["sun_position"] = settings.SunPosition; 1563 row["sun_position"] = settings.SunPosition;
1681 row["covenant"] = settings.Covenant.ToString(); 1564 row["covenant"] = settings.Covenant.ToString();
@@ -2143,26 +2026,6 @@ namespace OpenSim.Data.MySQL
2143 /// </summary> 2026 /// </summary>
2144 /// <param name="da"></param> 2027 /// <param name="da"></param>
2145 /// <param name="conn"></param> 2028 /// <param name="conn"></param>
2146 private void SetupRegionBanCommands(MySqlDataAdapter da, MySqlConnection conn)
2147 {
2148 da.InsertCommand = createInsertCommand("regionban", m_regionBanListTable);
2149 da.InsertCommand.Connection = conn;
2150
2151 da.UpdateCommand = createUpdateCommand("regionban", "regionUUID = ?regionUUID AND bannedUUID = ?bannedUUID", m_regionBanListTable);
2152 da.UpdateCommand.Connection = conn;
2153
2154 MySqlCommand delete = new MySqlCommand("delete from regionban where regionUUID = ?regionUUID AND bannedUUID = ?bannedUUID");
2155 delete.Parameters.Add(createMySqlParameter("regionUUID", typeof(String)));
2156 delete.Parameters.Add(createMySqlParameter("bannedUUID", typeof(String)));
2157 delete.Connection = conn;
2158 da.DeleteCommand = delete;
2159 }
2160
2161 /// <summary>
2162 ///
2163 /// </summary>
2164 /// <param name="da"></param>
2165 /// <param name="conn"></param>
2166 private void SetupTerrainCommands(MySqlDataAdapter da, MySqlConnection conn) 2029 private void SetupTerrainCommands(MySqlDataAdapter da, MySqlConnection conn)
2167 { 2030 {
2168 da.InsertCommand = createInsertCommand("terrain", m_dataSet.Tables["terrain"]); 2031 da.InsertCommand = createInsertCommand("terrain", m_dataSet.Tables["terrain"]);
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
new file mode 100644
index 0000000..eeff31b
--- /dev/null
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -0,0 +1,386 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Data;
31using System.IO;
32using System.Reflection;
33using System.Threading;
34using libsecondlife;
35using log4net;
36using MySql.Data.MySqlClient;
37using OpenSim.Framework;
38using OpenSim.Region.Environment.Interfaces;
39using OpenSim.Region.Environment.Scenes;
40
41namespace OpenSim.Data.MySQL
42{
43 public class MySQLEstateStore : IEstateDataStore
44 {
45 private static readonly ILog m_log =
46 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
48 private const string m_waitTimeoutSelect = "select @@wait_timeout";
49
50 private MySqlConnection m_connection;
51 private string m_connectionString;
52 private long m_waitTimeout;
53 private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond;
54 private long m_lastConnectionUse;
55
56 private FieldInfo[] m_Fields;
57 private Dictionary<string, FieldInfo> m_FieldMap =
58 new Dictionary<string, FieldInfo>();
59
60 public void Initialise(string connectionString)
61 {
62 m_connectionString = connectionString;
63
64 m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString);
65
66 m_connection = new MySqlConnection(m_connectionString);
67 m_connection.Open();
68
69 GetWaitTimeout();
70
71 Assembly assem = GetType().Assembly;
72 Migration m = new Migration(m_connection, assem, "EstateStore");
73 m.Update();
74
75 Type t = typeof(EstateSettings);
76 m_Fields = t.GetFields(BindingFlags.NonPublic |
77 BindingFlags.Instance |
78 BindingFlags.DeclaredOnly);
79
80 foreach (FieldInfo f in m_Fields)
81 if(f.Name.Substring(0, 2) == "m_")
82 m_FieldMap[f.Name.Substring(2)] = f;
83 }
84
85 private string[] FieldList
86 {
87 get { return new List<string>(m_FieldMap.Keys).ToArray(); }
88 }
89
90 protected void GetWaitTimeout()
91 {
92 MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect,
93 m_connection);
94
95 using (MySqlDataReader dbReader =
96 cmd.ExecuteReader(CommandBehavior.SingleRow))
97 {
98 if (dbReader.Read())
99 {
100 m_waitTimeout
101 = Convert.ToInt32(dbReader["@@wait_timeout"]) *
102 TimeSpan.TicksPerSecond + m_waitTimeoutLeeway;
103 }
104
105 dbReader.Close();
106 cmd.Dispose();
107 }
108
109 m_lastConnectionUse = System.DateTime.Now.Ticks;
110
111 m_log.DebugFormat(
112 "[REGION DB]: Connection wait timeout {0} seconds",
113 m_waitTimeout / TimeSpan.TicksPerSecond);
114 }
115
116 protected void CheckConnection()
117 {
118 long timeNow = System.DateTime.Now.Ticks;
119 if (timeNow - m_lastConnectionUse > m_waitTimeout ||
120 m_connection.State != ConnectionState.Open)
121 {
122 m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting");
123
124 lock (m_connection)
125 {
126 m_connection.Close();
127 m_connection = new MySqlConnection(m_connectionString);
128 m_connection.Open();
129 }
130 }
131
132 m_lastConnectionUse = timeNow;
133 }
134
135 public EstateSettings LoadEstateSettings(LLUUID regionID)
136 {
137 EstateSettings es = new EstateSettings();
138
139 string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = ?RegionID";
140
141 CheckConnection();
142
143 MySqlCommand cmd = m_connection.CreateCommand();
144
145 cmd.CommandText = sql;
146 cmd.Parameters.Add("?RegionID", regionID.ToString());
147
148 IDataReader r = cmd.ExecuteReader();
149
150 if(r.Read())
151 {
152 foreach (string name in FieldList)
153 {
154 if(m_FieldMap[name].GetValue(es) is bool)
155 {
156 int v = Convert.ToInt32(r[name]);
157 if(v != 0)
158 m_FieldMap[name].SetValue(es, true);
159 else
160 m_FieldMap[name].SetValue(es, false);
161 }
162 else
163 {
164 m_FieldMap[name].SetValue(es, r[name]);
165 }
166 }
167 r.Close();
168 }
169 else
170 {
171 // Migration case
172 //
173 r.Close();
174
175 List<string> names = new List<string>(FieldList);
176
177 names.Remove("EstateID");
178
179 sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( ?"+String.Join(", ?", names.ToArray())+")";
180
181 cmd.CommandText = sql;
182 cmd.Parameters.Clear();
183
184 foreach (string name in FieldList)
185 {
186 if(m_FieldMap[name].GetValue(es) is bool)
187 {
188 if((bool)m_FieldMap[name].GetValue(es))
189 cmd.Parameters.Add("?"+name, "1");
190 else
191 cmd.Parameters.Add("?"+name, "0");
192 }
193 else
194 {
195 cmd.Parameters.Add("?"+name, m_FieldMap[name].GetValue(es).ToString());
196 }
197 }
198
199 cmd.ExecuteNonQuery();
200
201 cmd.CommandText = "select LAST_INSERT_ID() as id";
202 cmd.Parameters.Clear();
203
204 r = cmd.ExecuteReader();
205
206 r.Read();
207
208 es.EstateID = Convert.ToUInt32(r["id"]);
209
210 r.Close();
211
212 cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
213 cmd.Parameters.Add("?RegionID", regionID.ToString());
214 cmd.Parameters.Add("?EstateID", es.EstateID.ToString());
215
216 // This will throw on dupe key
217 try
218 {
219 cmd.ExecuteNonQuery();
220 }
221 catch (Exception)
222 {
223 }
224
225 // Munge and transfer the ban list
226 //
227 cmd.Parameters.Clear();
228 cmd.CommandText = "insert into estateban select "+es.EstateID.ToString()+", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = ?UUID";
229 cmd.Parameters.Add("?UUID", regionID.ToString());
230
231 try
232 {
233 cmd.ExecuteNonQuery();
234 }
235 catch (Exception)
236 {
237 }
238 }
239
240 LoadBanList(es);
241
242 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
243 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
244 es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
245 return es;
246 }
247
248 public void StoreEstateSettings(EstateSettings es)
249 {
250 string sql = "replace into estate_settings ("+String.Join(",", FieldList)+") values ( ?"+String.Join(", ?", FieldList)+")";
251
252 CheckConnection();
253
254 MySqlCommand cmd = m_connection.CreateCommand();
255
256 cmd.CommandText = sql;
257
258 foreach (string name in FieldList)
259 {
260 if(m_FieldMap[name].GetValue(es) is bool)
261 {
262 if((bool)m_FieldMap[name].GetValue(es))
263 cmd.Parameters.Add("?"+name, "1");
264 else
265 cmd.Parameters.Add("?"+name, "0");
266 }
267 else
268 {
269 cmd.Parameters.Add("?"+name, m_FieldMap[name].GetValue(es).ToString());
270 }
271 }
272
273 cmd.ExecuteNonQuery();
274
275 SaveBanList(es);
276 SaveUUIDList(es.EstateID, "estate_managers", es.EstateManagers);
277 SaveUUIDList(es.EstateID, "estate_users", es.EstateAccess);
278 SaveUUIDList(es.EstateID, "estate_groups", es.EstateGroups);
279 }
280
281 private void LoadBanList(EstateSettings es)
282 {
283 es.ClearBans();
284
285 CheckConnection();
286
287 MySqlCommand cmd = m_connection.CreateCommand();
288
289 cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID";
290 cmd.Parameters.Add("?EstateID", es.EstateID);
291
292 IDataReader r = cmd.ExecuteReader();
293
294 while(r.Read())
295 {
296 EstateBan eb = new EstateBan();
297
298 LLUUID uuid = new LLUUID();
299 LLUUID.TryParse(r["bannedUUID"].ToString(), out uuid);
300
301 eb.bannedUUID = uuid;
302 eb.bannedIP = "0.0.0.0";
303 eb.bannedIPHostMask = "0.0.0.0";
304 es.AddBan(eb);
305 }
306 r.Close();
307 }
308
309 private void SaveBanList(EstateSettings es)
310 {
311 CheckConnection();
312
313 MySqlCommand cmd = m_connection.CreateCommand();
314
315 cmd.CommandText = "delete from estateban where EstateID = ?EstateID";
316 cmd.Parameters.Add("?EstateID", es.EstateID.ToString());
317
318 cmd.ExecuteNonQuery();
319
320 cmd.Parameters.Clear();
321
322 cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )";
323
324 foreach(EstateBan b in es.EstateBans)
325 {
326 cmd.Parameters.Add("?EstateID", es.EstateID.ToString());
327 cmd.Parameters.Add("?bannedUUID", b.bannedUUID.ToString());
328
329 cmd.ExecuteNonQuery();
330 cmd.Parameters.Clear();
331 }
332 }
333
334 void SaveUUIDList(uint EstateID, string table, LLUUID[] data)
335 {
336 CheckConnection();
337
338 MySqlCommand cmd = m_connection.CreateCommand();
339
340 cmd.CommandText = "delete from "+table+" where EstateID = ?EstateID";
341 cmd.Parameters.Add("?EstateID", EstateID.ToString());
342
343 cmd.ExecuteNonQuery();
344
345 cmd.Parameters.Clear();
346
347 cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )";
348
349 foreach(LLUUID uuid in data)
350 {
351 cmd.Parameters.Add("?EstateID", EstateID.ToString());
352 cmd.Parameters.Add("?uuid", uuid.ToString());
353
354 cmd.ExecuteNonQuery();
355 cmd.Parameters.Clear();
356 }
357 }
358
359 LLUUID[] LoadUUIDList(uint EstateID, string table)
360 {
361 List<LLUUID> uuids = new List<LLUUID>();
362
363 CheckConnection();
364
365 MySqlCommand cmd = m_connection.CreateCommand();
366
367 cmd.CommandText = "select uuid from "+table+" where EstateID = ?EstateID";
368 cmd.Parameters.Add("?EstateID", EstateID);
369
370 IDataReader r = cmd.ExecuteReader();
371
372 while(r.Read())
373 {
374 EstateBan eb = new EstateBan();
375
376 LLUUID uuid = new LLUUID();
377 LLUUID.TryParse(r["uuid"].ToString(), out uuid);
378
379 uuids.Add(uuid);
380 }
381 r.Close();
382
383 return uuids.ToArray();
384 }
385 }
386}
diff --git a/OpenSim/Data/MySQL/Resources/013_RegionStore.sql b/OpenSim/Data/MySQL/Resources/013_RegionStore.sql
new file mode 100644
index 0000000..a6bd30d
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/013_RegionStore.sql
@@ -0,0 +1,103 @@
1begin;
2
3drop table regionsettings;
4
5CREATE TABLE `regionsettings` (
6 `regionUUID` char(36) NOT NULL,
7 `block_terraform` int(11) NOT NULL,
8 `block_fly` int(11) NOT NULL,
9 `allow_damage` int(11) NOT NULL,
10 `restrict_pushing` int(11) NOT NULL,
11 `allow_land_resell` int(11) NOT NULL,
12 `allow_land_join_divide` int(11) NOT NULL,
13 `block_show_in_search` int(11) NOT NULL,
14 `agent_limit` int(11) NOT NULL,
15 `object_bonus` float NOT NULL,
16 `maturity` int(11) NOT NULL,
17 `disable_scripts` int(11) NOT NULL,
18 `disable_collisions` int(11) NOT NULL,
19 `disable_physics` int(11) NOT NULL,
20 `terrain_texture_1` char(36) NOT NULL,
21 `terrain_texture_2` char(36) NOT NULL,
22 `terrain_texture_3` char(36) NOT NULL,
23 `terrain_texture_4` char(36) NOT NULL,
24 `elevation_1_nw` float NOT NULL,
25 `elevation_2_nw` float NOT NULL,
26 `elevation_1_ne` float NOT NULL,
27 `elevation_2_ne` float NOT NULL,
28 `elevation_1_se` float NOT NULL,
29 `elevation_2_se` float NOT NULL,
30 `elevation_1_sw` float NOT NULL,
31 `elevation_2_sw` float NOT NULL,
32 `water_height` float NOT NULL,
33 `terrain_raise_limit` float NOT NULL,
34 `terrain_lower_limit` float NOT NULL,
35 `use_estate_sun` int(11) NOT NULL,
36 `fixed_sun` int(11) NOT NULL,
37 `sun_position` float NOT NULL,
38 `covenant` char(36) default NULL,
39 `Sandbox` tinyint(4) NOT NULL,
40 PRIMARY KEY (`regionUUID`)
41) ENGINE=InnoDB;
42
43CREATE TABLE `estate_managers` (
44 `EstateID` int(10) unsigned NOT NULL,
45 `uuid` char(36) NOT NULL,
46 KEY `EstateID` (`EstateID`)
47) ENGINE=InnoDB;
48
49CREATE TABLE `estate_groups` (
50 `EstateID` int(10) unsigned NOT NULL,
51 `uuid` char(36) NOT NULL,
52 KEY `EstateID` (`EstateID`)
53) ENGINE=InnoDB;
54
55CREATE TABLE `estate_users` (
56 `EstateID` int(10) unsigned NOT NULL,
57 `uuid` char(36) NOT NULL,
58 KEY `EstateID` (`EstateID`)
59) ENGINE=InnoDB;
60
61CREATE TABLE `estateban` (
62 `EstateID` int(10) unsigned NOT NULL,
63 `bannedUUID` varchar(36) NOT NULL,
64 `bannedIp` varchar(16) NOT NULL,
65 `bannedIpHostMask` varchar(16) NOT NULL,
66 `bannedNameMask` varchar(64) default NULL,
67 KEY `estateban_EstateID` (`EstateID`)
68) ENGINE=InnoDB;
69
70CREATE TABLE `estate_settings` (
71 `EstateID` int(10) unsigned NOT NULL auto_increment,
72 `EstateName` varchar(64) default NULL,
73 `AbuseEmailToEstateOwner` tinyint(4) NOT NULL,
74 `DenyAnonymous` tinyint(4) NOT NULL,
75 `ResetHomeOnTeleport` tinyint(4) NOT NULL,
76 `FixedSun` tinyint(4) NOT NULL,
77 `DenyTransacted` tinyint(4) NOT NULL,
78 `BlockDwell` tinyint(4) NOT NULL,
79 `DenyIdentified` tinyint(4) NOT NULL,
80 `AllowVoice` tinyint(4) NOT NULL,
81 `UseGlobalTime` tinyint(4) NOT NULL,
82 `PricePerMeter` int(11) NOT NULL,
83 `TaxFree` tinyint(4) NOT NULL,
84 `AllowDirectTeleport` tinyint(4) NOT NULL,
85 `RedirectGridX` int(11) NOT NULL,
86 `RedirectGridY` int(11) NOT NULL,
87 `ParentEstateID` int(10) unsigned NOT NULL,
88 `SunPosition` double NOT NULL,
89 `EstateSkipScripts` tinyint(4) NOT NULL,
90 `BillableFactor` float NOT NULL,
91 `PublicAccess` tinyint(4) NOT NULL,
92 PRIMARY KEY (`EstateID`)
93) ENGINE=InnoDB AUTO_INCREMENT=100;
94
95CREATE TABLE `estate_map` (
96 `RegionID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
97 `EstateID` int(11) NOT NULL,
98 PRIMARY KEY (`RegionID`),
99 KEY `EstateID` (`EstateID`)
100) ENGINE=InnoDB;
101
102commit;
103
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
index 9dee95c..2014e24 100644
--- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
@@ -349,9 +349,9 @@ namespace OpenSim.Data.NHibernate
349 /// </summary> 349 /// </summary>
350 /// <param name="regionUUID">the region UUID</param> 350 /// <param name="regionUUID">the region UUID</param>
351 /// <returns>The banlist</returns> 351 /// <returns>The banlist</returns>
352 public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID) 352 public List<EstateBan> LoadRegionBanList(LLUUID regionUUID)
353 { 353 {
354 List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>(); 354 List<EstateBan> regionbanlist = new List<EstateBan>();
355 355
356 return regionbanlist; 356 return regionbanlist;
357 } 357 }
@@ -360,7 +360,7 @@ namespace OpenSim.Data.NHibernate
360 /// Add en entry into region banlist 360 /// Add en entry into region banlist
361 /// </summary> 361 /// </summary>
362 /// <param name="item"></param> 362 /// <param name="item"></param>
363 public void AddToRegionBanlist(RegionBanListItem item) 363 public void AddToRegionBanlist(EstateBan item)
364 { 364 {
365 365
366 } 366 }
@@ -369,7 +369,7 @@ namespace OpenSim.Data.NHibernate
369 /// remove an entry from the region banlist 369 /// remove an entry from the region banlist
370 /// </summary> 370 /// </summary>
371 /// <param name="item"></param> 371 /// <param name="item"></param>
372 public void RemoveFromRegionBanlist(RegionBanListItem item) 372 public void RemoveFromRegionBanlist(EstateBan item)
373 { 373 {
374 374
375 } 375 }
diff --git a/OpenSim/Data/Null/NullDataStore.cs b/OpenSim/Data/Null/NullDataStore.cs
index 422c0c6..e244a5e 100644
--- a/OpenSim/Data/Null/NullDataStore.cs
+++ b/OpenSim/Data/Null/NullDataStore.cs
@@ -92,22 +92,6 @@ namespace OpenSim.Data.Null
92 return new List<LandData>(); 92 return new List<LandData>();
93 } 93 }
94 94
95 public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID)
96 {
97 List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>();
98 return regionbanlist;
99 }
100
101 public void AddToRegionBanlist(RegionBanListItem item)
102 {
103
104 }
105
106 public void RemoveFromRegionBanlist(RegionBanListItem item)
107 {
108
109 }
110
111 public void Shutdown() 95 public void Shutdown()
112 { 96 {
113 } 97 }
diff --git a/OpenSim/Data/SQLite/Resources/006_RegionStore.sql b/OpenSim/Data/SQLite/Resources/006_RegionStore.sql
new file mode 100644
index 0000000..025f1a9
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/006_RegionStore.sql
@@ -0,0 +1,92 @@
1CREATE TABLE `estate_groups` (
2 `EstateID` int(10) NOT NULL,
3 `uuid` char(36) NOT NULL
4);
5CREATE TABLE `estate_managers` (
6 `EstateID` int(10) NOT NULL,
7 `uuid` char(36) NOT NULL
8);
9CREATE TABLE `estate_map` (
10 `RegionID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
11 `EstateID` int(11) NOT NULL
12);
13CREATE TABLE `estate_settings` (
14 `EstateID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
15 `EstateName` varchar(64) default NULL,
16 `AbuseEmailToEstateOwner` tinyint(4) NOT NULL,
17 `DenyAnonymous` tinyint(4) NOT NULL,
18 `ResetHomeOnTeleport` tinyint(4) NOT NULL,
19 `FixedSun` tinyint(4) NOT NULL,
20 `DenyTransacted` tinyint(4) NOT NULL,
21 `BlockDwell` tinyint(4) NOT NULL,
22 `DenyIdentified` tinyint(4) NOT NULL,
23 `AllowVoice` tinyint(4) NOT NULL,
24 `UseGlobalTime` tinyint(4) NOT NULL,
25 `PricePerMeter` int(11) NOT NULL,
26 `TaxFree` tinyint(4) NOT NULL,
27 `AllowDirectTeleport` tinyint(4) NOT NULL,
28 `RedirectGridX` int(11) NOT NULL,
29 `RedirectGridY` int(11) NOT NULL,
30 `ParentEstateID` int(10) NOT NULL,
31 `SunPosition` double NOT NULL,
32 `EstateSkipScripts` tinyint(4) NOT NULL,
33 `BillableFactor` float NOT NULL,
34 `PublicAccess` tinyint(4) NOT NULL
35);
36insert into `estate_settings` (`EstateID`,`EstateName`,`AbuseEmailToEstateOwner`,`DenyAnonymous`,`ResetHomeOnTeleport`,`FixedSun`,`DenyTransacted`,`BlockDwell`,`DenyIdentified`,`AllowVoice`,`UseGlobalTime`,`PricePerMeter`,`TaxFree`,`AllowDirectTeleport`,`RedirectGridX`,`RedirectGridY`,`ParentEstateID`,`SunPosition`,`PublicAccess`,`EstateSkipScripts`,`BillableFactor`) values ( 99, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
37delete from `estate_settings`;
38CREATE TABLE `estate_users` (
39 `EstateID` int(10) NOT NULL,
40 `uuid` char(36) NOT NULL
41);
42CREATE TABLE `estateban` (
43 `EstateID` int(10) NOT NULL,
44 `bannedUUID` varchar(36) NOT NULL,
45 `bannedIp` varchar(16) NOT NULL,
46 `bannedIpHostMask` varchar(16) NOT NULL,
47 `bannedNameMask` varchar(64) default NULL
48);
49drop table if exists `regionsettings`;
50CREATE TABLE `regionsettings` (
51 `regionUUID` char(36) NOT NULL,
52 `block_terraform` int(11) NOT NULL,
53 `block_fly` int(11) NOT NULL,
54 `allow_damage` int(11) NOT NULL,
55 `restrict_pushing` int(11) NOT NULL,
56 `allow_land_resell` int(11) NOT NULL,
57 `allow_land_join_divide` int(11) NOT NULL,
58 `block_show_in_search` int(11) NOT NULL,
59 `agent_limit` int(11) NOT NULL,
60 `object_bonus` float NOT NULL,
61 `maturity` int(11) NOT NULL,
62 `disable_scripts` int(11) NOT NULL,
63 `disable_collisions` int(11) NOT NULL,
64 `disable_physics` int(11) NOT NULL,
65 `terrain_texture_1` char(36) NOT NULL,
66 `terrain_texture_2` char(36) NOT NULL,
67 `terrain_texture_3` char(36) NOT NULL,
68 `terrain_texture_4` char(36) NOT NULL,
69 `elevation_1_nw` float NOT NULL,
70 `elevation_2_nw` float NOT NULL,
71 `elevation_1_ne` float NOT NULL,
72 `elevation_2_ne` float NOT NULL,
73 `elevation_1_se` float NOT NULL,
74 `elevation_2_se` float NOT NULL,
75 `elevation_1_sw` float NOT NULL,
76 `elevation_2_sw` float NOT NULL,
77 `water_height` float NOT NULL,
78 `terrain_raise_limit` float NOT NULL,
79 `terrain_lower_limit` float NOT NULL,
80 `use_estate_sun` int(11) NOT NULL,
81 `fixed_sun` int(11) NOT NULL,
82 `sun_position` float NOT NULL,
83 `covenant` char(36) default NULL,
84 `Sandbox` tinyint(4) NOT NULL,
85 PRIMARY KEY (`regionUUID`)
86);
87CREATE INDEX `estate_ban_estate_id` on `estateban`(`EstateID`);
88CREATE INDEX `estate_groups_estate_id` on `estate_groups`(`EstateID`);
89CREATE INDEX `estate_managers_estate_id` on `estate_managers`(`EstateID`);
90CREATE INDEX `estate_map_estate_id` on `estate_map`(`EstateID`);
91CREATE UNIQUE INDEX `estate_map_region)id` on `estate_map`(`RegionID`);
92CREATE INDEX `estate_users_estate_id` on `estate_users`(`EstateID`);
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs
new file mode 100644
index 0000000..2d046f2
--- /dev/null
+++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs
@@ -0,0 +1,333 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Data;
31using System.IO;
32using System.Reflection;
33using System.Threading;
34using libsecondlife;
35using Mono.Data.SqliteClient;
36using log4net;
37using OpenSim.Framework;
38using OpenSim.Region.Environment.Interfaces;
39using OpenSim.Region.Environment.Scenes;
40
41namespace OpenSim.Data.MySQL
42{
43 public class MySQLEstateStore : IEstateDataStore
44 {
45 private static readonly ILog m_log =
46 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
48 private SqliteConnection m_connection;
49 private string m_connectionString;
50
51 private FieldInfo[] m_Fields;
52 private Dictionary<string, FieldInfo> m_FieldMap =
53 new Dictionary<string, FieldInfo>();
54
55 public void Initialise(string connectionString)
56 {
57 m_connectionString = connectionString;
58
59 m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
60
61 m_connection = new SqliteConnection(m_connectionString);
62 m_connection.Open();
63
64 Assembly assem = GetType().Assembly;
65 Migration m = new Migration(m_connection, assem, "EstateStore");
66 m.Update();
67
68 m_connection.Close();
69 m_connection.Open();
70
71 Type t = typeof(EstateSettings);
72 m_Fields = t.GetFields(BindingFlags.NonPublic |
73 BindingFlags.Instance |
74 BindingFlags.DeclaredOnly);
75
76 foreach (FieldInfo f in m_Fields)
77 if(f.Name.Substring(0, 2) == "m_")
78 m_FieldMap[f.Name.Substring(2)] = f;
79 }
80
81 private string[] FieldList
82 {
83 get { return new List<string>(m_FieldMap.Keys).ToArray(); }
84 }
85
86 public EstateSettings LoadEstateSettings(LLUUID regionID)
87 {
88 EstateSettings es = new EstateSettings();
89
90 string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = @RegionID";
91
92 SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
93
94 cmd.CommandText = sql;
95 cmd.Parameters.Add("@RegionID", regionID.ToString());
96
97 IDataReader r = cmd.ExecuteReader();
98
99 if(r.Read())
100 {
101 foreach (string name in FieldList)
102 {
103 if(m_FieldMap[name].GetValue(es) is bool)
104 {
105 int v = Convert.ToInt32(r[name]);
106 if(v != 0)
107 m_FieldMap[name].SetValue(es, true);
108 else
109 m_FieldMap[name].SetValue(es, false);
110 }
111 else
112 {
113 m_FieldMap[name].SetValue(es, Convert.ChangeType(r[name], m_FieldMap[name].FieldType));
114 }
115 }
116 r.Close();
117 }
118 else
119 {
120 // Migration case
121 //
122 r.Close();
123
124 List<string> names = new List<string>(FieldList);
125
126 names.Remove("EstateID");
127
128 sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( @"+String.Join(", @", names.ToArray())+")";
129
130 cmd.CommandText = sql;
131 cmd.Parameters.Clear();
132
133 foreach (string name in FieldList)
134 {
135 if(m_FieldMap[name].GetValue(es) is bool)
136 {
137 if((bool)m_FieldMap[name].GetValue(es))
138 cmd.Parameters.Add("@"+name, "1");
139 else
140 cmd.Parameters.Add("@"+name, "0");
141 }
142 else
143 {
144 cmd.Parameters.Add("@"+name, m_FieldMap[name].GetValue(es).ToString());
145 }
146 }
147
148 cmd.ExecuteNonQuery();
149
150 cmd.CommandText = "select LAST_INSERT_ROWID() as id";
151 cmd.Parameters.Clear();
152
153 r = cmd.ExecuteReader();
154
155 r.Read();
156
157 es.EstateID = Convert.ToUInt32(r["id"]);
158
159 r.Close();
160
161 cmd.CommandText = "insert into estate_map values (@RegionID, @EstateID)";
162 cmd.Parameters.Add("@RegionID", regionID.ToString());
163 cmd.Parameters.Add("@EstateID", es.EstateID.ToString());
164
165 // This will throw on dupe key
166 try
167 {
168 cmd.ExecuteNonQuery();
169 }
170 catch (Exception)
171 {
172 }
173
174 // Munge and transfer the ban list
175 //
176 cmd.Parameters.Clear();
177 cmd.CommandText = "insert into estateban select "+es.EstateID.ToString()+", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = @UUID";
178 cmd.Parameters.Add("@UUID", regionID.ToString());
179
180 try
181 {
182 cmd.ExecuteNonQuery();
183 }
184 catch (Exception)
185 {
186 }
187 }
188
189 LoadBanList(es);
190
191 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
192 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
193 es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
194 return es;
195 }
196
197 public void StoreEstateSettings(EstateSettings es)
198 {
199 List<string> fields = new List<string>(FieldList);
200 fields.Remove("EstateID");
201
202 List<string> terms = new List<string>();
203
204 foreach (string f in fields)
205 terms.Add(f+" = @"+f);
206
207 string sql = "update estate_settings set "+String.Join(", ", terms.ToArray())+" where EstateID = @EstateID";
208
209 SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
210
211 cmd.CommandText = sql;
212
213 foreach (string name in FieldList)
214 {
215 if(m_FieldMap[name].GetValue(es) is bool)
216 {
217 if((bool)m_FieldMap[name].GetValue(es))
218 cmd.Parameters.Add("@"+name, "1");
219 else
220 cmd.Parameters.Add("@"+name, "0");
221 }
222 else
223 {
224 cmd.Parameters.Add("@"+name, m_FieldMap[name].GetValue(es).ToString());
225 }
226 }
227
228 cmd.ExecuteNonQuery();
229
230 SaveBanList(es);
231 SaveUUIDList(es.EstateID, "estate_managers", es.EstateManagers);
232 SaveUUIDList(es.EstateID, "estate_users", es.EstateAccess);
233 SaveUUIDList(es.EstateID, "estate_groups", es.EstateGroups);
234 }
235
236 private void LoadBanList(EstateSettings es)
237 {
238 es.ClearBans();
239
240 SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
241
242 cmd.CommandText = "select bannedUUID from estateban where EstateID = @EstateID";
243 cmd.Parameters.Add("@EstateID", es.EstateID);
244
245 IDataReader r = cmd.ExecuteReader();
246
247 while(r.Read())
248 {
249 EstateBan eb = new EstateBan();
250
251 LLUUID uuid = new LLUUID();
252 LLUUID.TryParse(r["bannedUUID"].ToString(), out uuid);
253
254 eb.bannedUUID = uuid;
255 eb.bannedIP = "0.0.0.0";
256 eb.bannedIPHostMask = "0.0.0.0";
257 es.AddBan(eb);
258 }
259 r.Close();
260 }
261
262 private void SaveBanList(EstateSettings es)
263 {
264 SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
265
266 cmd.CommandText = "delete from estateban where EstateID = @EstateID";
267 cmd.Parameters.Add("@EstateID", es.EstateID.ToString());
268
269 cmd.ExecuteNonQuery();
270
271 cmd.Parameters.Clear();
272
273 cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( @EstateID, @bannedUUID, '', '', '' )";
274
275 foreach(EstateBan b in es.EstateBans)
276 {
277 cmd.Parameters.Add("@EstateID", es.EstateID.ToString());
278 cmd.Parameters.Add("@bannedUUID", b.bannedUUID.ToString());
279
280 cmd.ExecuteNonQuery();
281 cmd.Parameters.Clear();
282 }
283 }
284
285 void SaveUUIDList(uint EstateID, string table, LLUUID[] data)
286 {
287 SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
288
289 cmd.CommandText = "delete from "+table+" where EstateID = @EstateID";
290 cmd.Parameters.Add("@EstateID", EstateID.ToString());
291
292 cmd.ExecuteNonQuery();
293
294 cmd.Parameters.Clear();
295
296 cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( @EstateID, @uuid )";
297
298 foreach(LLUUID uuid in data)
299 {
300 cmd.Parameters.Add("@EstateID", EstateID.ToString());
301 cmd.Parameters.Add("@uuid", uuid.ToString());
302
303 cmd.ExecuteNonQuery();
304 cmd.Parameters.Clear();
305 }
306 }
307
308 LLUUID[] LoadUUIDList(uint EstateID, string table)
309 {
310 List<LLUUID> uuids = new List<LLUUID>();
311
312 SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
313
314 cmd.CommandText = "select uuid from "+table+" where EstateID = @EstateID";
315 cmd.Parameters.Add("@EstateID", EstateID);
316
317 IDataReader r = cmd.ExecuteReader();
318
319 while(r.Read())
320 {
321 EstateBan eb = new EstateBan();
322
323 LLUUID uuid = new LLUUID();
324 LLUUID.TryParse(r["uuid"].ToString(), out uuid);
325
326 uuids.Add(uuid);
327 }
328 r.Close();
329
330 return uuids.ToArray();
331 }
332 }
333}
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 0e67fb9..4e87e0d 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -62,7 +62,6 @@ namespace OpenSim.Data.SQLite
62 private SqliteDataAdapter terrainDa; 62 private SqliteDataAdapter terrainDa;
63 private SqliteDataAdapter landDa; 63 private SqliteDataAdapter landDa;
64 private SqliteDataAdapter landAccessListDa; 64 private SqliteDataAdapter landAccessListDa;
65 private SqliteDataAdapter regionBanListDa;
66 65
67 private SqliteConnection m_conn; 66 private SqliteConnection m_conn;
68 67
@@ -119,9 +118,6 @@ namespace OpenSim.Data.SQLite
119 SqliteCommand landAccessListSelectCmd = new SqliteCommand(landAccessListSelect, m_conn); 118 SqliteCommand landAccessListSelectCmd = new SqliteCommand(landAccessListSelect, m_conn);
120 landAccessListDa = new SqliteDataAdapter(landAccessListSelectCmd); 119 landAccessListDa = new SqliteDataAdapter(landAccessListSelectCmd);
121 120
122 SqliteCommand regionBanListSelectCmd = new SqliteCommand(regionbanListSelect, m_conn);
123 regionBanListDa = new SqliteDataAdapter(regionBanListSelectCmd);
124
125 // This actually does the roll forward assembly stuff 121 // This actually does the roll forward assembly stuff
126 Assembly assem = GetType().Assembly; 122 Assembly assem = GetType().Assembly;
127 Migration m = new Migration(m_conn, assem, "RegionStore"); 123 Migration m = new Migration(m_conn, assem, "RegionStore");
@@ -157,10 +153,6 @@ namespace OpenSim.Data.SQLite
157 ds.Tables.Add(createLandAccessListTable()); 153 ds.Tables.Add(createLandAccessListTable());
158 setupLandAccessCommands(landAccessListDa, m_conn); 154 setupLandAccessCommands(landAccessListDa, m_conn);
159 155
160 ds.Tables.Add(createRegionBanListTable());
161 setupRegionBanCommands(regionBanListDa, m_conn);
162
163
164 // WORKAROUND: This is a work around for sqlite on 156 // WORKAROUND: This is a work around for sqlite on
165 // windows, which gets really unhappy with blob columns 157 // windows, which gets really unhappy with blob columns
166 // that have no sample data in them. At some point we 158 // that have no sample data in them. At some point we
@@ -201,15 +193,6 @@ namespace OpenSim.Data.SQLite
201 m_log.Info("[REGION DB]: Caught fill error on landaccesslist table"); 193 m_log.Info("[REGION DB]: Caught fill error on landaccesslist table");
202 } 194 }
203 195
204 try
205 {
206 regionBanListDa.Fill(ds.Tables["regionban"]);
207 }
208 catch (Exception)
209 {
210 m_log.Info("[REGION DB]: Caught fill error on regionban table");
211 }
212
213 return; 196 return;
214 } 197 }
215 } 198 }
@@ -900,21 +883,6 @@ namespace OpenSim.Data.SQLite
900 return landaccess; 883 return landaccess;
901 } 884 }
902 885
903 /// <summary>
904 /// create "regionban" table
905 /// </summary>
906 /// <returns>regionban datatable</returns>
907 private static DataTable createRegionBanListTable()
908 {
909 DataTable regionbanlist = new DataTable("regionban");
910 createCol(regionbanlist, "regionUUID", typeof(String));
911 createCol(regionbanlist, "bannedUUID", typeof(String));
912 createCol(regionbanlist, "bannedIp", typeof(String));
913 createCol(regionbanlist, "bannedIpHostMask", typeof(String));
914
915 return regionbanlist;
916 }
917
918 /*********************************************************************** 886 /***********************************************************************
919 * 887 *
920 * Convert between ADO.NET <=> OpenSim Objects 888 * Convert between ADO.NET <=> OpenSim Objects
@@ -1178,74 +1146,6 @@ namespace OpenSim.Data.SQLite
1178 return entry; 1146 return entry;
1179 } 1147 }
1180 1148
1181
1182 /// <summary>
1183 /// Load a region banlist
1184 /// </summary>
1185 /// <param name="regionUUID">the region UUID</param>
1186 /// <returns>The banlist</returns>
1187 public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID)
1188 {
1189 List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>();
1190 lock (ds)
1191 {
1192 DataTable regionban = ds.Tables["regionban"];
1193 string searchExp = "regionUUID = '" + regionUUID.ToString() + "'";
1194 DataRow[] rawbanlist = regionban.Select(searchExp);
1195 foreach (DataRow rawbanrow in rawbanlist)
1196 {
1197 RegionBanListItem rbli = new RegionBanListItem();
1198 LLUUID tmpvalue = LLUUID.Zero;
1199
1200 rbli.regionUUID = regionUUID;
1201
1202 if (Helpers.TryParse((string)rawbanrow["bannedUUID"], out tmpvalue))
1203 rbli.bannedUUID = tmpvalue;
1204
1205 rbli.bannedIP = (string)rawbanrow["bannedIp"];
1206 rbli.bannedIPHostMask = (string)rawbanrow["bannedIpHostMask"];
1207 regionbanlist.Add(rbli);
1208 }
1209 }
1210 return regionbanlist;
1211 }
1212
1213 /// <summary>
1214 /// Add en entry into region banlist
1215 /// </summary>
1216 /// <param name="item"></param>
1217 public void AddToRegionBanlist(RegionBanListItem item)
1218 {
1219 lock (ds)
1220 {
1221 using (SqliteCommand cmd = new SqliteCommand("insert into regionban (regionUUID, bannedUUID, bannedIp, bannedIpHostMask) values (:regionUUID,:bannedUUID,:bannedIp,:bannedIpHostMask)", m_conn))
1222 {
1223 cmd.Parameters.Add(new SqliteParameter(":regionUUID", item.regionUUID.ToString()));
1224 cmd.Parameters.Add(new SqliteParameter(":bannedUUID", item.bannedUUID.ToString()));
1225 cmd.Parameters.Add(new SqliteParameter(":bannedIp", item.bannedIP));
1226 cmd.Parameters.Add(new SqliteParameter(":bannedIpHostMask", item.bannedIPHostMask));
1227 cmd.ExecuteNonQuery();
1228 }
1229 }
1230 }
1231
1232 /// <summary>
1233 /// remove an entry from the region banlist
1234 /// </summary>
1235 /// <param name="item"></param>
1236 public void RemoveFromRegionBanlist(RegionBanListItem item)
1237 {
1238 lock (ds)
1239 {
1240 using (SqliteCommand cmd = new SqliteCommand("delete from regionban where regionUUID=:regionUUID AND bannedUUID=:bannedUUID", m_conn))
1241 {
1242 cmd.Parameters.Add(new SqliteParameter(":regionUUID", item.regionUUID.ToString()));
1243 cmd.Parameters.Add(new SqliteParameter(":bannedUUID", item.bannedUUID.ToString()));
1244 cmd.ExecuteNonQuery();
1245 }
1246 }
1247 }
1248
1249 /// <summary> 1149 /// <summary>
1250 /// 1150 ///
1251 /// </summary> 1151 /// </summary>
@@ -1827,20 +1727,6 @@ namespace OpenSim.Data.SQLite
1827 /// </summary> 1727 /// </summary>
1828 /// <param name="da"></param> 1728 /// <param name="da"></param>
1829 /// <param name="conn"></param> 1729 /// <param name="conn"></param>
1830 private void setupRegionBanCommands(SqliteDataAdapter da, SqliteConnection conn)
1831 {
1832 da.InsertCommand = createInsertCommand("regionban", ds.Tables["regionban"]);
1833 da.InsertCommand.Connection = conn;
1834
1835 da.UpdateCommand = createUpdateCommand("regionban", "regionUUID=:regionUUID AND bannedUUID=:bannedUUID", ds.Tables["regionban"]);
1836 da.UpdateCommand.Connection = conn;
1837 }
1838
1839 /// <summary>
1840 ///
1841 /// </summary>
1842 /// <param name="da"></param>
1843 /// <param name="conn"></param>
1844 private void setupShapeCommands(SqliteDataAdapter da, SqliteConnection conn) 1730 private void setupShapeCommands(SqliteDataAdapter da, SqliteConnection conn)
1845 { 1731 {
1846 da.InsertCommand = createInsertCommand("primshapes", ds.Tables["primshapes"]); 1732 da.InsertCommand = createInsertCommand("primshapes", ds.Tables["primshapes"]);
diff --git a/OpenSim/Framework/RegionBanListItem.cs b/OpenSim/Framework/EstateBan.cs
index edf6a22..c213344 100644
--- a/OpenSim/Framework/RegionBanListItem.cs
+++ b/OpenSim/Framework/EstateBan.cs
@@ -32,16 +32,12 @@ using System.Text;
32 32
33namespace OpenSim.Framework 33namespace OpenSim.Framework
34{ 34{
35 public class RegionBanListItem 35 public class EstateBan
36 { 36 {
37 public LLUUID regionUUID = LLUUID.Zero; 37 public uint estateID = 1;
38 public LLUUID bannedUUID = LLUUID.Zero; 38 public LLUUID bannedUUID = LLUUID.Zero;
39 public string bannedIP = string.Empty; 39 public string bannedIP = string.Empty;
40 public string bannedIPHostMask = string.Empty; 40 public string bannedIPHostMask = string.Empty;
41 41 public string bannedNameMask = string.Empty;
42 public RegionBanListItem()
43 {
44
45 }
46 } 42 }
47} 43}
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 @@
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Reflection; 30using System.Reflection;
31using System.Collections.Generic;
31using libsecondlife; 32using libsecondlife;
32using log4net; 33using log4net;
33 34
@@ -38,451 +39,440 @@ namespace OpenSim.Framework
38 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
39 private ConfigurationMember configMember; 40 private ConfigurationMember configMember;
40 41
41 //Settings to this island 42 public delegate void SaveDelegate(EstateSettings rs);
42 private float m_billableFactor;
43
44 private uint m_estateID;
45 private LLUUID m_estateManager0;
46 private LLUUID m_estateManager1;
47 private LLUUID m_estateManager2;
48 private LLUUID m_estateManager3;
49 private LLUUID m_estateManager4;
50 private LLUUID m_estateManager5;
51 private LLUUID m_estateManager6;
52 private LLUUID m_estateManager7;
53 private LLUUID m_estateManager8;
54 private LLUUID m_estateManager9;
55 private string m_estateName;
56
57 private uint m_parentEstateID;
58 private int m_pricePerMeter;
59 private int m_redirectGridX;
60 private int m_redirectGridY;
61 43
62 public EstateSettings() 44 public event SaveDelegate OnSave;
45
46 // Only the client uses these
47 //
48 private uint m_EstateID = 100;
49
50 public uint EstateID
63 { 51 {
64 // Temporary hack to prevent multiple loadings. 52 get { return m_EstateID; }
65 if (configMember == null) 53 set { m_EstateID = value; }
66 {
67 configMember =
68 new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS",
69 loadConfigurationOptions, handleIncomingConfiguration, true);
70 configMember.performConfigurationRetrieve();
71 }
72 } 54 }
73 55
74 public float billableFactor 56 private string m_EstateName;
57
58 public string EstateName
75 { 59 {
76 get { return m_billableFactor; } 60 get { return m_EstateName; }
77 set 61 set { m_EstateName = value; }
78 {
79 m_billableFactor = value;
80 configMember.forceSetConfigurationOption("billable_factor", m_billableFactor.ToString());
81 }
82 } 62 }
83 63
84 public uint estateID 64 private uint m_ParentEstateID = 100;
65
66 public uint ParentEstateID
85 { 67 {
86 get { return m_estateID; } 68 get { return m_ParentEstateID; }
87 set 69 set { m_ParentEstateID = value; }
88 {
89 m_estateID = value;
90 configMember.forceSetConfigurationOption("estate_id", m_estateID.ToString());
91 }
92 } 70 }
93 71
94 public uint parentEstateID 72 private float m_BillableFactor;
73
74 public float BillableFactor
95 { 75 {
96 get { return m_parentEstateID; } 76 get { return m_BillableFactor; }
97 set 77 set { m_BillableFactor = value; }
98 {
99 m_parentEstateID = value;
100 configMember.forceSetConfigurationOption("parent_estate_id", m_parentEstateID.ToString());
101 }
102 } 78 }
103 79
104 public int redirectGridX 80 private int m_PricePerMeter;
81
82 public int PricePerMeter
105 { 83 {
106 get { return m_redirectGridX; } 84 get { return m_PricePerMeter; }
107 set 85 set { m_PricePerMeter = value; }
108 {
109 m_redirectGridX = value;
110 configMember.forceSetConfigurationOption("redirect_grid_x", m_redirectGridX.ToString());
111 }
112 } 86 }
113 87
114 public int redirectGridY 88 private int m_RedirectGridX;
89
90 public int RedirectGridX
115 { 91 {
116 get { return m_redirectGridY; } 92 get { return m_RedirectGridX; }
117 set 93 set { m_RedirectGridX = value; }
118 {
119 m_redirectGridY = value;
120 configMember.forceSetConfigurationOption("redirect_grid_y", m_redirectGridY.ToString());
121 }
122 } 94 }
123 95
124 public int pricePerMeter 96 private int m_RedirectGridY;
97
98 public int RedirectGridY
125 { 99 {
126 get { return m_pricePerMeter; } 100 get { return m_RedirectGridY; }
127 set 101 set { m_RedirectGridY = value; }
128 {
129 m_pricePerMeter = value;
130 configMember.forceSetConfigurationOption("price_per_meter", m_pricePerMeter.ToString());
131 }
132 } 102 }
133 103
134 // Estate name 104 // Used by the sim
105 //
106 private bool m_UseGlobalTime = true;
135 107
136 public string estateName 108 public bool UseGlobalTime
137 { 109 {
138 get { return m_estateName; } 110 get { return m_UseGlobalTime; }
139 set 111 set { m_UseGlobalTime = value; }
140 {
141 m_estateName = value;
142 configMember.forceSetConfigurationOption("estate_name", m_estateName.ToString());
143 }
144 } 112 }
145 113
146 public LLUUID[] estateManagers 114 private bool m_FixedSun = false;
115
116 public bool FixedSun
147 { 117 {
148 get 118 get { return m_FixedSun; }
149 { 119 set { m_FixedSun = value; }
150 // returns a condensed array of LLUUIDs
151 return GetEstateManagers();
152 }
153 set
154 {
155 // Sets a Condensed array of LLUUIDS
156 int i = 0;
157 for (i = 0; i < value.Length; i++)
158 {
159 switch (i)
160 {
161 case 0:
162 m_estateManager0 = value[i];
163 break;
164 case 1:
165 m_estateManager1 = value[i];
166 break;
167 case 2:
168 m_estateManager2 = value[i];
169 break;
170 case 3:
171 m_estateManager3 = value[i];
172 break;
173 case 4:
174 m_estateManager4 = value[i];
175 break;
176 case 5:
177 m_estateManager5 = value[i];
178 break;
179 case 6:
180 m_estateManager6 = value[i];
181 break;
182 case 7:
183 m_estateManager7 = value[i];
184 break;
185 case 8:
186 m_estateManager8 = value[i];
187 break;
188 case 9:
189 m_estateManager9 = value[i];
190 break;
191 }
192 }
193
194 // Clear the rest of them.. as they're no longer valid
195 for (int j = i; j < 10; j++)
196 {
197 switch (j)
198 {
199 case 0:
200 m_estateManager0 = LLUUID.Zero;
201 break;
202 case 1:
203 m_estateManager1 = LLUUID.Zero;
204 break;
205 case 2:
206 m_estateManager2 = LLUUID.Zero;
207 break;
208 case 3:
209 m_estateManager3 = LLUUID.Zero;
210 break;
211 case 4:
212 m_estateManager4 = LLUUID.Zero;
213 break;
214 case 5:
215 m_estateManager5 = LLUUID.Zero;
216 break;
217 case 6:
218 m_estateManager6 = LLUUID.Zero;
219 break;
220 case 7:
221 m_estateManager7 = LLUUID.Zero;
222 break;
223 case 8:
224 m_estateManager8 = LLUUID.Zero;
225 break;
226 case 9:
227 m_estateManager9 = LLUUID.Zero;
228 break;
229 }
230 }
231
232 for (i = 0; i < 10; i++)
233 {
234 // Writes out the Estate managers to the XML file.
235 configMember.forceSetConfigurationOption("estate_manager_" + i, (GetEstateManagerAtPos(i)).ToString());
236 }
237 }
238 } 120 }
239 121
240 #region EstateManager Get Methods to sort out skipped spots in the XML (suser error) 122 private double m_SunPosition = 0.0;
241 123
242 private LLUUID GetEstateManagerAtPos(int pos) 124 public double SunPosition
243 { 125 {
244 // This is a helper for writing them out to the xml file 126 get { return m_SunPosition; }
245 switch (pos) 127 set { m_SunPosition = value; }
246 { 128 }
247 case 0:
248 return m_estateManager0;
249 129
250 case 1: 130 private bool m_AllowVoice = true;
251 return m_estateManager1;
252 131
253 case 2: 132 public bool AllowVoice
254 return m_estateManager2; 133 {
134 get { return m_AllowVoice; }
135 set { m_AllowVoice = value; }
136 }
255 137
256 case 3: 138 private bool m_AllowDirectTeleport = true;
257 return m_estateManager3;
258 139
259 case 4: 140 public bool AllowDirectTeleport
260 return m_estateManager4; 141 {
142 get { return m_AllowDirectTeleport; }
143 set { m_AllowDirectTeleport = value; }
144 }
261 145
262 case 5: 146 private bool m_DenyAnonymous = false;
263 return m_estateManager5;
264 147
265 case 6: 148 public bool DenyAnonymous
266 return m_estateManager6; 149 {
150 get { return m_DenyAnonymous; }
151 set { m_DenyAnonymous = value; }
152 }
267 153
268 case 7: 154 private bool m_DenyIdentified = false;
269 return m_estateManager7;
270 155
271 case 8: 156 public bool DenyIdentified
272 return m_estateManager8; 157 {
158 get { return m_DenyIdentified; }
159 set { m_DenyIdentified = value; }
160 }
273 161
274 case 9: 162 private bool m_DenyTransacted = false;
275 return m_estateManager9;
276 163
277 default: 164 public bool DenyTransacted
278 return LLUUID.Zero; 165 {
279 } 166 get { return m_DenyTransacted; }
167 set { m_DenyTransacted = value; }
280 } 168 }
281 169
282 private LLUUID[] GetEstateManagers() 170 private bool m_AbuseEmailToEstateOwner = false;
171
172 public bool AbuseEmailToEstateOwner
283 { 173 {
284 int numEstateManagers = GetNumberOfEstateManagers(); 174 get { return m_AbuseEmailToEstateOwner; }
285 LLUUID[] rEstateManagers = new LLUUID[numEstateManagers]; 175 set { m_AbuseEmailToEstateOwner = value; }
176 }
286 177
287 int pos = 0; 178 private bool m_BlockDwell = false;
288 179
289 for (int i = 0; i < numEstateManagers; i++) 180 public bool BlockDwell
290 { 181 {
291 pos = GetNextEstateManager(pos); 182 get { return m_BlockDwell; }
292 183 set { m_BlockDwell = value; }
293 rEstateManagers[i] = GetEstateManagerAtPos(pos);
294 pos++;
295 }
296 return rEstateManagers;
297 } 184 }
298 185
299 private int GetNextEstateManager(int startpos) 186 private bool m_EstateSkipScripts = false;
187
188 public bool EstateSkipScripts
300 { 189 {
301 // This is a utility function that skips over estate managers set to LLUUID.Zero 190 get { return m_EstateSkipScripts; }
302 int i = startpos; 191 set { m_EstateSkipScripts = value; }
303 for (i = startpos; i < 10; i++)
304 {
305 if (GetEstateManagerAtPos(i) != LLUUID.Zero) return i;
306 }
307 return i;
308 } 192 }
309 193
310 private int GetNumberOfEstateManagers() 194 private bool m_ResetHomeOnTeleport = false;
195
196 public bool ResetHomeOnTeleport
311 { 197 {
312 // This function returns the number of estate managers set 198 get { return m_ResetHomeOnTeleport; }
313 // Regardless of whether there is a skipped spot 199 set { m_ResetHomeOnTeleport = value; }
314 int numEstateManagers = 0; 200 }
315 if (m_estateManager0 != LLUUID.Zero) numEstateManagers++;
316 if (m_estateManager1 != LLUUID.Zero) numEstateManagers++;
317 if (m_estateManager2 != LLUUID.Zero) numEstateManagers++;
318 if (m_estateManager3 != LLUUID.Zero) numEstateManagers++;
319 if (m_estateManager4 != LLUUID.Zero) numEstateManagers++;
320 if (m_estateManager5 != LLUUID.Zero) numEstateManagers++;
321 if (m_estateManager6 != LLUUID.Zero) numEstateManagers++;
322 if (m_estateManager7 != LLUUID.Zero) numEstateManagers++;
323 if (m_estateManager8 != LLUUID.Zero) numEstateManagers++;
324 if (m_estateManager9 != LLUUID.Zero) numEstateManagers++;
325 201
326 return numEstateManagers; 202 private bool m_TaxFree = false;
203
204 public bool TaxFree
205 {
206 get { return m_TaxFree; }
207 set { m_TaxFree = value; }
327 } 208 }
328 209
329 public void AddEstateManager(LLUUID avatarID) 210 private bool m_PublicAccess = true;
211
212 public bool PublicAccess
330 { 213 {
331 LLUUID[] testateManagers = GetEstateManagers(); 214 get { return m_PublicAccess; }
332 LLUUID[] nestateManagers = new LLUUID[testateManagers.Length + 1]; 215 set { m_PublicAccess = value; }
216 }
333 217
334 int i = 0; 218 // All those lists...
335 for (i = 0; i < testateManagers.Length; i++) 219 //
336 { 220 private List<LLUUID> l_EstateManagers = new List<LLUUID>();
337 nestateManagers[i] = testateManagers[i];
338 }
339 221
340 nestateManagers[i] = avatarID; 222 public LLUUID[] EstateManagers
223 {
224 get { return l_EstateManagers.ToArray(); }
225 set { l_EstateManagers = new List<LLUUID>(value); }
226 }
341 227
342 //Saves it to the estate settings file 228 private List<EstateBan> l_EstateBans = new List<EstateBan>();
343 estateManagers = nestateManagers; 229
230 public EstateBan[] EstateBans
231 {
232 get { return l_EstateBans.ToArray(); }
233 set { l_EstateBans = new List<EstateBan>(value); }
344 } 234 }
345 235
346 public void RemoveEstateManager(LLUUID avatarID) 236 private List<LLUUID> l_EstateAccess = new List<LLUUID>();
237
238 public LLUUID[] EstateAccess
347 { 239 {
348 int notfoundparam = 11; // starting high so the condense routine (max ten) doesn't run if we don't find it. 240 get { return l_EstateAccess.ToArray(); }
349 LLUUID[] testateManagers = GetEstateManagers(); // temporary estate managers list 241 set { l_EstateAccess = new List<LLUUID>(value); }
242 }
350 243
244 private List<LLUUID> l_EstateGroups = new List<LLUUID>();
351 245
352 int i = 0; 246 public LLUUID[] EstateGroups
353 int foundpos = notfoundparam; 247 {
248 get { return l_EstateGroups.ToArray(); }
249 set { l_EstateGroups = new List<LLUUID>(value); }
250 }
354 251
355 // search for estate manager. 252 public EstateSettings()
356 for (i = 0; i < testateManagers.Length; i++) 253 {
254 if (configMember == null)
357 { 255 {
358 if (testateManagers[i] == avatarID) 256 // Load legacy defaults
359 { 257 //
360 foundpos = i; 258 configMember =
361 break; 259 new ConfigurationMember(Path.Combine(Util.configDir(),
362 } 260 "estate_settings.xml"), "ESTATE SETTINGS",
261 loadConfigurationOptions,
262 handleIncomingConfiguration, true);
263
264 l_EstateManagers.Clear();
265 configMember.performConfigurationRetrieve();
363 } 266 }
364 if (foundpos < notfoundparam) 267 }
365 {
366 LLUUID[] restateManagers = new LLUUID[testateManagers.Length - 1];
367 268
368 // fill new estate managers array up to the found spot 269 public void Save()
369 for (int j = 0; j < foundpos; j++) 270 {
370 restateManagers[j] = testateManagers[j]; 271 if(OnSave != null)
272 OnSave(this);
273 }
371 274
372 // skip over the estate manager we're removing and compress 275 public void AddEstateManager(LLUUID avatarID)
373 for (int j = foundpos + 1; j < testateManagers.Length; j++) 276 {
374 restateManagers[j - 1] = testateManagers[j]; 277 if(avatarID == null || avatarID == LLUUID.Zero)
278 return;
279 if(!l_EstateManagers.Contains(avatarID))
280 l_EstateManagers.Add(avatarID);
281 }
375 282
376 estateManagers = restateManagers; 283 public void RemoveEstateManager(LLUUID avatarID)
377 } 284 {
378 else 285 if(l_EstateManagers.Contains(avatarID))
379 { 286 l_EstateManagers.Remove(avatarID);
380 m_log.Error("[ESTATESETTINGS]: Unable to locate estate manager : " + avatarID.ToString() + " for removal");
381 }
382 } 287 }
383 288
384 #endregion 289 public bool IsEstateManager(LLUUID avatarID)
290 {
291 return l_EstateManagers.Contains(avatarID);
292 }
293
294 public bool IsBanned(LLUUID avatarID)
295 {
296 foreach (EstateBan ban in l_EstateBans)
297 if(ban.bannedUUID == avatarID)
298 return true;
299 return false;
300 }
301
302 public void AddBan(EstateBan ban)
303 {
304 if(ban == null)
305 return;
306 if(!IsBanned(ban.bannedUUID))
307 l_EstateBans.Add(ban);
308 }
309
310 public void ClearBans()
311 {
312 l_EstateBans.Clear();
313 }
314
315 public void RemoveBan(LLUUID avatarID)
316 {
317 foreach (EstateBan ban in new List<EstateBan>(l_EstateBans))
318 if(ban.bannedUUID == avatarID)
319 l_EstateBans.Remove(ban);
320 }
385 321
386 public void loadConfigurationOptions() 322 public void loadConfigurationOptions()
387 { 323 {
388 configMember.addConfigurationOption("billable_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, 324 configMember.addConfigurationOption("billable_factor",
389 "0.0", true); 325 ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
390 configMember.addConfigurationOption("estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty, "100", 326 String.Empty, "0.0", true);
391 true); 327
392 configMember.addConfigurationOption("parent_estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 328// configMember.addConfigurationOption("estate_id",
393 String.Empty, "1", true); 329// ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
394 configMember.addConfigurationOption("max_agents", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "40", 330// String.Empty, "100", true);
395 true); 331
396 332// configMember.addConfigurationOption("parent_estate_id",
397 configMember.addConfigurationOption("redirect_grid_x", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, 333// ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
398 "0", true); 334// String.Empty, "1", true);
399 configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, 335
400 "0", true); 336 configMember.addConfigurationOption("redirect_grid_x",
401 configMember.addConfigurationOption("price_per_meter", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 337 ConfigurationOption.ConfigurationTypes.TYPE_INT32,
402 String.Empty, "1", true); 338 String.Empty, "0", true);
403 339
404 configMember.addConfigurationOption("water_height", ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, String.Empty, 340 configMember.addConfigurationOption("redirect_grid_y",
405 "20.0", true); 341 ConfigurationOption.ConfigurationTypes.TYPE_INT32,
406 342 String.Empty, "0", true);
407 configMember.addConfigurationOption("estate_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 343
408 String.Empty, "TestEstate", true); 344 configMember.addConfigurationOption("price_per_meter",
409 configMember.addConfigurationOption("estate_manager_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 345 ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
410 String.Empty, "00000000-0000-0000-0000-000000000000", true); 346 String.Empty, "1", true);
411 configMember.addConfigurationOption("estate_manager_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 347
412 String.Empty, "00000000-0000-0000-0000-000000000000", true); 348 configMember.addConfigurationOption("estate_name",
413 configMember.addConfigurationOption("estate_manager_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 349 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
414 String.Empty, "00000000-0000-0000-0000-000000000000", true); 350 String.Empty, "My Estate", true);
415 configMember.addConfigurationOption("estate_manager_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 351
416 String.Empty, "00000000-0000-0000-0000-000000000000", true); 352 configMember.addConfigurationOption("estate_manager_0",
417 configMember.addConfigurationOption("estate_manager_4", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 353 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
418 String.Empty, "00000000-0000-0000-0000-000000000000", true); 354 String.Empty, "00000000-0000-0000-0000-000000000000", true);
419 configMember.addConfigurationOption("estate_manager_5", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 355
420 String.Empty, "00000000-0000-0000-0000-000000000000", true); 356 configMember.addConfigurationOption("estate_manager_1",
421 configMember.addConfigurationOption("estate_manager_6", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 357 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
422 String.Empty, "00000000-0000-0000-0000-000000000000", true); 358 String.Empty, "00000000-0000-0000-0000-000000000000", true);
423 configMember.addConfigurationOption("estate_manager_7", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 359
424 String.Empty, "00000000-0000-0000-0000-000000000000", true); 360 configMember.addConfigurationOption("estate_manager_2",
425 configMember.addConfigurationOption("estate_manager_8", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 361 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
426 String.Empty, "00000000-0000-0000-0000-000000000000", true); 362 String.Empty, "00000000-0000-0000-0000-000000000000", true);
427 configMember.addConfigurationOption("estate_manager_9", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 363
428 String.Empty, "00000000-0000-0000-0000-000000000000", true); 364 configMember.addConfigurationOption("estate_manager_3",
365 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
366 String.Empty, "00000000-0000-0000-0000-000000000000", true);
367
368 configMember.addConfigurationOption("estate_manager_4",
369 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
370 String.Empty, "00000000-0000-0000-0000-000000000000", true);
371
372 configMember.addConfigurationOption("estate_manager_5",
373 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
374 String.Empty, "00000000-0000-0000-0000-000000000000", true);
375
376 configMember.addConfigurationOption("estate_manager_6",
377 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
378 String.Empty, "00000000-0000-0000-0000-000000000000", true);
379
380 configMember.addConfigurationOption("estate_manager_7",
381 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
382 String.Empty, "00000000-0000-0000-0000-000000000000", true);
383
384 configMember.addConfigurationOption("estate_manager_8",
385 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
386 String.Empty, "00000000-0000-0000-0000-000000000000", true);
387
388 configMember.addConfigurationOption("estate_manager_9",
389 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
390 String.Empty, "00000000-0000-0000-0000-000000000000", true);
391
392 configMember.addConfigurationOption("region_flags",
393 ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
394 String.Empty, "336723974", true);
429 } 395 }
430 396
431 public bool handleIncomingConfiguration(string configuration_key, object configuration_result) 397 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
432 { 398 {
433 switch (configuration_key) 399 switch (configuration_key)
434 { 400 {
435 case "billable_factor": 401 case "region_flags":
436 m_billableFactor = (float) configuration_result; 402 Simulator.RegionFlags flags = (Simulator.RegionFlags)(uint)configuration_result;
403 if((flags & (Simulator.RegionFlags)(1<<29)) != 0)
404 m_AllowVoice = true;
405 if((flags & Simulator.RegionFlags.AllowDirectTeleport) != 0)
406 m_AllowDirectTeleport = true;
407 if((flags & Simulator.RegionFlags.DenyAnonymous) != 0)
408 m_DenyAnonymous = true;
409 if((flags & Simulator.RegionFlags.DenyIdentified) != 0)
410 m_DenyIdentified = true;
411 if((flags & Simulator.RegionFlags.DenyTransacted) != 0)
412 m_DenyTransacted = true;
413 if((flags & Simulator.RegionFlags.AbuseEmailToEstateOwner) != 0)
414 m_AbuseEmailToEstateOwner = true;
415 if((flags & Simulator.RegionFlags.BlockDwell) != 0)
416 m_BlockDwell = true;
417 if((flags & Simulator.RegionFlags.EstateSkipScripts) != 0)
418 m_EstateSkipScripts = true;
419 if((flags & Simulator.RegionFlags.ResetHomeOnTeleport) != 0)
420 m_ResetHomeOnTeleport = true;
421 if((flags & Simulator.RegionFlags.TaxFree) != 0)
422 m_TaxFree = true;
423 if((flags & Simulator.RegionFlags.PublicAllowed) != 0)
424 m_PublicAccess = true;
437 break; 425 break;
438 case "estate_id": 426 case "billable_factor":
439 m_estateID = (uint) configuration_result; 427 m_BillableFactor = (float) configuration_result;
440 break;
441 case "parent_estate_id":
442 m_parentEstateID = (uint) configuration_result;
443 break; 428 break;
429// case "estate_id":
430// m_EstateID = (uint) configuration_result;
431// break;
432// case "parent_estate_id":
433// m_ParentEstateID = (uint) configuration_result;
434// break;
444 case "redirect_grid_x": 435 case "redirect_grid_x":
445 m_redirectGridX = (int) configuration_result; 436 m_RedirectGridX = (int) configuration_result;
446 break; 437 break;
447 case "redirect_grid_y": 438 case "redirect_grid_y":
448 m_redirectGridY = (int) configuration_result; 439 m_RedirectGridY = (int) configuration_result;
449 break; 440 break;
450 case "price_per_meter": 441 case "price_per_meter":
451 m_pricePerMeter = Convert.ToInt32(configuration_result); 442 m_PricePerMeter = Convert.ToInt32(configuration_result);
452 break; 443 break;
453
454 case "estate_name": 444 case "estate_name":
455 m_estateName = (string) configuration_result; 445 m_EstateName = (string) configuration_result;
456 break; 446 break;
457 case "estate_manager_0": 447 case "estate_manager_0":
458 m_estateManager0 = (LLUUID) configuration_result; 448 AddEstateManager((LLUUID)configuration_result);
459 break; 449 break;
460 case "estate_manager_1": 450 case "estate_manager_1":
461 m_estateManager1 = (LLUUID) configuration_result; 451 AddEstateManager((LLUUID)configuration_result);
462 break; 452 break;
463 case "estate_manager_2": 453 case "estate_manager_2":
464 m_estateManager2 = (LLUUID) configuration_result; 454 AddEstateManager((LLUUID)configuration_result);
465 break; 455 break;
466 case "estate_manager_3": 456 case "estate_manager_3":
467 m_estateManager3 = (LLUUID) configuration_result; 457 AddEstateManager((LLUUID)configuration_result);
468 break; 458 break;
469 case "estate_manager_4": 459 case "estate_manager_4":
470 m_estateManager4 = (LLUUID) configuration_result; 460 AddEstateManager((LLUUID)configuration_result);
471 break; 461 break;
472 case "estate_manager_5": 462 case "estate_manager_5":
473 m_estateManager5 = (LLUUID) configuration_result; 463 AddEstateManager((LLUUID)configuration_result);
474 break; 464 break;
475 case "estate_manager_6": 465 case "estate_manager_6":
476 m_estateManager6 = (LLUUID) configuration_result; 466 AddEstateManager((LLUUID)configuration_result);
477 break; 467 break;
478 case "estate_manager_7": 468 case "estate_manager_7":
479 m_estateManager7 = (LLUUID) configuration_result; 469 AddEstateManager((LLUUID)configuration_result);
480 break; 470 break;
481 case "estate_manager_8": 471 case "estate_manager_8":
482 m_estateManager8 = (LLUUID) configuration_result; 472 AddEstateManager((LLUUID)configuration_result);
483 break; 473 break;
484 case "estate_manager_9": 474 case "estate_manager_9":
485 m_estateManager9 = (LLUUID) configuration_result; 475 AddEstateManager((LLUUID)configuration_result);
486 break; 476 break;
487 } 477 }
488 478
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
285 public delegate void SetEstateTerrainDetailTexture(IClientAPI remoteClient, int corner, LLUUID side); 285 public delegate void SetEstateTerrainDetailTexture(IClientAPI remoteClient, int corner, LLUUID side);
286 public delegate void SetEstateTerrainTextureHeights(IClientAPI remoteClient, int corner, float lowVal, float highVal); 286 public delegate void SetEstateTerrainTextureHeights(IClientAPI remoteClient, int corner, float lowVal, float highVal);
287 public delegate void CommitEstateTerrainTextureRequest(IClientAPI remoteClient); 287 public delegate void CommitEstateTerrainTextureRequest(IClientAPI remoteClient);
288 public delegate void SetRegionTerrainSettings(float waterHeight, float terrainRaiseLimit, float terrainLowerLimit, bool fixedSun, float sunHour); 288 public delegate void SetRegionTerrainSettings(float waterHeight, float terrainRaiseLimit, float terrainLowerLimit, bool estateSun, bool fixedSun, float sunHour, bool globalSun, bool estateFixed, float estateSunHour);
289 public delegate void EstateChangeInfo(IClientAPI client, LLUUID invoice, LLUUID senderID, UInt32 param1, UInt32 param2);
289 public delegate void BakeTerrain(IClientAPI remoteClient ); 290 public delegate void BakeTerrain(IClientAPI remoteClient );
290 public delegate void EstateRestartSimRequest(IClientAPI remoteClient, int secondsTilReboot); 291 public delegate void EstateRestartSimRequest(IClientAPI remoteClient, int secondsTilReboot);
291 public delegate void EstateChangeCovenantRequest(IClientAPI remoteClient, LLUUID newCovenantID); 292 public delegate void EstateChangeCovenantRequest(IClientAPI remoteClient, LLUUID newCovenantID);
@@ -349,6 +350,7 @@ namespace OpenSim.Framework
349 // [Obsolete("LLClientView Specific - Replace with more suitable arguments.")] 350 // [Obsolete("LLClientView Specific - Replace with more suitable arguments.")]
350 event ModifyTerrain OnModifyTerrain; 351 event ModifyTerrain OnModifyTerrain;
351 event BakeTerrain OnBakeTerrain; 352 event BakeTerrain OnBakeTerrain;
353 event EstateChangeInfo OnEstateChangeInfo;
352 // [Obsolete("LLClientView Specific.")] 354 // [Obsolete("LLClientView Specific.")]
353 event SetAppearance OnSetAppearance; 355 event SetAppearance OnSetAppearance;
354 // [Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")] 356 // [Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")]
@@ -628,11 +630,11 @@ namespace OpenSim.Framework
628 630
629 void SendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID); 631 void SendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID);
630 632
631 void SendBannedUserList(LLUUID invoice, List<RegionBanListItem> banlist, uint estateID); 633 void SendBannedUserList(LLUUID invoice, EstateBan[] banlist, uint estateID);
632 634
633 void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args); 635 void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args);
634 void SendEstateCovenantInformation(); 636 void SendEstateCovenantInformation(LLUUID covenant);
635 void SendDetailedEstateData(LLUUID invoice,string estateName, uint estateID); 637 void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant);
636 638
637 void SendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags); 639 void SendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags);
638 void SendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID); 640 void SendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID);
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
193 193
194 public bool commFailTF = false; 194 public bool commFailTF = false;
195 public ConfigurationMember configMember; 195 public ConfigurationMember configMember;
196 public LLUUID CovenantID = LLUUID.Zero;
197 public string DataStore = String.Empty; 196 public string DataStore = String.Empty;
198 public bool isSandbox = false; 197 public bool isSandbox = false;
199 private EstateSettings m_estateSettings; 198 private EstateSettings m_estateSettings;
@@ -212,7 +211,6 @@ namespace OpenSim.Framework
212 211
213 public LLUUID lastMapUUID = LLUUID.Zero; 212 public LLUUID lastMapUUID = LLUUID.Zero;
214 public string lastMapRefresh = "0"; 213 public string lastMapRefresh = "0";
215 public List<RegionBanListItem> regionBanlist = new List<RegionBanListItem>();
216 214
217 // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. 215 // Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
218 216
@@ -279,6 +277,8 @@ namespace OpenSim.Framework
279 277
280 return m_estateSettings; 278 return m_estateSettings;
281 } 279 }
280
281 set { m_estateSettings = value; }
282 } 282 }
283 283
284 public RegionSettings RegionSettings 284 public RegionSettings RegionSettings
@@ -364,28 +364,6 @@ namespace OpenSim.Framework
364 configMember.performConfigurationRetrieve(); 364 configMember.performConfigurationRetrieve();
365 } 365 }
366 366
367 public bool CheckIfUserBanned(LLUUID user)
368 {
369
370 RegionBanListItem[] bl = regionBanlist.ToArray();
371
372 bool banned = false;
373
374 for (int i = 0; i < bl.Length; i++)
375 {
376 if (bl[i] == null)
377 continue;
378
379 if (bl[i].bannedUUID == user)
380 {
381 banned = true;
382 break;
383 }
384 }
385
386 return banned;
387 }
388
389 public void loadConfigurationOptionsFromMe() 367 public void loadConfigurationOptionsFromMe()
390 { 368 {
391 configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID_NULL_FREE, 369 configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID_NULL_FREE,
@@ -415,9 +393,6 @@ namespace OpenSim.Framework
415 "External Host Name", m_externalHostName, true); 393 "External Host Name", m_externalHostName, true);
416 configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 394 configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
417 "Master Avatar UUID", MasterAvatarAssignedUUID.ToString(), true); 395 "Master Avatar UUID", MasterAvatarAssignedUUID.ToString(), true);
418 configMember.addConfigurationOption("estate_covanant_uuid",
419 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Estate Covenant",
420 CovenantID.ToString(), true);
421 configMember.addConfigurationOption("master_avatar_first", 396 configMember.addConfigurationOption("master_avatar_first",
422 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 397 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
423 "First Name of Master Avatar", MasterAvatarFirstName, true); 398 "First Name of Master Avatar", MasterAvatarFirstName, true);
@@ -461,9 +436,6 @@ namespace OpenSim.Framework
461 "External Host Name", "127.0.0.1", false); 436 "External Host Name", "127.0.0.1", false);
462 configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 437 configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
463 "Master Avatar UUID", LLUUID.Zero.ToString(), true); 438 "Master Avatar UUID", LLUUID.Zero.ToString(), true);
464 configMember.addConfigurationOption("estate_covanant_uuid",
465 ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Estate Covenant",
466 LLUUID.Zero.ToString(), true);
467 configMember.addConfigurationOption("master_avatar_first", 439 configMember.addConfigurationOption("master_avatar_first",
468 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 440 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
469 "First Name of Master Avatar", "Test", false, 441 "First Name of Master Avatar", "Test", false,
@@ -538,10 +510,6 @@ namespace OpenSim.Framework
538 case "master_avatar_uuid": 510 case "master_avatar_uuid":
539 MasterAvatarAssignedUUID = (LLUUID) configuration_result; 511 MasterAvatarAssignedUUID = (LLUUID) configuration_result;
540 break; 512 break;
541 case "estate_covanant_uuid":
542 CovenantID = (LLUUID) configuration_result;
543 break;
544
545 case "master_avatar_first": 513 case "master_avatar_first":
546 MasterAvatarFirstName = (string) configuration_result; 514 MasterAvatarFirstName = (string) configuration_result;
547 break; 515 break;
@@ -563,11 +531,6 @@ namespace OpenSim.Framework
563 return true; 531 return true;
564 } 532 }
565 533
566 public void SaveEstatecovenantUUID(LLUUID notecard)
567 {
568 if (null == configMember) return;
569 configMember.forceSetConfigurationOption("estate_covanant_uuid", notecard.ToString());
570 }
571 public void SaveLastMapUUID(LLUUID mapUUID) 534 public void SaveLastMapUUID(LLUUID mapUUID)
572 { 535 {
573 if (null == configMember) return; 536 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
162 (flags & Simulator.RegionFlags.SkipPhysics) != 0; 162 (flags & Simulator.RegionFlags.SkipPhysics) != 0;
163 m_FixedSun = 163 m_FixedSun =
164 (flags & Simulator.RegionFlags.SunFixed) != 0; 164 (flags & Simulator.RegionFlags.SunFixed) != 0;
165 m_Sandbox =
166 (flags & Simulator.RegionFlags.Sandbox) != 0;
165 break; 167 break;
166 case "max_agents": 168 case "max_agents":
167 m_AgentLimit = (int)value; 169 m_AgentLimit = (int)value;
@@ -231,7 +233,8 @@ namespace OpenSim.Framework
231 233
232 public void Save() 234 public void Save()
233 { 235 {
234 OnSave(this); 236 if(OnSave != null)
237 OnSave(this);
235 } 238 }
236 239
237 private LLUUID m_RegionUUID = LLUUID.Zero; 240 private LLUUID m_RegionUUID = LLUUID.Zero;
@@ -474,6 +477,14 @@ namespace OpenSim.Framework
474 set { m_UseEstateSun = value; } 477 set { m_UseEstateSun = value; }
475 } 478 }
476 479
480 private bool m_Sandbox = false;
481
482 public bool Sandbox
483 {
484 get { return m_Sandbox; }
485 set { m_Sandbox = value; }
486 }
487
477 private LLVector3 m_SunVector; 488 private LLVector3 m_SunVector;
478 489
479 public LLVector3 SunVector 490 public LLVector3 SunVector
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index c9cc062..380df73 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -520,7 +520,6 @@ namespace OpenSim
520 //moved these here as the terrain texture has to be created after the modules are initialized 520 //moved these here as the terrain texture has to be created after the modules are initialized
521 // and has to happen before the region is registered with the grid. 521 // and has to happen before the region is registered with the grid.
522 scene.CreateTerrainTexture(false); 522 scene.CreateTerrainTexture(false);
523 scene.LoadRegionBanlist();
524 523
525 try 524 try
526 { 525 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index b170f28..2c05097 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -166,6 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
166 private GenericCall4 handlerDeRezObject = null; //OnDeRezObject; 166 private GenericCall4 handlerDeRezObject = null; //OnDeRezObject;
167 private ModifyTerrain handlerModifyTerrain = null; 167 private ModifyTerrain handlerModifyTerrain = null;
168 private BakeTerrain handlerBakeTerrain = null; 168 private BakeTerrain handlerBakeTerrain = null;
169 private EstateChangeInfo handlerEstateChangeInfo = null;
169 private Action<IClientAPI> handlerRegionHandShakeReply = null; //OnRegionHandShakeReply; 170 private Action<IClientAPI> handlerRegionHandShakeReply = null; //OnRegionHandShakeReply;
170 private GenericCall2 handlerRequestWearables = null; //OnRequestWearables; 171 private GenericCall2 handlerRequestWearables = null; //OnRequestWearables;
171 private Action<IClientAPI> handlerRequestAvatarsData = null; //OnRequestAvatarsData; 172 private Action<IClientAPI> handlerRequestAvatarsData = null; //OnRequestAvatarsData;
@@ -920,6 +921,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
920 public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest; 921 public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest;
921 public event SetRegionTerrainSettings OnSetRegionTerrainSettings; 922 public event SetRegionTerrainSettings OnSetRegionTerrainSettings;
922 public event BakeTerrain OnBakeTerrain; 923 public event BakeTerrain OnBakeTerrain;
924 public event EstateChangeInfo OnEstateChangeInfo;
923 public event EstateRestartSimRequest OnEstateRestartSimRequest; 925 public event EstateRestartSimRequest OnEstateRestartSimRequest;
924 public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest; 926 public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest;
925 public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest; 927 public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest;
@@ -2614,18 +2616,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2614 this.OutPacket(packet, ThrottleOutPacketType.Task); 2616 this.OutPacket(packet, ThrottleOutPacketType.Task);
2615 } 2617 }
2616 2618
2617 public void SendBannedUserList(LLUUID invoice, List<RegionBanListItem> banlist, uint estateID) 2619 public void SendBannedUserList(LLUUID invoice, EstateBan[] bl, uint estateID)
2618 { 2620 {
2619 RegionBanListItem[] bl = banlist.ToArray(); 2621 List<LLUUID>BannedUsers = new List<LLUUID>();
2620
2621 LLUUID[] BannedUsers = new LLUUID[bl.Length];
2622
2623 2622
2624 for (int i = 0; i < bl.Length; i++) 2623 for (int i = 0; i < bl.Length; i++)
2625 { 2624 {
2626 if (bl[i] == null) 2625 if (bl[i] == null)
2627 continue; 2626 continue;
2628 BannedUsers[i] = bl[i].bannedUUID; 2627 if (bl[i].bannedUUID == LLUUID.Zero)
2628 continue;
2629 BannedUsers.Add(bl[i].bannedUUID);
2629 } 2630 }
2630 2631
2631 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); 2632 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
@@ -2635,9 +2636,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2635 packet.MethodData.Invoice = invoice; 2636 packet.MethodData.Invoice = invoice;
2636 packet.MethodData.Method = Helpers.StringToField("setaccess"); 2637 packet.MethodData.Method = Helpers.StringToField("setaccess");
2637 2638
2638 EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Length]; 2639 EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count];
2639 2640
2640 for (int i = 0; i < (6 + BannedUsers.Length); i++) 2641 for (int i = 0; i < (6 + BannedUsers.Count); i++)
2641 { 2642 {
2642 returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock(); 2643 returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
2643 } 2644 }
@@ -2647,12 +2648,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2647 returnblock[j].Parameter = Helpers.StringToField(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++; 2648 returnblock[j].Parameter = Helpers.StringToField(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++;
2648 returnblock[j].Parameter = Helpers.StringToField("0"); j++; 2649 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
2649 returnblock[j].Parameter = Helpers.StringToField("0"); j++; 2650 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
2650 returnblock[j].Parameter = Helpers.StringToField(BannedUsers.Length.ToString()); j++; 2651 returnblock[j].Parameter = Helpers.StringToField(BannedUsers.Count.ToString()); j++;
2651 returnblock[j].Parameter = Helpers.StringToField("0"); j++; 2652 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
2652 2653
2653 for (int i = 0; i < BannedUsers.Length; i++) 2654 foreach (LLUUID banned in BannedUsers)
2654 { 2655 {
2655 returnblock[j].Parameter = BannedUsers[i].GetBytes(); j++; 2656 returnblock[j].Parameter = banned.GetBytes(); j++;
2656 } 2657 }
2657 packet.ParamList = returnblock; 2658 packet.ParamList = returnblock;
2658 packet.Header.Reliable = false; 2659 packet.Header.Reliable = false;
@@ -2687,11 +2688,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2687 this.OutPacket(rinfopack, ThrottleOutPacketType.Task); 2688 this.OutPacket(rinfopack, ThrottleOutPacketType.Task);
2688 } 2689 }
2689 2690
2690 public void SendEstateCovenantInformation() 2691 public void SendEstateCovenantInformation(LLUUID covenant)
2691 { 2692 {
2692 EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); 2693 EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket();
2693 EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); 2694 EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
2694 edata.CovenantID = m_scene.RegionInfo.CovenantID; 2695 edata.CovenantID = covenant;
2695 edata.CovenantTimestamp = 0; 2696 edata.CovenantTimestamp = 0;
2696 edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; 2697 edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
2697 edata.EstateName = 2698 edata.EstateName =
@@ -2700,7 +2701,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2700 this.OutPacket(einfopack, ThrottleOutPacketType.Task); 2701 this.OutPacket(einfopack, ThrottleOutPacketType.Task);
2701 } 2702 }
2702 2703
2703 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID) 2704 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
2704 { 2705 {
2705 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); 2706 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
2706 packet.MethodData.Invoice = invoice; 2707 packet.MethodData.Invoice = invoice;
@@ -2718,13 +2719,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2718 returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString()); 2719 returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString());
2719 returnblock[2].Parameter = Helpers.StringToField(estateID.ToString()); 2720 returnblock[2].Parameter = Helpers.StringToField(estateID.ToString());
2720 2721
2721 // TODO: Resolve Magic numbers here 2722 returnblock[3].Parameter = Helpers.StringToField(estateFlags.ToString());
2722 returnblock[3].Parameter = Helpers.StringToField("269516800"); 2723 returnblock[4].Parameter = Helpers.StringToField(sunPosition.ToString());
2723 returnblock[4].Parameter = Helpers.StringToField("0"); 2724 returnblock[5].Parameter = Helpers.StringToField(parentEstate.ToString());
2724 returnblock[5].Parameter = Helpers.StringToField("1"); 2725 returnblock[6].Parameter = Helpers.StringToField(covenant.ToString());
2725 returnblock[6].Parameter = Helpers.StringToField(m_scene.RegionInfo.RegionID.ToString()); 2726 returnblock[7].Parameter = Helpers.StringToField("1160895077"); // what is this?
2726 returnblock[7].Parameter = Helpers.StringToField("1160895077"); 2727 returnblock[8].Parameter = Helpers.StringToField("1"); // what is this?
2727 returnblock[8].Parameter = Helpers.StringToField("1");
2728 2728
2729 packet.ParamList = returnblock; 2729 packet.ParamList = returnblock;
2730 packet.Header.Reliable = false; 2730 packet.Header.Reliable = false;
@@ -5959,10 +5959,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5959 tmp = Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter); 5959 tmp = Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter);
5960 if (!tmp.Contains(".")) tmp += ".00"; 5960 if (!tmp.Contains(".")) tmp += ".00";
5961 float TerrainLowerLimit = (float)Convert.ToDecimal(tmp); 5961 float TerrainLowerLimit = (float)Convert.ToDecimal(tmp);
5962 bool UseEstateSun = convertParamStringToBool(messagePacket.ParamList[3].Parameter);
5962 bool UseFixedSun = convertParamStringToBool(messagePacket.ParamList[4].Parameter); 5963 bool UseFixedSun = convertParamStringToBool(messagePacket.ParamList[4].Parameter);
5963 float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter)); 5964 float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter));
5965 bool UseGlobal = convertParamStringToBool(messagePacket.ParamList[6].Parameter);
5966 bool EstateFixedSun = convertParamStringToBool(messagePacket.ParamList[7].Parameter);
5967 float EstateSunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[8].Parameter));
5964 5968
5965 OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour); 5969 OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseEstateSun, UseFixedSun, SunHour, UseGlobal, EstateFixedSun, EstateSunHour);
5966 5970
5967 } 5971 }
5968 catch (Exception ex) 5972 catch (Exception ex)
@@ -6076,6 +6080,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6076 } 6080 }
6077 break; 6081 break;
6078 6082
6083 case "estatechangeinfo":
6084 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
6085 {
6086 LLUUID invoice = messagePacket.MethodData.Invoice;
6087 LLUUID SenderID = messagePacket.AgentData.AgentID;
6088 UInt32 param1 = Convert.ToUInt32(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter));
6089 UInt32 param2 = Convert.ToUInt32(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
6090
6091 handlerEstateChangeInfo = OnEstateChangeInfo;
6092 if (handlerEstateChangeInfo != null)
6093 {
6094 handlerEstateChangeInfo(this, invoice, SenderID, param1, param2);
6095 }
6096 }
6097 break;
6098
6079 default: 6099 default:
6080 m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket.ToString()); 6100 m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket.ToString());
6081 break; 6101 break;
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 6f4a563..d8a6daf 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -623,7 +623,7 @@ namespace OpenSim.Region.Communications.OGS1
623 { 623 {
624 if (regions[i].RegionHandle == regionHandle) 624 if (regions[i].RegionHandle == regionHandle)
625 { 625 {
626 if (regions[i].CheckIfUserBanned(agentData.AgentID)) 626 if (regions[i].EstateSettings.IsBanned(agentData.AgentID))
627 { 627 {
628 banned = true; 628 banned = true;
629 break; 629 break;
@@ -1158,7 +1158,7 @@ namespace OpenSim.Region.Communications.OGS1
1158 { 1158 {
1159 if (regions[i].RegionHandle == regionHandle) 1159 if (regions[i].RegionHandle == regionHandle)
1160 { 1160 {
1161 if (regions[i].CheckIfUserBanned(agentID)) 1161 if (regions[i].EstateSettings.IsBanned(agentID))
1162 { 1162 {
1163 banned = true; 1163 banned = true;
1164 break; 1164 break;
diff --git a/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs b/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs
new file mode 100644
index 0000000..ecac2ca
--- /dev/null
+++ b/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs
@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using OpenSim.Framework;
30using libsecondlife;
31
32namespace OpenSim.Region.Environment.Interfaces
33{
34 public interface IEstateDataStore
35 {
36 void Initialise(string connectstring);
37
38 EstateSettings LoadEstateSettings(LLUUID regionID);
39 void StoreEstateSettings(EstateSettings es);
40 }
41}
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
index c189f95..0316f20 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -72,10 +72,6 @@ namespace OpenSim.Region.Environment.Interfaces
72 void RemoveLandObject(LLUUID globalID); 72 void RemoveLandObject(LLUUID globalID);
73 List<LandData> LoadLandObjects(LLUUID regionUUID); 73 List<LandData> LoadLandObjects(LLUUID regionUUID);
74 74
75 List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID);
76 void AddToRegionBanlist(RegionBanListItem item);
77 void RemoveFromRegionBanlist(RegionBanListItem item);
78
79 void StoreRegionSettings(RegionSettings rs); 75 void StoreRegionSettings(RegionSettings rs);
80 RegionSettings LoadRegionSettings(LLUUID regionUUID); 76 RegionSettings LoadRegionSettings(LLUUID regionUUID);
81 77
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
index ac6a075..c5c0370 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
@@ -49,9 +49,26 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
49 49
50 private void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice) 50 private void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice)
51 { 51 {
52 remote_client.SendDetailedEstateData(invoice,m_scene.RegionInfo.EstateSettings.estateName,m_scene.RegionInfo.EstateSettings.estateID); 52 //SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
53 remote_client.SendEstateManagersList(invoice,m_scene.RegionInfo.EstateSettings.estateManagers,m_scene.RegionInfo.EstateSettings.estateID); 53
54 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); 54 uint sun = 0;
55 if(!m_scene.RegionInfo.EstateSettings.UseGlobalTime)
56 sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800;
57 remote_client.SendDetailedEstateData(invoice,
58 m_scene.RegionInfo.EstateSettings.EstateName,
59 m_scene.RegionInfo.EstateSettings.EstateID,
60 m_scene.RegionInfo.EstateSettings.ParentEstateID,
61 GetEstateFlags(),
62 sun,
63 m_scene.RegionInfo.RegionSettings.Covenant);
64
65 remote_client.SendEstateManagersList(invoice,
66 m_scene.RegionInfo.EstateSettings.EstateManagers,
67 m_scene.RegionInfo.EstateSettings.EstateID);
68
69 remote_client.SendBannedUserList(invoice,
70 m_scene.RegionInfo.EstateSettings.EstateBans,
71 m_scene.RegionInfo.EstateSettings.EstateID);
55 } 72 }
56 73
57 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, 74 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor,
@@ -150,8 +167,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
150 sendRegionHandshakeToAll(); 167 sendRegionHandshakeToAll();
151 } 168 }
152 169
153 public void setRegionTerrainSettings(float WaterHeight, float TerrainRaiseLimit, float TerrainLowerLimit, 170 public void setRegionTerrainSettings(float WaterHeight,
154 bool UseFixedSun, float SunHour) 171 float TerrainRaiseLimit, float TerrainLowerLimit,
172 bool UseEstateSun, bool UseFixedSun, float SunHour,
173 bool UseGlobal, bool EstateFixedSun, float EstateSunHour)
155 { 174 {
156 // Water Height 175 // Water Height
157 m_scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight; 176 m_scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight;
@@ -161,10 +180,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
161 m_scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit; 180 m_scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit;
162 181
163 // Time of day / fixed sun 182 // Time of day / fixed sun
183 m_scene.RegionInfo.RegionSettings.UseEstateSun = UseEstateSun;
164 m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; 184 m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
165 m_scene.RegionInfo.RegionSettings.SunPosition = SunHour; 185 m_scene.RegionInfo.RegionSettings.SunPosition = SunHour;
166 186
167 m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseFixedSun, SunHour); 187 m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseEstateSun, SunHour);
168 188
169 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); 189 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
170 //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); 190 //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString());
@@ -180,20 +200,23 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
180 200
181 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID) 201 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID)
182 { 202 {
183 m_scene.RegionInfo.CovenantID = estateCovenantID; 203 m_scene.RegionInfo.RegionSettings.Covenant = estateCovenantID;
184 m_scene.RegionInfo.SaveEstatecovenantUUID(estateCovenantID); 204 m_scene.RegionInfo.RegionSettings.Save();
185 } 205 }
186 206
187 private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user) 207 private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user)
188 { 208 {
189 // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc. 209 // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc.
190 210
211 if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID)
212 return; // never process owner
213
191 switch (estateAccessType) 214 switch (estateAccessType)
192 { 215 {
193 case 64: 216 case 64:
194 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 217 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
195 { 218 {
196 RegionBanListItem[] banlistcheck = m_scene.RegionInfo.regionBanlist.ToArray(); 219 EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
197 220
198 bool alreadyInList = false; 221 bool alreadyInList = false;
199 222
@@ -209,15 +232,15 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
209 if (!alreadyInList) 232 if (!alreadyInList)
210 { 233 {
211 234
212 RegionBanListItem item = new RegionBanListItem(); 235 EstateBan item = new EstateBan();
213 236
214 item.bannedUUID = user; 237 item.bannedUUID = user;
215 item.regionUUID = m_scene.RegionInfo.RegionID; 238 item.estateID = m_scene.RegionInfo.EstateSettings.EstateID;
216 item.bannedIP = "0.0.0.0"; 239 item.bannedIP = "0.0.0.0";
217 item.bannedIPHostMask = "0.0.0.0"; 240 item.bannedIPHostMask = "0.0.0.0";
218 241
219 m_scene.RegionInfo.regionBanlist.Add(item); 242 m_scene.RegionInfo.EstateSettings.AddBan(item);
220 m_scene.AddToRegionBanlist(item); 243 m_scene.RegionInfo.EstateSettings.Save();
221 244
222 ScenePresence s = m_scene.GetScenePresence(user); 245 ScenePresence s = m_scene.GetScenePresence(user);
223 if (s != null) 246 if (s != null)
@@ -231,7 +254,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
231 remote_client.SendAlertMessage("User is already on the region ban list"); 254 remote_client.SendAlertMessage("User is already on the region ban list");
232 } 255 }
233 //m_scene.RegionInfo.regionBanlist.Add(Manager(user); 256 //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
234 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); 257 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
235 } 258 }
236 else 259 else
237 { 260 {
@@ -241,10 +264,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
241 case 128: 264 case 128:
242 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 265 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
243 { 266 {
244 RegionBanListItem[] banlistcheck = m_scene.RegionInfo.regionBanlist.ToArray(); 267 EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
245 268
246 bool alreadyInList = false; 269 bool alreadyInList = false;
247 RegionBanListItem listitem = null; 270 EstateBan listitem = null;
248 271
249 for (int i = 0; i < banlistcheck.Length; i++) 272 for (int i = 0; i < banlistcheck.Length; i++)
250 { 273 {
@@ -258,15 +281,15 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
258 } 281 }
259 if (alreadyInList && listitem != null) 282 if (alreadyInList && listitem != null)
260 { 283 {
261 m_scene.RegionInfo.regionBanlist.Remove(listitem); 284 m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.bannedUUID);
262 m_scene.RemoveFromRegionBanlist(listitem); 285 m_scene.RegionInfo.EstateSettings.Save();
263 } 286 }
264 else 287 else
265 { 288 {
266 remote_client.SendAlertMessage("User is not on the region ban list"); 289 remote_client.SendAlertMessage("User is not on the region ban list");
267 } 290 }
268 //m_scene.RegionInfo.regionBanlist.Add(Manager(user); 291 //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
269 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); 292 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
270 } 293 }
271 else 294 else
272 { 295 {
@@ -280,7 +303,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
280 if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 303 if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
281 { 304 {
282 m_scene.RegionInfo.EstateSettings.AddEstateManager(user); 305 m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
283 remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.estateManagers, m_scene.RegionInfo.EstateSettings.estateID); 306 m_scene.RegionInfo.EstateSettings.Save();
307 remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
284 } 308 }
285 else 309 else
286 { 310 {
@@ -294,7 +318,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
294 if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 318 if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
295 { 319 {
296 m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); 320 m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
297 remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.estateManagers, m_scene.RegionInfo.EstateSettings.estateID); 321 m_scene.RegionInfo.EstateSettings.Save();
322
323 remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
298 } 324 }
299 else 325 else
300 { 326 {
@@ -358,28 +384,24 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
358 { 384 {
359 385
360 RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs(); 386 RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs();
361 args.billableFactor = m_scene.RegionInfo.EstateSettings.billableFactor; 387 args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor;
362 args.estateID = m_scene.RegionInfo.EstateSettings.estateID; 388 args.estateID = m_scene.RegionInfo.EstateSettings.EstateID;
363 args.maxAgents = (byte)m_scene.RegionInfo.RegionSettings.AgentLimit; 389 args.maxAgents = (byte)m_scene.RegionInfo.RegionSettings.AgentLimit;
364 args.objectBonusFactor = (float)m_scene.RegionInfo.RegionSettings.ObjectBonus; 390 args.objectBonusFactor = (float)m_scene.RegionInfo.RegionSettings.ObjectBonus;
365 args.parentEstateID = m_scene.RegionInfo.EstateSettings.parentEstateID; 391 args.parentEstateID = m_scene.RegionInfo.EstateSettings.ParentEstateID;
366 args.pricePerMeter = m_scene.RegionInfo.EstateSettings.pricePerMeter; 392 args.pricePerMeter = m_scene.RegionInfo.EstateSettings.PricePerMeter;
367 args.redirectGridX = m_scene.RegionInfo.EstateSettings.redirectGridX; 393 args.redirectGridX = m_scene.RegionInfo.EstateSettings.RedirectGridX;
368 args.redirectGridY = m_scene.RegionInfo.EstateSettings.redirectGridY; 394 args.redirectGridY = m_scene.RegionInfo.EstateSettings.RedirectGridY;
369 args.regionFlags = GetRegionFlags(); 395 args.regionFlags = GetRegionFlags();
370 byte mature = 13; 396 byte mature = 13;
371 if(m_scene.RegionInfo.RegionSettings.Maturity == 1) 397 if(m_scene.RegionInfo.RegionSettings.Maturity == 1)
372 mature = 21; 398 mature = 21;
373 args.simAccess = mature; 399 args.simAccess = mature;
374 400
375 if (m_scene.RegionInfo.RegionSettings.FixedSun) 401 args.sunHour = (float)m_scene.RegionInfo.RegionSettings.SunPosition;
376 args.sunHour = (float)m_scene.RegionInfo.RegionSettings.SunPosition;
377 else
378 args.sunHour = m_scene.EventManager.GetSunLindenHour();
379
380 args.terrainLowerLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit; 402 args.terrainLowerLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit;
381 args.terrainRaiseLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit; 403 args.terrainRaiseLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit;
382 args.useEstateSun = !m_scene.RegionInfo.RegionSettings.FixedSun; 404 args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun;
383 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; 405 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
384 args.simName = m_scene.RegionInfo.RegionName; 406 args.simName = m_scene.RegionInfo.RegionName;
385 407
@@ -387,9 +409,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
387 remote_client.SendRegionInfoToEstateMenu(args); 409 remote_client.SendRegionInfoToEstateMenu(args);
388 } 410 }
389 411
390 private static void HandleEstateCovenantRequest(IClientAPI remote_client) 412 private void HandleEstateCovenantRequest(IClientAPI remote_client)
391 { 413 {
392 remote_client.SendEstateCovenantInformation(); 414 remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant);
393 } 415 }
394 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) 416 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient)
395 { 417 {
@@ -508,7 +530,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
508 { 530 {
509 RegionHandshakeArgs args = new RegionHandshakeArgs(); 531 RegionHandshakeArgs args = new RegionHandshakeArgs();
510 bool estatemanager = false; 532 bool estatemanager = false;
511 LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.estateManagers; 533 LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.EstateManagers;
512 for (int i = 0; i < EstateManagers.Length; i++) 534 for (int i = 0; i < EstateManagers.Length; i++)
513 { 535 {
514 if (EstateManagers[i] == remoteClient.AgentId) 536 if (EstateManagers[i] == remoteClient.AgentId)
@@ -517,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
517 539
518 args.isEstateManager = estatemanager; 540 args.isEstateManager = estatemanager;
519 541
520 args.billableFactor = m_scene.RegionInfo.EstateSettings.billableFactor; 542 args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor;
521 args.terrainStartHeight0 = (float)m_scene.RegionInfo.RegionSettings.Elevation1SW; 543 args.terrainStartHeight0 = (float)m_scene.RegionInfo.RegionSettings.Elevation1SW;
522 args.terrainHeightRange0 = (float)m_scene.RegionInfo.RegionSettings.Elevation2SW; 544 args.terrainHeightRange0 = (float)m_scene.RegionInfo.RegionSettings.Elevation2SW;
523 args.terrainStartHeight1 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NW; 545 args.terrainStartHeight1 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NW;
@@ -554,6 +576,73 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
554 ); 576 );
555 } 577 }
556 578
579 public void handleEstateChangeInfo(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, UInt32 parms1, UInt32 parms2)
580 {
581 if(parms2 == 0)
582 {
583 m_scene.RegionInfo.EstateSettings.UseGlobalTime = true;
584 m_scene.RegionInfo.EstateSettings.SunPosition = 0.0;
585 }
586 else
587 {
588 m_scene.RegionInfo.EstateSettings.UseGlobalTime = false;
589 m_scene.RegionInfo.EstateSettings.SunPosition = (double)(parms2 - 0x1800)/1024.0;
590 }
591
592 if((parms1 & 0x00000010) != 0)
593 m_scene.RegionInfo.EstateSettings.FixedSun = true;
594 else
595 m_scene.RegionInfo.EstateSettings.FixedSun = false;
596
597 if((parms1 & 0x00008000) != 0)
598 m_scene.RegionInfo.EstateSettings.PublicAccess = true;
599 else
600 m_scene.RegionInfo.EstateSettings.PublicAccess = false;
601
602 if((parms1 & 0x10000000) != 0)
603 m_scene.RegionInfo.EstateSettings.AllowVoice = true;
604 else
605 m_scene.RegionInfo.EstateSettings.AllowVoice = false;
606
607 if((parms1 & 0x00100000) != 0)
608 m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = true;
609 else
610 m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = false;
611
612 if((parms1 & 0x00800000) != 0)
613 m_scene.RegionInfo.EstateSettings.DenyAnonymous = true;
614 else
615 m_scene.RegionInfo.EstateSettings.DenyAnonymous = false;
616
617 if((parms1 & 0x01000000) != 0)
618 m_scene.RegionInfo.EstateSettings.DenyIdentified = true;
619 else
620 m_scene.RegionInfo.EstateSettings.DenyIdentified = false;
621
622 if((parms1 & 0x02000000) != 0)
623 m_scene.RegionInfo.EstateSettings.DenyTransacted = true;
624 else
625 m_scene.RegionInfo.EstateSettings.DenyTransacted = false;
626
627 m_scene.RegionInfo.EstateSettings.Save();
628
629 float sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition;
630 if(m_scene.RegionInfo.RegionSettings.UseEstateSun)
631 {
632 sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition;
633 if(m_scene.RegionInfo.EstateSettings.UseGlobalTime)
634 sun = m_scene.EventManager.GetSunLindenHour();
635 }
636
637 m_scene.EventManager.TriggerEstateToolsTimeUpdate(
638 m_scene.RegionInfo.RegionHandle,
639 m_scene.RegionInfo.EstateSettings.FixedSun ||
640 m_scene.RegionInfo.RegionSettings.FixedSun,
641 m_scene.RegionInfo.RegionSettings.UseEstateSun, sun);
642
643 sendDetailedEstateData(remoteClient, invoice);
644 }
645
557 #endregion 646 #endregion
558 647
559 #region IRegionModule Members 648 #region IRegionModule Members
@@ -594,8 +683,12 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
594 setRegionTerrainSettings(height, 683 setRegionTerrainSettings(height,
595 (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit, 684 (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit,
596 (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit, 685 (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit,
686 m_scene.RegionInfo.RegionSettings.UseEstateSun,
597 m_scene.RegionInfo.RegionSettings.FixedSun, 687 m_scene.RegionInfo.RegionSettings.FixedSun,
598 (float)m_scene.RegionInfo.RegionSettings.SunPosition); 688 (float)m_scene.RegionInfo.RegionSettings.SunPosition,
689 m_scene.RegionInfo.EstateSettings.UseGlobalTime,
690 m_scene.RegionInfo.EstateSettings.FixedSun,
691 (float)m_scene.RegionInfo.EstateSettings.SunPosition);
599 692
600 sendRegionInfoPacketToAll(); 693 sendRegionInfoPacketToAll();
601 } 694 }
@@ -613,6 +706,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
613 client.OnSetRegionTerrainSettings += setRegionTerrainSettings; 706 client.OnSetRegionTerrainSettings += setRegionTerrainSettings;
614 client.OnEstateRestartSimRequest += handleEstateRestartSimRequest; 707 client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
615 client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest; 708 client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
709 client.OnEstateChangeInfo += handleEstateChangeInfo;
616 client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest; 710 client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
617 client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage; 711 client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
618 client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage; 712 client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
@@ -652,41 +746,53 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
652 if(m_scene.RegionInfo.RegionSettings.BlockShowInSearch) 746 if(m_scene.RegionInfo.RegionSettings.BlockShowInSearch)
653 flags |= (Simulator.RegionFlags)(1 << 29); 747 flags |= (Simulator.RegionFlags)(1 << 29);
654 748
655 // Partially implemented
656 //
657 if(m_scene.RegionInfo.RegionSettings.FixedSun) 749 if(m_scene.RegionInfo.RegionSettings.FixedSun)
658 flags |= Simulator.RegionFlags.SunFixed; 750 flags |= Simulator.RegionFlags.SunFixed;
751 if(m_scene.RegionInfo.RegionSettings.Sandbox)
752 flags |= Simulator.RegionFlags.Sandbox;
753
754 // Handled in LandObject.cs: AllowLandmark
755 // Handled in LandObject.cs: AllowSetHome
659 756
660 // Not implemented
661 //
662 // TODO: ExternallyVisible
663 flags |= Simulator.RegionFlags.ExternallyVisible;
664 // TODO: PublicAllowed
665 flags |= Simulator.RegionFlags.PublicAllowed;
666 // TODO: AllowDirectTeleport
667 flags |= Simulator.RegionFlags.AllowDirectTeleport;
668 // TODO: AllowVoice
669 flags |= Simulator.RegionFlags.AllowVoice;
670
671 // TDOD: AllowLandmark
672 // TDOD: AllowSetHome
673 // TODO: ResetHomeOnTeleport
674 // TODO: TaxFree ? (Linden-ism)
675 // TODO: Sandbox ?
676 // TODO: SkipUpdateInterestList 757 // TODO: SkipUpdateInterestList
677 // TODO: ExternallyVisible
678 // TODO: DenyAnonymous
679 // TODO: DenyIdentified
680 // TODO: DenyTransacted
681 // TODO: AbuseEmailToEstateOwner
682 // TODO: BlockDwell
683 // TODO: EstateSkipScripts
684 758
685 // Omitted 759 // Omitted
686 // 760 //
687 // Omitted: NullLayer (what is that?) 761 // Omitted: NullLayer (what is that?)
688 // Omitted: SkipAgentAction (what does it do?) 762 // Omitted: SkipAgentAction (what does it do?)
689 // Omitted: MainlandVisible (Do we need it) 763
764 return (uint)flags;
765 }
766
767 public uint GetEstateFlags()
768 {
769 Simulator.RegionFlags flags = Simulator.RegionFlags.None;
770
771 if(m_scene.RegionInfo.EstateSettings.FixedSun)
772 flags |= Simulator.RegionFlags.SunFixed;
773 if(m_scene.RegionInfo.EstateSettings.PublicAccess)
774 flags |= (Simulator.RegionFlags.PublicAllowed |
775 Simulator.RegionFlags.ExternallyVisible);
776 if(m_scene.RegionInfo.EstateSettings.AllowVoice)
777 flags |= Simulator.RegionFlags.AllowVoice;
778 if(m_scene.RegionInfo.EstateSettings.AllowDirectTeleport)
779 flags |= Simulator.RegionFlags.AllowDirectTeleport;
780 if(m_scene.RegionInfo.EstateSettings.DenyAnonymous)
781 flags |= Simulator.RegionFlags.DenyAnonymous;
782 if(m_scene.RegionInfo.EstateSettings.DenyIdentified)
783 flags |= Simulator.RegionFlags.DenyIdentified;
784 if(m_scene.RegionInfo.EstateSettings.DenyTransacted)
785 flags |= Simulator.RegionFlags.DenyTransacted;
786 if(m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner)
787 flags |= Simulator.RegionFlags.AbuseEmailToEstateOwner;
788 if(m_scene.RegionInfo.EstateSettings.BlockDwell)
789 flags |= Simulator.RegionFlags.BlockDwell;
790 if(m_scene.RegionInfo.EstateSettings.EstateSkipScripts)
791 flags |= Simulator.RegionFlags.EstateSkipScripts;
792 if(m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
793 flags |= Simulator.RegionFlags.ResetHomeOnTeleport;
794 if(m_scene.RegionInfo.EstateSettings.TaxFree)
795 flags |= Simulator.RegionFlags.TaxFree;
690 796
691 return (uint)flags; 797 return (uint)flags;
692 } 798 }
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index e52896a..5aed2a7 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -162,9 +162,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land
162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
163 { 163 {
164 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); 164 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
165 uint regionFlags = 67108864; 165 uint regionFlags = 336723974 & ~((uint)(Simulator.RegionFlags.AllowLandmark | Simulator.RegionFlags.AllowSetHome));
166 if(estateModule != null) 166 if(estateModule != null)
167 regionFlags = estateModule.GetRegionFlags(); 167 regionFlags = estateModule.GetRegionFlags();
168 if((landData.landFlags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0)
169 regionFlags |= (uint)Simulator.RegionFlags.AllowLandmark;
170 if(landData.ownerID == remote_client.AgentId)
171 regionFlags |= (uint)Simulator.RegionFlags.AllowSetHome;
168 remote_client.SendLandProperties(remote_client, sequence_id, 172 remote_client.SendLandProperties(remote_client, sequence_id,
169 snap_selection, request_result, landData, 173 snap_selection, request_result, landData,
170 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, 174 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 10971db..040b9b7 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -291,6 +291,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
291 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; 291 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
292 public event EstateDebugRegionRequest OnEstateDebugRegionRequest; 292 public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
293 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; 293 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
294 public event EstateChangeInfo OnEstateChangeInfo;
294 public event ScriptReset OnScriptReset; 295 public event ScriptReset OnScriptReset;
295 public event GetScriptRunning OnGetScriptRunning; 296 public event GetScriptRunning OnGetScriptRunning;
296 public event SetScriptRunning OnSetScriptRunning; 297 public event SetScriptRunning OnSetScriptRunning;
@@ -752,17 +753,17 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
752 { 753 {
753 } 754 }
754 755
755 public void SendBannedUserList(LLUUID invoice, List<RegionBanListItem> banlist, uint estateID) 756 public void SendBannedUserList(LLUUID invoice, EstateBan[] banlist, uint estateID)
756 { 757 {
757 } 758 }
758 759
759 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) 760 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
760 { 761 {
761 } 762 }
762 public void SendEstateCovenantInformation() 763 public void SendEstateCovenantInformation(LLUUID covenant)
763 { 764 {
764 } 765 }
765 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID) 766 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
766 { 767 {
767 } 768 }
768 769
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index 41bb610..b0d9a26 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -246,17 +246,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
246 246
247 protected bool IsEstateManager(LLUUID user) 247 protected bool IsEstateManager(LLUUID user)
248 { 248 {
249 if (user != LLUUID.Zero) 249 return m_scene.RegionInfo.EstateSettings.IsEstateManager(user);
250 {
251 LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers;
252 foreach (LLUUID estatemanager in estatemanagers)
253 {
254 if (estatemanager == user)
255 return true;
256 }
257 }
258
259 return false;
260 } 250 }
261#endregion 251#endregion
262 252
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ad9646f..4aa9cf9 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -271,9 +271,14 @@ namespace OpenSim.Region.Environment.Scenes
271 // Load region settings 271 // Load region settings
272 // First try database 272 // First try database
273 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); 273 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
274
275 // Hook up save event 274 // Hook up save event
276 m_regInfo.RegionSettings.OnSave += m_storageManager.DataStore.StoreRegionSettings; 275 m_regInfo.RegionSettings.OnSave += m_storageManager.DataStore.StoreRegionSettings;
276 if(m_storageManager.EstateDataStore != null)
277 {
278 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID);
279 m_regInfo.EstateSettings.OnSave += m_storageManager.EstateDataStore.StoreEstateSettings;
280 }
281
277 282
278 283
279 //Bind Storage Manager functions to some land manager functions for this scene 284 //Bind Storage Manager functions to some land manager functions for this scene
@@ -1445,20 +1450,6 @@ namespace OpenSim.Region.Environment.Scenes
1445 } 1450 }
1446 } 1451 }
1447 1452
1448 public void LoadRegionBanlist()
1449 {
1450 List<RegionBanListItem> regionbanlist = m_storageManager.DataStore.LoadRegionBanList(m_regInfo.RegionID);
1451 m_regInfo.regionBanlist = regionbanlist;
1452 }
1453 public void AddToRegionBanlist(RegionBanListItem item)
1454 {
1455 m_storageManager.DataStore.AddToRegionBanlist(item);
1456 }
1457
1458 public void RemoveFromRegionBanlist(RegionBanListItem item)
1459 {
1460 m_storageManager.DataStore.RemoveFromRegionBanlist(item);
1461 }
1462 #endregion 1453 #endregion
1463 1454
1464 #region Primitives Methods 1455 #region Primitives Methods
@@ -1916,7 +1907,7 @@ namespace OpenSim.Region.Environment.Scenes
1916 SceneObjectPart RootPrim = GetSceneObjectPart(primID); 1907 SceneObjectPart RootPrim = GetSceneObjectPart(primID);
1917 if (RootPrim != null) 1908 if (RootPrim != null)
1918 { 1909 {
1919 if (m_regInfo.CheckIfUserBanned(RootPrim.OwnerID)) 1910 if (m_regInfo.EstateSettings.IsBanned(RootPrim.OwnerID))
1920 { 1911 {
1921 SceneObjectGroup grp = RootPrim.ParentGroup; 1912 SceneObjectGroup grp = RootPrim.ParentGroup;
1922 if (grp != null) 1913 if (grp != null)
@@ -2410,7 +2401,7 @@ namespace OpenSim.Region.Environment.Scenes
2410 { 2401 {
2411 if (regionHandle == m_regInfo.RegionHandle) 2402 if (regionHandle == m_regInfo.RegionHandle)
2412 { 2403 {
2413 if (m_regInfo.CheckIfUserBanned(agent.AgentID)) 2404 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
2414 { 2405 {
2415 m_log.WarnFormat( 2406 m_log.WarnFormat(
2416 "[CONNECTION DEBUGGING]: Denied access to: {0} [{1}] at {2} because the user is on the region banlist", 2407 "[CONNECTION DEBUGGING]: Denied access to: {0} [{1}] at {2} because the user is on the region banlist",
diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs
index b9a42a2..768e12c 100644
--- a/OpenSim/Region/Environment/StorageManager.cs
+++ b/OpenSim/Region/Environment/StorageManager.cs
@@ -43,6 +43,13 @@ namespace OpenSim.Region.Environment
43 get { return m_dataStore; } 43 get { return m_dataStore; }
44 } 44 }
45 45
46 private IEstateDataStore m_estateDataStore;
47
48 public IEstateDataStore EstateDataStore
49 {
50 get { return m_estateDataStore; }
51 }
52
46 public StorageManager(IRegionDataStore storage) 53 public StorageManager(IRegionDataStore storage)
47 { 54 {
48 m_dataStore = storage; 55 m_dataStore = storage;
@@ -69,6 +76,17 @@ namespace OpenSim.Region.Environment
69 76
70 m_log.Info("[DATASTORE]: Added IRegionDataStore Interface"); 77 m_log.Info("[DATASTORE]: Added IRegionDataStore Interface");
71 } 78 }
79
80 typeInterface = pluginType.GetInterface("IEstateDataStore", true);
81
82 if(typeInterface != null)
83 {
84 IEstateDataStore estPlug =
85 (IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
86 estPlug.Initialise(connectionstring);
87
88 m_estateDataStore = estPlug;
89 }
72 } 90 }
73 } 91 }
74 92
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 94983ee..6179ccf 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -158,6 +158,7 @@ namespace OpenSim.Region.Examples.SimpleModule
158 public event ObjectDeselect OnObjectDeselect; 158 public event ObjectDeselect OnObjectDeselect;
159 public event RegionInfoRequest OnRegionInfoRequest; 159 public event RegionInfoRequest OnRegionInfoRequest;
160 public event EstateCovenantRequest OnEstateCovenantRequest; 160 public event EstateCovenantRequest OnEstateCovenantRequest;
161 public event EstateChangeInfo OnEstateChangeInfo;
161 162
162 public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; 163 public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
163 164
@@ -741,17 +742,17 @@ namespace OpenSim.Region.Examples.SimpleModule
741 { 742 {
742 } 743 }
743 744
744 public void SendBannedUserList(LLUUID invoice, List<RegionBanListItem> banlist, uint estateID) 745 public void SendBannedUserList(LLUUID invoice, EstateBan[] banlist, uint estateID)
745 { 746 {
746 } 747 }
747 748
748 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) 749 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
749 { 750 {
750 } 751 }
751 public void SendEstateCovenantInformation() 752 public void SendEstateCovenantInformation(LLUUID covenant)
752 { 753 {
753 } 754 }
754 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID) 755 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
755 { 756 {
756 } 757 }
757 758
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
index 6dfcb3c..edbb1b7 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
@@ -322,23 +322,6 @@ namespace OpenSim.DataStore.MSSQL
322 return new List<LandData>(); 322 return new List<LandData>();
323 } 323 }
324 324
325 public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID)
326 {
327 List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>();
328 return regionbanlist;
329 }
330
331 public void AddToRegionBanlist(RegionBanListItem item)
332 {
333
334 }
335
336 public void RemoveFromRegionBanlist(RegionBanListItem item)
337 {
338
339 }
340
341
342 public void Commit() 325 public void Commit()
343 { 326 {
344 lock (ds) 327 lock (ds)