aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteRegionData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteRegionData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs114
1 files changed, 0 insertions, 114 deletions
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"]);