mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
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.
This commit is contained in:
@@ -62,7 +62,6 @@ namespace OpenSim.Data.SQLite
|
||||
private SqliteDataAdapter terrainDa;
|
||||
private SqliteDataAdapter landDa;
|
||||
private SqliteDataAdapter landAccessListDa;
|
||||
private SqliteDataAdapter regionBanListDa;
|
||||
|
||||
private SqliteConnection m_conn;
|
||||
|
||||
@@ -119,9 +118,6 @@ namespace OpenSim.Data.SQLite
|
||||
SqliteCommand landAccessListSelectCmd = new SqliteCommand(landAccessListSelect, m_conn);
|
||||
landAccessListDa = new SqliteDataAdapter(landAccessListSelectCmd);
|
||||
|
||||
SqliteCommand regionBanListSelectCmd = new SqliteCommand(regionbanListSelect, m_conn);
|
||||
regionBanListDa = new SqliteDataAdapter(regionBanListSelectCmd);
|
||||
|
||||
// This actually does the roll forward assembly stuff
|
||||
Assembly assem = GetType().Assembly;
|
||||
Migration m = new Migration(m_conn, assem, "RegionStore");
|
||||
@@ -157,10 +153,6 @@ namespace OpenSim.Data.SQLite
|
||||
ds.Tables.Add(createLandAccessListTable());
|
||||
setupLandAccessCommands(landAccessListDa, m_conn);
|
||||
|
||||
ds.Tables.Add(createRegionBanListTable());
|
||||
setupRegionBanCommands(regionBanListDa, m_conn);
|
||||
|
||||
|
||||
// WORKAROUND: This is a work around for sqlite on
|
||||
// windows, which gets really unhappy with blob columns
|
||||
// that have no sample data in them. At some point we
|
||||
@@ -201,15 +193,6 @@ namespace OpenSim.Data.SQLite
|
||||
m_log.Info("[REGION DB]: Caught fill error on landaccesslist table");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
regionBanListDa.Fill(ds.Tables["regionban"]);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Caught fill error on regionban table");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -900,21 +883,6 @@ namespace OpenSim.Data.SQLite
|
||||
return landaccess;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// create "regionban" table
|
||||
/// </summary>
|
||||
/// <returns>regionban datatable</returns>
|
||||
private static DataTable createRegionBanListTable()
|
||||
{
|
||||
DataTable regionbanlist = new DataTable("regionban");
|
||||
createCol(regionbanlist, "regionUUID", typeof(String));
|
||||
createCol(regionbanlist, "bannedUUID", typeof(String));
|
||||
createCol(regionbanlist, "bannedIp", typeof(String));
|
||||
createCol(regionbanlist, "bannedIpHostMask", typeof(String));
|
||||
|
||||
return regionbanlist;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Convert between ADO.NET <=> OpenSim Objects
|
||||
@@ -1178,74 +1146,6 @@ namespace OpenSim.Data.SQLite
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Load a region banlist
|
||||
/// </summary>
|
||||
/// <param name="regionUUID">the region UUID</param>
|
||||
/// <returns>The banlist</returns>
|
||||
public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID)
|
||||
{
|
||||
List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>();
|
||||
lock (ds)
|
||||
{
|
||||
DataTable regionban = ds.Tables["regionban"];
|
||||
string searchExp = "regionUUID = '" + regionUUID.ToString() + "'";
|
||||
DataRow[] rawbanlist = regionban.Select(searchExp);
|
||||
foreach (DataRow rawbanrow in rawbanlist)
|
||||
{
|
||||
RegionBanListItem rbli = new RegionBanListItem();
|
||||
LLUUID tmpvalue = LLUUID.Zero;
|
||||
|
||||
rbli.regionUUID = regionUUID;
|
||||
|
||||
if (Helpers.TryParse((string)rawbanrow["bannedUUID"], out tmpvalue))
|
||||
rbli.bannedUUID = tmpvalue;
|
||||
|
||||
rbli.bannedIP = (string)rawbanrow["bannedIp"];
|
||||
rbli.bannedIPHostMask = (string)rawbanrow["bannedIpHostMask"];
|
||||
regionbanlist.Add(rbli);
|
||||
}
|
||||
}
|
||||
return regionbanlist;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add en entry into region banlist
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public void AddToRegionBanlist(RegionBanListItem item)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
using (SqliteCommand cmd = new SqliteCommand("insert into regionban (regionUUID, bannedUUID, bannedIp, bannedIpHostMask) values (:regionUUID,:bannedUUID,:bannedIp,:bannedIpHostMask)", m_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":regionUUID", item.regionUUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":bannedUUID", item.bannedUUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":bannedIp", item.bannedIP));
|
||||
cmd.Parameters.Add(new SqliteParameter(":bannedIpHostMask", item.bannedIPHostMask));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// remove an entry from the region banlist
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public void RemoveFromRegionBanlist(RegionBanListItem item)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
using (SqliteCommand cmd = new SqliteCommand("delete from regionban where regionUUID=:regionUUID AND bannedUUID=:bannedUUID", m_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":regionUUID", item.regionUUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":bannedUUID", item.bannedUUID.ToString()));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -1822,20 +1722,6 @@ namespace OpenSim.Data.SQLite
|
||||
da.InsertCommand.Connection = conn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="da"></param>
|
||||
/// <param name="conn"></param>
|
||||
private void setupRegionBanCommands(SqliteDataAdapter da, SqliteConnection conn)
|
||||
{
|
||||
da.InsertCommand = createInsertCommand("regionban", ds.Tables["regionban"]);
|
||||
da.InsertCommand.Connection = conn;
|
||||
|
||||
da.UpdateCommand = createUpdateCommand("regionban", "regionUUID=:regionUUID AND bannedUUID=:bannedUUID", ds.Tables["regionban"]);
|
||||
da.UpdateCommand.Connection = conn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user