mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
Introduce a separate connection string for estates, which defaults to the one gi
ven for the region datastore. Removes the flag to store prim inventories, which are now always stored.
This commit is contained in:
@@ -71,7 +71,6 @@ namespace OpenSim.Data.MSSQL
|
||||
private DataTable m_landAccessListTable;
|
||||
|
||||
/// <summary>Temporary attribute while this is experimental</summary>
|
||||
private bool persistPrimInventories;
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
@@ -83,13 +82,11 @@ namespace OpenSim.Data.MSSQL
|
||||
/// see IRegionDataStore
|
||||
/// </summary>
|
||||
/// <param name="connectionString"></param>
|
||||
/// <param name="persistPrimInventories"></param>
|
||||
public void Initialise(string connectionString, bool persistPrimInventories)
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
// Instance.Initialise("", true);
|
||||
|
||||
m_dataSet = new DataSet();
|
||||
this.persistPrimInventories = persistPrimInventories;
|
||||
|
||||
m_log.Info("[REGION DB]: MSSql - connecting: " + connectionString);
|
||||
m_connection = new SqlConnection(connectionString);
|
||||
@@ -126,13 +123,10 @@ namespace OpenSim.Data.MSSQL
|
||||
setupShapeCommands(m_shapeDataAdapter, m_connection);
|
||||
m_shapeDataAdapter.Fill(m_shapeTable);
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
m_itemsTable = createItemsTable();
|
||||
m_dataSet.Tables.Add(m_itemsTable);
|
||||
SetupItemsCommands(m_itemsDataAdapter, m_connection);
|
||||
m_itemsDataAdapter.Fill(m_itemsTable);
|
||||
}
|
||||
|
||||
m_terrainTable = createTerrainTable();
|
||||
m_dataSet.Tables.Add(m_terrainTable);
|
||||
@@ -218,10 +212,7 @@ namespace OpenSim.Data.MSSQL
|
||||
shapeRow.Delete();
|
||||
}
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
RemoveItems(new LLUUID((string)row["UUID"]));
|
||||
}
|
||||
|
||||
// Remove prim row
|
||||
row.Delete();
|
||||
@@ -317,11 +308,8 @@ namespace OpenSim.Data.MSSQL
|
||||
createdObjects[new LLUUID(objID)].AddPart(prim);
|
||||
}
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
LoadItems(prim);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows");
|
||||
@@ -589,10 +577,7 @@ namespace OpenSim.Data.MSSQL
|
||||
m_primDataAdapter.Update(m_primTable);
|
||||
m_shapeDataAdapter.Update(m_shapeTable);
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
m_itemsDataAdapter.Update(m_itemsTable);
|
||||
}
|
||||
|
||||
m_terrainDataAdapter.Update(m_terrainTable);
|
||||
m_landDataAdapter.Update(m_landTable);
|
||||
@@ -1378,9 +1363,6 @@ namespace OpenSim.Data.MSSQL
|
||||
/// <param name="items"></param>
|
||||
public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
|
||||
{
|
||||
if (!persistPrimInventories)
|
||||
return;
|
||||
|
||||
m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
|
||||
|
||||
// For now, we're just going to crudely remove all the previous inventory items
|
||||
@@ -1749,7 +1731,6 @@ namespace OpenSim.Data.MSSQL
|
||||
pDa.Fill(tmpDS, "prims");
|
||||
sDa.Fill(tmpDS, "primshapes");
|
||||
|
||||
if (persistPrimInventories)
|
||||
iDa.Fill(tmpDS, "primitems");
|
||||
|
||||
tDa.Fill(tmpDS, "terrain");
|
||||
@@ -1765,7 +1746,6 @@ namespace OpenSim.Data.MSSQL
|
||||
pDa.Fill(tmpDS, "prims");
|
||||
sDa.Fill(tmpDS, "primshapes");
|
||||
|
||||
if (persistPrimInventories)
|
||||
iDa.Fill(tmpDS, "primitems");
|
||||
|
||||
tDa.Fill(tmpDS, "terrain");
|
||||
|
||||
@@ -92,9 +92,6 @@ namespace OpenSim.Data.MySQL
|
||||
private DataTable m_landAccessListTable;
|
||||
private DataTable m_regionSettingsTable;
|
||||
|
||||
/// <value>Temporary attribute while this is experimental</value>
|
||||
private bool persistPrimInventories;
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Public Interface Functions
|
||||
@@ -105,13 +102,11 @@ namespace OpenSim.Data.MySQL
|
||||
/// see IRegionDataStore
|
||||
/// </summary>
|
||||
/// <param name="connectionstring"></param>
|
||||
/// <param name="persistPrimInventories"></param>
|
||||
public void Initialise(string connectionString, bool persistPrimInventories)
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
m_connectionString = connectionString;
|
||||
|
||||
m_dataSet = new DataSet();
|
||||
this.persistPrimInventories = persistPrimInventories;
|
||||
|
||||
int passPosition = 0;
|
||||
int passEndPosition = 0;
|
||||
@@ -184,13 +179,10 @@ namespace OpenSim.Data.MySQL
|
||||
m_shapeDataAdapter.Fill(m_shapeTable);
|
||||
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
m_itemsTable = createItemsTable();
|
||||
m_dataSet.Tables.Add(m_itemsTable);
|
||||
SetupItemsCommands(m_itemsDataAdapter, m_connection);
|
||||
m_itemsDataAdapter.Fill(m_itemsTable);
|
||||
}
|
||||
|
||||
m_terrainTable = createTerrainTable();
|
||||
m_dataSet.Tables.Add(m_terrainTable);
|
||||
@@ -429,10 +421,7 @@ namespace OpenSim.Data.MySQL
|
||||
shapeRow.Delete();
|
||||
}
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
RemoveItems(uuid);
|
||||
}
|
||||
|
||||
// Remove prim row
|
||||
row.Delete();
|
||||
@@ -527,11 +516,8 @@ namespace OpenSim.Data.MySQL
|
||||
createdObjects[new LLUUID(objID)].AddPart(prim);
|
||||
}
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
LoadItems(prim);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[REGION DB]: Failed create prim object, exception and data follows");
|
||||
@@ -827,10 +813,7 @@ namespace OpenSim.Data.MySQL
|
||||
m_primDataAdapter.Update(m_primTable);
|
||||
m_shapeDataAdapter.Update(m_shapeTable);
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
m_itemsDataAdapter.Update(m_itemsTable);
|
||||
}
|
||||
|
||||
m_terrainDataAdapter.Update(m_terrainTable);
|
||||
m_landDataAdapter.Update(m_landTable);
|
||||
@@ -1812,9 +1795,6 @@ namespace OpenSim.Data.MySQL
|
||||
/// <param name="items"></param>
|
||||
public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
|
||||
{
|
||||
if (!persistPrimInventories)
|
||||
return;
|
||||
|
||||
m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
|
||||
|
||||
// For now, we're just going to crudely remove all the previous inventory items
|
||||
@@ -2241,7 +2221,6 @@ namespace OpenSim.Data.MySQL
|
||||
// pDa.Fill(tmpDS, "prims");
|
||||
// sDa.Fill(tmpDS, "primshapes");
|
||||
|
||||
// if (persistPrimInventories)
|
||||
// iDa.Fill(tmpDS, "primitems");
|
||||
|
||||
// tDa.Fill(tmpDS, "terrain");
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenSim.Data.NHibernate
|
||||
// Initialise("SQLiteDialect;SqliteClientDriver;URI=file:OpenSim.db,version=3", true);
|
||||
// }
|
||||
|
||||
public void Initialise(string connect, bool persistpriminventories)
|
||||
public void Initialise(string connect)
|
||||
{
|
||||
// Split out the dialect, driver, and connect string
|
||||
char[] split = {';'};
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenSim.Data.Null
|
||||
/// </summary>
|
||||
public class NullDataStore : IRegionDataStore
|
||||
{
|
||||
public void Initialise(string dbfile, bool persistPrimInventories)
|
||||
public void Initialise(string dbfile)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ namespace OpenSim.Data.SQLite
|
||||
private String m_connectionString;
|
||||
|
||||
// Temporary attribute while this is experimental
|
||||
private bool persistPrimInventories;
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
@@ -84,11 +83,9 @@ namespace OpenSim.Data.SQLite
|
||||
/// </list>
|
||||
/// </summary>
|
||||
/// <param name="connectionString">the connection string</param>
|
||||
/// <param name="persistPrimInventories">?</param>
|
||||
public void Initialise(string connectionString, bool persistPrimInventories)
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
m_connectionString = connectionString;
|
||||
this.persistPrimInventories = persistPrimInventories;
|
||||
|
||||
ds = new DataSet();
|
||||
|
||||
@@ -137,12 +134,9 @@ namespace OpenSim.Data.SQLite
|
||||
ds.Tables.Add(createShapeTable());
|
||||
setupShapeCommands(shapeDa, m_conn);
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
ds.Tables.Add(createItemsTable());
|
||||
setupItemsCommands(itemsDa, m_conn);
|
||||
itemsDa.Fill(ds.Tables["primitems"]);
|
||||
}
|
||||
|
||||
ds.Tables.Add(createTerrainTable());
|
||||
setupTerrainCommands(terrainDa, m_conn);
|
||||
@@ -267,10 +261,7 @@ namespace OpenSim.Data.SQLite
|
||||
shapeRow.Delete();
|
||||
}
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
RemoveItems(uuid);
|
||||
}
|
||||
|
||||
// Remove prim row
|
||||
row.Delete();
|
||||
@@ -367,11 +358,8 @@ namespace OpenSim.Data.SQLite
|
||||
createdObjects[new LLUUID(objID)].AddPart(prim);
|
||||
}
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
LoadItems(prim);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[REGION DB]: Failed create prim object, exception and data follows");
|
||||
@@ -615,10 +603,7 @@ namespace OpenSim.Data.SQLite
|
||||
primDa.Update(ds, "prims");
|
||||
shapeDa.Update(ds, "primshapes");
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
itemsDa.Update(ds, "primitems");
|
||||
}
|
||||
|
||||
terrainDa.Update(ds, "terrain");
|
||||
landDa.Update(ds, "land");
|
||||
@@ -1475,9 +1460,6 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="items"></param>
|
||||
public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
|
||||
{
|
||||
if (!persistPrimInventories)
|
||||
return;
|
||||
|
||||
m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID);
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
@@ -1779,8 +1761,6 @@ namespace OpenSim.Data.SQLite
|
||||
// m_log.Warn("[REGION DB]: Shapes Table Already Exists");
|
||||
// }
|
||||
|
||||
// if (persistPrimInventories)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// icmd.ExecuteNonQuery();
|
||||
@@ -1789,7 +1769,6 @@ namespace OpenSim.Data.SQLite
|
||||
// {
|
||||
// m_log.Warn("[REGION DB]: Primitives Inventory Table Already Exists");
|
||||
// }
|
||||
// }
|
||||
|
||||
// try
|
||||
// {
|
||||
@@ -1851,7 +1830,6 @@ namespace OpenSim.Data.SQLite
|
||||
pDa.Fill(tmpDS, "prims");
|
||||
sDa.Fill(tmpDS, "primshapes");
|
||||
|
||||
if (persistPrimInventories)
|
||||
iDa.Fill(tmpDS, "primitems");
|
||||
|
||||
tDa.Fill(tmpDS, "terrain");
|
||||
@@ -1874,7 +1852,6 @@ namespace OpenSim.Data.SQLite
|
||||
// pDa.Fill(tmpDS, "prims");
|
||||
// sDa.Fill(tmpDS, "primshapes");
|
||||
|
||||
// if (persistPrimInventories)
|
||||
// iDa.Fill(tmpDS, "primitems");
|
||||
|
||||
// tDa.Fill(tmpDS, "terrain");
|
||||
|
||||
Reference in New Issue
Block a user