Merge commit '1458fab82c4dab9901d81419e6b515f47ea7320f' into bigmerge
commit
673886d231
|
@ -844,22 +844,31 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new estate with the name provided
|
// Create a new estate with the name provided
|
||||||
region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, true);
|
region.EstateSettings = m_application.EstateDataService.CreateNewEstate();
|
||||||
|
|
||||||
region.EstateSettings.EstateName = (string) requestData["estate_name"];
|
region.EstateSettings.EstateName = (string) requestData["estate_name"];
|
||||||
region.EstateSettings.EstateOwner = userID;
|
region.EstateSettings.EstateOwner = userID;
|
||||||
// Persistence does not seem to effect the need to save a new estate
|
// Persistence does not seem to effect the need to save a new estate
|
||||||
region.EstateSettings.Save();
|
region.EstateSettings.Save();
|
||||||
|
|
||||||
|
if (!m_application.EstateDataService.LinkRegion(region.RegionID, (int) region.EstateSettings.EstateID))
|
||||||
|
throw new Exception("Failed to join estate.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int estateID = estateIDs[0];
|
int estateID = estateIDs[0];
|
||||||
|
|
||||||
|
region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, false);
|
||||||
|
|
||||||
|
if (region.EstateSettings.EstateID != estateID)
|
||||||
|
{
|
||||||
|
// The region is already part of an estate, but not the one we want.
|
||||||
region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID);
|
region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID);
|
||||||
|
|
||||||
if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID))
|
if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID))
|
||||||
throw new Exception("Failed to join estate.");
|
throw new Exception("Failed to join estate.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create the region and perform any initial initialization
|
// Create the region and perform any initial initialization
|
||||||
|
|
||||||
|
|
|
@ -148,14 +148,46 @@ namespace OpenSim.Data.MSSQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (insertEstate && create)
|
if (insertEstate && create)
|
||||||
|
{
|
||||||
|
DoCreate(es);
|
||||||
|
LinkRegion(regionID, (int)es.EstateID);
|
||||||
|
}
|
||||||
|
|
||||||
|
LoadBanList(es);
|
||||||
|
|
||||||
|
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||||
|
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||||
|
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||||
|
|
||||||
|
//Set event
|
||||||
|
es.OnSave += StoreEstateSettings;
|
||||||
|
return es;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EstateSettings CreateNewEstate()
|
||||||
|
{
|
||||||
|
EstateSettings es = new EstateSettings();
|
||||||
|
es.OnSave += StoreEstateSettings;
|
||||||
|
|
||||||
|
DoCreate(es);
|
||||||
|
|
||||||
|
LoadBanList(es);
|
||||||
|
|
||||||
|
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||||
|
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||||
|
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||||
|
|
||||||
|
return es;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DoCreate(EstateSettings es)
|
||||||
{
|
{
|
||||||
List<string> names = new List<string>(FieldList);
|
List<string> names = new List<string>(FieldList);
|
||||||
|
|
||||||
names.Remove("EstateID");
|
names.Remove("EstateID");
|
||||||
|
|
||||||
sql = string.Format("insert into estate_settings ({0}) values ( @{1})", String.Join(",", names.ToArray()), String.Join(", @", names.ToArray()));
|
string sql = string.Format("insert into estate_settings ({0}) values ( @{1})", String.Join(",", names.ToArray()), String.Join(", @", names.ToArray()));
|
||||||
|
|
||||||
//_Log.Debug("[DB ESTATE]: SQL: " + sql);
|
//_Log.Debug("[DB ESTATE]: SQL: " + sql);
|
||||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||||
|
@ -176,40 +208,10 @@ namespace OpenSim.Data.MSSQL
|
||||||
es.EstateID = Convert.ToUInt32(idParameter.Value);
|
es.EstateID = Convert.ToUInt32(idParameter.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
sql = "INSERT INTO [estate_map] ([RegionID] ,[EstateID]) VALUES (@RegionID, @EstateID)";
|
|
||||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
|
||||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
|
||||||
{
|
|
||||||
|
|
||||||
cmd.Parameters.Add(_Database.CreateParameter("@RegionID", regionID));
|
|
||||||
cmd.Parameters.Add(_Database.CreateParameter("@EstateID", es.EstateID));
|
|
||||||
// This will throw on dupe key
|
|
||||||
try
|
|
||||||
{
|
|
||||||
conn.Open();
|
|
||||||
cmd.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[ESTATE DB]: Error inserting regionID and EstateID in estate_map: {0}", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO check if this is needed??
|
//TODO check if this is needed??
|
||||||
es.Save();
|
es.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadBanList(es);
|
|
||||||
|
|
||||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
|
||||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
|
||||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
|
||||||
|
|
||||||
//Set event
|
|
||||||
es.OnSave += StoreEstateSettings;
|
|
||||||
return es;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stores the estate settings.
|
/// Stores the estate settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -498,24 +500,43 @@ namespace OpenSim.Data.MSSQL
|
||||||
|
|
||||||
public bool LinkRegion(UUID regionID, int estateID)
|
public bool LinkRegion(UUID regionID, int estateID)
|
||||||
{
|
{
|
||||||
string sql = "insert into estate_map values (@RegionID, @EstateID)";
|
string deleteSQL = "delete from estate_map where RegionID = @RegionID";
|
||||||
|
string insertSQL = "insert into estate_map values (@RegionID, @EstateID)";
|
||||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||||
{
|
{
|
||||||
conn.Open();
|
conn.Open();
|
||||||
|
SqlTransaction transaction = conn.BeginTransaction();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
using (SqlCommand cmd = new SqlCommand(deleteSQL, conn))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("@RegionID", regionID);
|
cmd.Transaction = transaction;
|
||||||
|
cmd.Parameters.AddWithValue("@RegionID", regionID.Guid);
|
||||||
|
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
using (SqlCommand cmd = new SqlCommand(insertSQL, conn))
|
||||||
|
{
|
||||||
|
cmd.Transaction = transaction;
|
||||||
|
cmd.Parameters.AddWithValue("@RegionID", regionID.Guid);
|
||||||
cmd.Parameters.AddWithValue("@EstateID", estateID);
|
cmd.Parameters.AddWithValue("@EstateID", estateID);
|
||||||
|
|
||||||
int ret = cmd.ExecuteNonQuery();
|
int ret = cmd.ExecuteNonQuery();
|
||||||
|
|
||||||
|
if (ret != 0)
|
||||||
|
transaction.Commit();
|
||||||
|
else
|
||||||
|
transaction.Rollback();
|
||||||
|
|
||||||
return (ret != 0);
|
return (ret != 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
|
m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
|
||||||
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -149,6 +149,22 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EstateSettings CreateNewEstate()
|
||||||
|
{
|
||||||
|
EstateSettings es = new EstateSettings();
|
||||||
|
es.OnSave += StoreEstateSettings;
|
||||||
|
|
||||||
|
DoCreate(es);
|
||||||
|
|
||||||
|
LoadBanList(es);
|
||||||
|
|
||||||
|
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||||
|
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||||
|
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||||
|
|
||||||
|
return es;
|
||||||
|
}
|
||||||
|
|
||||||
private EstateSettings DoLoad(MySqlCommand cmd, UUID regionID, bool create)
|
private EstateSettings DoLoad(MySqlCommand cmd, UUID regionID, bool create)
|
||||||
{
|
{
|
||||||
EstateSettings es = new EstateSettings();
|
EstateSettings es = new EstateSettings();
|
||||||
|
@ -187,6 +203,21 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found && create)
|
if (!found && create)
|
||||||
|
{
|
||||||
|
DoCreate(es);
|
||||||
|
LinkRegion(regionID, (int)es.EstateID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LoadBanList(es);
|
||||||
|
|
||||||
|
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||||
|
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||||
|
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||||
|
return es;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DoCreate(EstateSettings es)
|
||||||
{
|
{
|
||||||
// Migration case
|
// Migration case
|
||||||
List<string> names = new List<string>(FieldList);
|
List<string> names = new List<string>(FieldList);
|
||||||
|
@ -195,6 +226,9 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
string sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")";
|
string sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")";
|
||||||
|
|
||||||
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
|
{
|
||||||
|
dbcon.Open();
|
||||||
using (MySqlCommand cmd2 = dbcon.CreateCommand())
|
using (MySqlCommand cmd2 = dbcon.CreateCommand())
|
||||||
{
|
{
|
||||||
cmd2.CommandText = sql;
|
cmd2.CommandText = sql;
|
||||||
|
@ -226,27 +260,11 @@ namespace OpenSim.Data.MySQL
|
||||||
es.EstateID = Convert.ToUInt32(r["id"]);
|
es.EstateID = Convert.ToUInt32(r["id"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd2.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
|
|
||||||
cmd2.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
|
||||||
cmd2.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
|
|
||||||
|
|
||||||
// This will throw on dupe key
|
|
||||||
try { cmd2.ExecuteNonQuery(); }
|
|
||||||
catch (Exception) { }
|
|
||||||
|
|
||||||
es.Save();
|
es.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadBanList(es);
|
|
||||||
|
|
||||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
|
||||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
|
||||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
|
||||||
return es;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StoreEstateSettings(EstateSettings es)
|
public void StoreEstateSettings(EstateSettings es)
|
||||||
{
|
{
|
||||||
string sql = "replace into estate_settings (" + String.Join(",", FieldList) + ") values ( ?" + String.Join(", ?", FieldList) + ")";
|
string sql = "replace into estate_settings (" + String.Join(",", FieldList) + ") values ( ?" + String.Join(", ?", FieldList) + ")";
|
||||||
|
@ -477,7 +495,6 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dbcon.Close();
|
dbcon.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,7 +524,6 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dbcon.Close();
|
dbcon.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,16 +535,34 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
|
MySqlTransaction transaction = dbcon.BeginTransaction();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// Delete any existing association of this region with an estate.
|
||||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||||
{
|
{
|
||||||
|
cmd.Transaction = transaction;
|
||||||
|
cmd.CommandText = "delete from estate_map where RegionID = ?RegionID";
|
||||||
|
cmd.Parameters.AddWithValue("?RegionID", regionID);
|
||||||
|
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||||
|
{
|
||||||
|
cmd.Transaction = transaction;
|
||||||
cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
|
cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
|
||||||
cmd.Parameters.AddWithValue("?RegionID", regionID);
|
cmd.Parameters.AddWithValue("?RegionID", regionID);
|
||||||
cmd.Parameters.AddWithValue("?EstateID", estateID);
|
cmd.Parameters.AddWithValue("?EstateID", estateID);
|
||||||
|
|
||||||
int ret = cmd.ExecuteNonQuery();
|
int ret = cmd.ExecuteNonQuery();
|
||||||
|
|
||||||
|
if (ret != 0)
|
||||||
|
transaction.Commit();
|
||||||
|
else
|
||||||
|
transaction.Rollback();
|
||||||
|
|
||||||
dbcon.Close();
|
dbcon.Close();
|
||||||
|
|
||||||
return (ret != 0);
|
return (ret != 0);
|
||||||
|
@ -537,6 +571,7 @@ namespace OpenSim.Data.MySQL
|
||||||
catch (MySqlException ex)
|
catch (MySqlException ex)
|
||||||
{
|
{
|
||||||
m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
|
m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
|
||||||
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
dbcon.Close();
|
dbcon.Close();
|
||||||
|
|
|
@ -85,6 +85,11 @@ namespace OpenSim.Data.Null
|
||||||
return new EstateSettings();
|
return new EstateSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EstateSettings CreateNewEstate()
|
||||||
|
{
|
||||||
|
return new EstateSettings();
|
||||||
|
}
|
||||||
|
|
||||||
public List<EstateSettings> LoadEstateSettingsAll()
|
public List<EstateSettings> LoadEstateSettingsAll()
|
||||||
{
|
{
|
||||||
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
||||||
|
|
|
@ -151,10 +151,41 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
else if (create)
|
else if (create)
|
||||||
{
|
{
|
||||||
r.Close();
|
DoCreate(es);
|
||||||
|
LinkRegion(regionID, (int)es.EstateID);
|
||||||
|
}
|
||||||
|
|
||||||
|
LoadBanList(es);
|
||||||
|
|
||||||
|
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||||
|
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||||
|
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||||
|
return es;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EstateSettings CreateNewEstate()
|
||||||
|
{
|
||||||
|
EstateSettings es = new EstateSettings();
|
||||||
|
es.OnSave += StoreEstateSettings;
|
||||||
|
|
||||||
|
DoCreate(es);
|
||||||
|
|
||||||
|
LoadBanList(es);
|
||||||
|
|
||||||
|
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||||
|
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||||
|
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||||
|
|
||||||
|
return es;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DoCreate(EstateSettings es)
|
||||||
|
{
|
||||||
List<string> names = new List<string>(FieldList);
|
List<string> names = new List<string>(FieldList);
|
||||||
|
|
||||||
|
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||||
|
IDataReader r = null;
|
||||||
|
|
||||||
names.Remove("EstateID");
|
names.Remove("EstateID");
|
||||||
|
|
||||||
string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
|
string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
|
||||||
|
@ -190,30 +221,9 @@ namespace OpenSim.Data.SQLite
|
||||||
|
|
||||||
r.Close();
|
r.Close();
|
||||||
|
|
||||||
cmd.CommandText = "insert into estate_map values (:RegionID, :EstateID)";
|
|
||||||
cmd.Parameters.AddWithValue(":RegionID", regionID.ToString());
|
|
||||||
cmd.Parameters.AddWithValue(":EstateID", es.EstateID.ToString());
|
|
||||||
|
|
||||||
// This will throw on dupe key
|
|
||||||
try
|
|
||||||
{
|
|
||||||
cmd.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
es.Save();
|
es.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadBanList(es);
|
|
||||||
|
|
||||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
|
||||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
|
||||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
|
||||||
return es;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StoreEstateSettings(EstateSettings es)
|
public void StoreEstateSettings(EstateSettings es)
|
||||||
{
|
{
|
||||||
List<string> fields = new List<string>(FieldList);
|
List<string> fields = new List<string>(FieldList);
|
||||||
|
@ -440,17 +450,37 @@ namespace OpenSim.Data.SQLite
|
||||||
|
|
||||||
public bool LinkRegion(UUID regionID, int estateID)
|
public bool LinkRegion(UUID regionID, int estateID)
|
||||||
{
|
{
|
||||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
SqliteTransaction transaction = m_connection.BeginTransaction();
|
||||||
|
|
||||||
|
// Delete any existing estate mapping for this region.
|
||||||
|
using(SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
{
|
||||||
|
cmd.CommandText = "delete from estate_map where RegionID = :RegionID";
|
||||||
|
cmd.Transaction = transaction;
|
||||||
|
cmd.Parameters.AddWithValue(":RegionID", regionID.ToString());
|
||||||
|
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
using(SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
{
|
||||||
cmd.CommandText = "insert into estate_map values (:RegionID, :EstateID)";
|
cmd.CommandText = "insert into estate_map values (:RegionID, :EstateID)";
|
||||||
|
cmd.Transaction = transaction;
|
||||||
cmd.Parameters.AddWithValue(":RegionID", regionID.ToString());
|
cmd.Parameters.AddWithValue(":RegionID", regionID.ToString());
|
||||||
cmd.Parameters.AddWithValue(":EstateID", estateID.ToString());
|
cmd.Parameters.AddWithValue(":EstateID", estateID.ToString());
|
||||||
|
|
||||||
if (cmd.ExecuteNonQuery() == 0)
|
if (cmd.ExecuteNonQuery() == 0)
|
||||||
|
{
|
||||||
|
transaction.Rollback();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
transaction.Commit();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public List<UUID> GetRegions(int estateID)
|
public List<UUID> GetRegions(int estateID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) Contributors, http://opensimulator.org/
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
*
|
*
|
||||||
|
@ -49,6 +49,14 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
EstateSettings LoadEstateSettings(int estateID);
|
EstateSettings LoadEstateSettings(int estateID);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new estate.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// A <see cref="EstateSettings"/>
|
||||||
|
/// </returns>
|
||||||
|
EstateSettings CreateNewEstate();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load/Get all estate settings.
|
/// Load/Get all estate settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -54,6 +54,14 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
EstateSettings LoadEstateSettings(int estateID);
|
EstateSettings LoadEstateSettings(int estateID);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new estate.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// A <see cref="EstateSettings"/>
|
||||||
|
/// </returns>
|
||||||
|
EstateSettings CreateNewEstate();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load/Get all estate settings.
|
/// Load/Get all estate settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) Contributors, http://opensimulator.org/
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
*
|
*
|
||||||
|
@ -91,6 +91,11 @@ namespace OpenSim.Services.Connectors
|
||||||
return m_database.LoadEstateSettings(estateID);
|
return m_database.LoadEstateSettings(estateID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EstateSettings CreateNewEstate()
|
||||||
|
{
|
||||||
|
return m_database.CreateNewEstate();
|
||||||
|
}
|
||||||
|
|
||||||
public List<EstateSettings> LoadEstateSettingsAll()
|
public List<EstateSettings> LoadEstateSettingsAll()
|
||||||
{
|
{
|
||||||
return m_database.LoadEstateSettingsAll();
|
return m_database.LoadEstateSettingsAll();
|
||||||
|
|
Loading…
Reference in New Issue