mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Formatting cleanup.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
|
||||
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
|
||||
[assembly : ComVisible(false)]
|
||||
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("1.0.0.0")]
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenSim.Data.SQLite
|
||||
private const string SelectAssetSQL = "select * from assets where UUID=:UUID";
|
||||
private const string DeleteAssetSQL = "delete from assets where UUID=:UUID";
|
||||
private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, InvType, Local, Temporary, Data) values(:UUID, :Name, :Description, :Type, :InvType, :Local, :Temporary, :Data)";
|
||||
private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, InvType=:InvType, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID";
|
||||
private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, InvType=:InvType, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID";
|
||||
private const string assetSelect = "select * from assets";
|
||||
|
||||
private SqliteConnection m_conn;
|
||||
@@ -70,11 +70,11 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
override public AssetBase FetchAsset(LLUUID uuid)
|
||||
{
|
||||
|
||||
|
||||
using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid)));
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
@@ -98,7 +98,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
m_log.Info("[ASSET DB]: Asset exists already, ignoring.");
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn))
|
||||
{
|
||||
@@ -110,7 +110,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
|
||||
cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ namespace OpenSim.Data.SQLite
|
||||
override public void UpdateAsset(AssetBase asset)
|
||||
{
|
||||
LogAssetLoad(asset);
|
||||
|
||||
|
||||
using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID)));
|
||||
@@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
|
||||
cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
@@ -154,14 +154,14 @@ namespace OpenSim.Data.SQLite
|
||||
using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid)));
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
reader.Close();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
reader.Close();
|
||||
return false;
|
||||
@@ -175,7 +175,7 @@ namespace OpenSim.Data.SQLite
|
||||
using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid)));
|
||||
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ namespace OpenSim.Data.SQLite
|
||||
/***********************************************************************
|
||||
*
|
||||
* Database Definition Functions
|
||||
*
|
||||
*
|
||||
* This should be db agnostic as we define them in ADO.NET terms
|
||||
*
|
||||
**********************************************************************/
|
||||
@@ -216,7 +216,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
*
|
||||
* Convert between ADO.NET <=> OpenSim Objects
|
||||
*
|
||||
* These should be database independant
|
||||
|
||||
@@ -106,22 +106,22 @@ namespace OpenSim.Data.SQLite
|
||||
// new fields
|
||||
if (!Convert.IsDBNull(row["salePrice"]))
|
||||
item.SalePrice = Convert.ToInt32(row["salePrice"]);
|
||||
|
||||
|
||||
if (!Convert.IsDBNull(row["saleType"]))
|
||||
item.SaleType = Convert.ToByte(row["saleType"]);
|
||||
|
||||
|
||||
if (!Convert.IsDBNull(row["creationDate"]))
|
||||
item.CreationDate = Convert.ToInt32(row["creationDate"]);
|
||||
|
||||
|
||||
if (!Convert.IsDBNull(row["groupID"]))
|
||||
item.GroupID = new LLUUID((string)row["groupID"]);
|
||||
|
||||
|
||||
if (!Convert.IsDBNull(row["groupOwned"]))
|
||||
item.GroupOwned = Convert.ToBoolean(row["groupOwned"]);
|
||||
|
||||
|
||||
if (!Convert.IsDBNull(row["Flags"]))
|
||||
item.Flags = Convert.ToUInt32(row["Flags"]);
|
||||
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
if (add)
|
||||
m_log.ErrorFormat("[INVENTORY DB]: Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.ID);
|
||||
|
||||
|
||||
fillItemRow(inventoryRow, item);
|
||||
}
|
||||
invItemsDa.Update(ds, "inventoryitems");
|
||||
@@ -314,9 +314,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
// There should only ever be one root folder for a user. However, if there's more
|
||||
// than one we'll simply use the first one rather than failing. It would be even
|
||||
// nicer to print some message to this effect, but this feels like it's too low a
|
||||
// nicer to print some message to this effect, but this feels like it's too low a
|
||||
// to put such a message out, and it's too minor right now to spare the time to
|
||||
// suitably refactor.
|
||||
// suitably refactor.
|
||||
if (folders.Count > 0)
|
||||
{
|
||||
return folders[0];
|
||||
@@ -327,7 +327,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Append a list of all the child folders of a parent folder
|
||||
/// Append a list of all the child folders of a parent folder
|
||||
/// </summary>
|
||||
/// <param name="folders">list where folders will be appended</param>
|
||||
/// <param name="parentID">ID of parent</param>
|
||||
@@ -435,7 +435,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public void deleteInventoryItem(LLUUID itemID)
|
||||
@@ -664,7 +664,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
string createInventoryItems = defineTable(createInventoryItemsTable());
|
||||
string createInventoryFolders = defineTable(createInventoryFoldersTable());
|
||||
|
||||
|
||||
SqliteCommand pcmd = new SqliteCommand(createInventoryItems, conn);
|
||||
SqliteCommand scmd = new SqliteCommand(createInventoryFolders, conn);
|
||||
|
||||
@@ -697,7 +697,7 @@ namespace OpenSim.Data.SQLite
|
||||
// Very clumsy way of checking whether we need to upgrade the database table version and then updating. Only
|
||||
// putting up with this because this code should be blown away soon by nhibernate...
|
||||
conn.Open();
|
||||
|
||||
|
||||
SqliteCommand cmd;
|
||||
try
|
||||
{
|
||||
@@ -707,7 +707,7 @@ namespace OpenSim.Data.SQLite
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Info("[INVENTORY DB]: Upgrading sqlite inventory database to version 2");
|
||||
|
||||
|
||||
cmd = new SqliteCommand("alter table inventoryitems add column salePrice integer default 99;", conn);
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd = new SqliteCommand("alter table inventoryitems add column saleType integer default 0;", conn);
|
||||
@@ -719,15 +719,15 @@ namespace OpenSim.Data.SQLite
|
||||
cmd = new SqliteCommand("alter table inventoryitems add column groupOwned integer default 0;", conn);
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd = new SqliteCommand("alter table inventoryitems add column flags integer default 0;", conn);
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
pDa.Fill(tmpDS, "inventoryitems");
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
|
||||
|
||||
foreach (DataColumn col in createInventoryItemsTable().Columns)
|
||||
{
|
||||
if (! tmpDS.Tables["inventoryitems"].Columns.Contains(col.ColumnName))
|
||||
|
||||
@@ -90,11 +90,11 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
SqliteCommand shapeSelectCmd = new SqliteCommand(shapeSelect, m_conn);
|
||||
shapeDa = new SqliteDataAdapter(shapeSelectCmd);
|
||||
// SqliteCommandBuilder shapeCb = new SqliteCommandBuilder(shapeDa);
|
||||
// SqliteCommandBuilder shapeCb = new SqliteCommandBuilder(shapeDa);
|
||||
|
||||
SqliteCommand itemsSelectCmd = new SqliteCommand(itemsSelect, m_conn);
|
||||
itemsDa = new SqliteDataAdapter(itemsSelectCmd);
|
||||
|
||||
|
||||
SqliteCommand terrainSelectCmd = new SqliteCommand(terrainSelect, m_conn);
|
||||
terrainDa = new SqliteDataAdapter(terrainSelectCmd);
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
ds.Tables.Add(createShapeTable());
|
||||
setupShapeCommands(shapeDa, m_conn);
|
||||
|
||||
|
||||
if (persistPrimInventories)
|
||||
{
|
||||
ds.Tables.Add(createItemsTable());
|
||||
@@ -183,8 +183,8 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
foreach (SceneObjectPart prim in obj.Children.Values)
|
||||
{
|
||||
if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0
|
||||
&& (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0
|
||||
if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0
|
||||
&& (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0
|
||||
&& (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) == 0)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
@@ -210,7 +210,7 @@ namespace OpenSim.Data.SQLite
|
||||
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
|
||||
{
|
||||
m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
|
||||
|
||||
|
||||
DataTable prims = ds.Tables["prims"];
|
||||
DataTable shapes = ds.Tables["primshapes"];
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
|
||||
// Remove prim row
|
||||
row.Delete();
|
||||
row.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,11 +247,11 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
private void RemoveItems(LLUUID uuid)
|
||||
{
|
||||
DataTable items = ds.Tables["primitems"];
|
||||
DataTable items = ds.Tables["primitems"];
|
||||
|
||||
String sql = String.Format("primID = '{0}'", uuid);
|
||||
String sql = String.Format("primID = '{0}'", uuid);
|
||||
DataRow[] itemRows = items.Select(sql);
|
||||
|
||||
|
||||
foreach (DataRow itemRow in itemRows)
|
||||
{
|
||||
itemRow.Delete();
|
||||
@@ -286,7 +286,7 @@ namespace OpenSim.Data.SQLite
|
||||
try
|
||||
{
|
||||
SceneObjectPart prim = null;
|
||||
|
||||
|
||||
string uuid = (string) primRow["UUID"];
|
||||
string objID = (string) primRow["SceneGroupID"];
|
||||
if (uuid == objID) //is new SceneObjectGroup ?
|
||||
@@ -353,25 +353,25 @@ namespace OpenSim.Data.SQLite
|
||||
private void LoadItems(SceneObjectPart prim)
|
||||
{
|
||||
//m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID);
|
||||
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
|
||||
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
|
||||
|
||||
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
|
||||
DataRow[] dbItemRows = dbItems.Select(sql);
|
||||
|
||||
|
||||
IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
|
||||
|
||||
|
||||
foreach (DataRow row in dbItemRows)
|
||||
{
|
||||
TaskInventoryItem item = buildItem(row);
|
||||
inventory.Add(item);
|
||||
|
||||
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
|
||||
|
||||
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
|
||||
}
|
||||
|
||||
|
||||
prim.RestoreInventoryItems(inventory);
|
||||
|
||||
// XXX A nasty little hack to recover the folder id for the prim (which is currently stored in
|
||||
|
||||
// XXX A nasty little hack to recover the folder id for the prim (which is currently stored in
|
||||
// every item). This data should really be stored in the prim table itself.
|
||||
if (dbItemRows.Length > 0)
|
||||
{
|
||||
@@ -548,12 +548,12 @@ 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");
|
||||
landAccessListDa.Update(ds, "landaccesslist");
|
||||
@@ -569,7 +569,7 @@ namespace OpenSim.Data.SQLite
|
||||
/***********************************************************************
|
||||
*
|
||||
* Database Definition Functions
|
||||
*
|
||||
*
|
||||
* This should be db agnostic as we define them in ADO.NET terms
|
||||
*
|
||||
**********************************************************************/
|
||||
@@ -705,8 +705,8 @@ namespace OpenSim.Data.SQLite
|
||||
createCol(items, "primID", typeof (String));
|
||||
createCol(items, "assetID", typeof (String));
|
||||
createCol(items, "parentFolderID", typeof (String));
|
||||
|
||||
createCol(items, "invType", typeof (Int32));
|
||||
|
||||
createCol(items, "invType", typeof (Int32));
|
||||
createCol(items, "assetType", typeof (Int32));
|
||||
|
||||
createCol(items, "name", typeof (String));
|
||||
@@ -784,7 +784,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
*
|
||||
* Convert between ADO.NET <=> OpenSim Objects
|
||||
*
|
||||
* These should be database independant
|
||||
@@ -897,7 +897,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
return prim;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Build a prim inventory item from the persisted data.
|
||||
/// </summary>
|
||||
@@ -906,15 +906,15 @@ namespace OpenSim.Data.SQLite
|
||||
private static TaskInventoryItem buildItem(DataRow row)
|
||||
{
|
||||
TaskInventoryItem taskItem = new TaskInventoryItem();
|
||||
|
||||
taskItem.ItemID = new LLUUID((String)row["itemID"]);
|
||||
|
||||
taskItem.ItemID = new LLUUID((String)row["itemID"]);
|
||||
taskItem.ParentPartID = new LLUUID((String)row["primID"]);
|
||||
taskItem.AssetID = new LLUUID((String)row["assetID"]);
|
||||
taskItem.ParentID = new LLUUID((String)row["parentFolderID"]);
|
||||
|
||||
|
||||
taskItem.InvType = Convert.ToInt32(row["invType"]);
|
||||
taskItem.Type = Convert.ToInt32(row["assetType"]);
|
||||
|
||||
|
||||
taskItem.Name = (String)row["name"];
|
||||
taskItem.Description = (String)row["description"];
|
||||
taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]);
|
||||
@@ -922,13 +922,13 @@ namespace OpenSim.Data.SQLite
|
||||
taskItem.OwnerID = new LLUUID((String)row["ownerID"]);
|
||||
taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]);
|
||||
taskItem.GroupID = new LLUUID((String)row["groupID"]);
|
||||
|
||||
|
||||
taskItem.NextOwnerMask = Convert.ToUInt32(row["nextPermissions"]);
|
||||
taskItem.OwnerMask = Convert.ToUInt32(row["currentPermissions"]);
|
||||
taskItem.BaseMask = Convert.ToUInt32(row["basePermissions"]);
|
||||
taskItem.EveryoneMask = Convert.ToUInt32(row["everyonePermissions"]);
|
||||
taskItem.GroupMask = Convert.ToUInt32(row["groupPermissions"]);
|
||||
|
||||
|
||||
return taskItem;
|
||||
}
|
||||
|
||||
@@ -990,14 +990,14 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.ExecuteNonQuery();
|
||||
m_conn.Close();
|
||||
m_conn.Dispose();
|
||||
|
||||
|
||||
m_log.Error("[REGION DB]: The land table was recently updated. You need to restart the simulator. Exiting now.");
|
||||
|
||||
Thread.Sleep(10000);
|
||||
|
||||
// ICK! but it's better then A thousand red SQLITE error messages!
|
||||
Environment.Exit(0);
|
||||
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -1006,7 +1006,7 @@ namespace OpenSim.Data.SQLite
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return newData;
|
||||
}
|
||||
|
||||
@@ -1107,17 +1107,17 @@ namespace OpenSim.Data.SQLite
|
||||
row["SitTargetOrientY"] = sitTargetOrient.Y;
|
||||
row["SitTargetOrientZ"] = sitTargetOrient.Z;
|
||||
}
|
||||
|
||||
|
||||
private static void fillItemRow(DataRow row, TaskInventoryItem taskItem)
|
||||
{
|
||||
row["itemID"] = taskItem.ItemID;
|
||||
row["primID"] = taskItem.ParentPartID;
|
||||
row["assetID"] = taskItem.AssetID;
|
||||
row["parentFolderID"] = taskItem.ParentID;
|
||||
|
||||
|
||||
row["invType"] = taskItem.InvType;
|
||||
row["assetType"] = taskItem.Type;
|
||||
|
||||
|
||||
row["name"] = taskItem.Name;
|
||||
row["description"] = taskItem.Description;
|
||||
row["creationDate"] = taskItem.CreationDate;
|
||||
@@ -1294,37 +1294,37 @@ namespace OpenSim.Data.SQLite
|
||||
fillShapeRow(shapeRow, prim);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// see IRegionDatastore
|
||||
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"];
|
||||
|
||||
// For now, we're just going to crudely remove all the previous inventory items
|
||||
// no matter whether they have changed or not, and replace them with the current set.
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
|
||||
// For now, we're just going to crudely remove all the previous inventory items
|
||||
// no matter whether they have changed or not, and replace them with the current set.
|
||||
lock (ds)
|
||||
{
|
||||
RemoveItems(primID);
|
||||
|
||||
|
||||
// repalce with current inventory details
|
||||
foreach (TaskInventoryItem newItem in items)
|
||||
{
|
||||
// m_log.InfoFormat(
|
||||
// "[DATASTORE]: ",
|
||||
// "Adding item {0}, {1} to prim ID {2}",
|
||||
// "[DATASTORE]: ",
|
||||
// "Adding item {0}, {1} to prim ID {2}",
|
||||
// newItem.Name, newItem.ItemID, newItem.ParentPartID);
|
||||
|
||||
|
||||
DataRow newItemRow = dbItems.NewRow();
|
||||
fillItemRow(newItemRow, newItem);
|
||||
dbItems.Rows.Add(newItemRow);
|
||||
dbItems.Rows.Add(newItemRow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Commit();
|
||||
}
|
||||
|
||||
@@ -1436,7 +1436,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// This is a convenience function that collapses 5 repetitive
|
||||
/// lines for defining SqliteParameters to 2 parameters:
|
||||
/// column name and database type.
|
||||
///
|
||||
///
|
||||
/// It assumes certain conventions like :param as the param
|
||||
/// name to replace in parametrized queries, and that source
|
||||
/// version is always current version, both of which are fine
|
||||
@@ -1451,7 +1451,7 @@ namespace OpenSim.Data.SQLite
|
||||
param.SourceColumn = name;
|
||||
param.SourceVersion = DataRowVersion.Current;
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
private void setupPrimCommands(SqliteDataAdapter da, SqliteConnection conn)
|
||||
{
|
||||
@@ -1466,7 +1466,7 @@ namespace OpenSim.Data.SQLite
|
||||
delete.Connection = conn;
|
||||
da.DeleteCommand = delete;
|
||||
}
|
||||
|
||||
|
||||
private void setupItemsCommands(SqliteDataAdapter da, SqliteConnection conn)
|
||||
{
|
||||
da.InsertCommand = createInsertCommand("primitems", ds.Tables["primitems"]);
|
||||
@@ -1479,7 +1479,7 @@ namespace OpenSim.Data.SQLite
|
||||
delete.Parameters.Add(createSqliteParameter("itemID", typeof (String)));
|
||||
delete.Connection = conn;
|
||||
da.DeleteCommand = delete;
|
||||
}
|
||||
}
|
||||
|
||||
private void setupTerrainCommands(SqliteDataAdapter da, SqliteConnection conn)
|
||||
{
|
||||
@@ -1660,7 +1660,7 @@ namespace OpenSim.Data.SQLite
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// XXX primitems should probably go here eventually
|
||||
|
||||
foreach (DataColumn col in createTerrainTable().Columns)
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
private const string AvatarPickerAndSQL = "select * from users where username like :username and surname like :surname";
|
||||
private const string AvatarPickerOrSQL = "select * from users where username like :username or surname like :surname";
|
||||
|
||||
|
||||
private DataSet ds;
|
||||
private SqliteDataAdapter da;
|
||||
private SqliteDataAdapter daf;
|
||||
@@ -67,16 +67,16 @@ namespace OpenSim.Data.SQLite
|
||||
override public void Initialise(string connect)
|
||||
{
|
||||
// default to something sensible
|
||||
if (connect == "")
|
||||
if (connect == "")
|
||||
connect = "URI=file:userprofiles.db,version=3";
|
||||
|
||||
|
||||
SqliteConnection conn = new SqliteConnection(connect);
|
||||
TestTables(conn);
|
||||
|
||||
// This sucks, but It doesn't seem to work with the dataset Syncing :P
|
||||
g_conn = conn;
|
||||
g_conn.Open();
|
||||
|
||||
|
||||
ds = new DataSet();
|
||||
da = new SqliteDataAdapter(new SqliteCommand(userSelect, conn));
|
||||
daf = new SqliteDataAdapter(new SqliteCommand(userFriendsSelect, conn));
|
||||
@@ -159,7 +159,7 @@ namespace OpenSim.Data.SQLite
|
||||
override public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
|
||||
{
|
||||
string InsertFriends = "insert into userfriends(ownerID, friendID, friendPerms) values(:ownerID, :friendID, :perms)";
|
||||
|
||||
|
||||
using (SqliteCommand cmd = new SqliteCommand(InsertFriends, g_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.UUID.ToString()));
|
||||
@@ -228,11 +228,11 @@ namespace OpenSim.Data.SQLite
|
||||
m_log.Error("[USER DB]: Exception getting friends list for user: " + ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return returnlist;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
@@ -380,9 +380,9 @@ namespace OpenSim.Data.SQLite
|
||||
else
|
||||
{
|
||||
fillUserRow(row, user);
|
||||
|
||||
|
||||
}
|
||||
// This is why we're getting the 'logins never log-off'.. because It isn't clearing the
|
||||
// This is why we're getting the 'logins never log-off'.. because It isn't clearing the
|
||||
// useragents table once the useragent is null
|
||||
//
|
||||
// A database guy should look at this and figure out the best way to clear the useragents table.
|
||||
@@ -403,7 +403,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
else
|
||||
{
|
||||
// I just added this to help the standalone login situation.
|
||||
// I just added this to help the standalone login situation.
|
||||
//It still needs to be looked at by a Database guy
|
||||
DataTable ua = ds.Tables["useragents"];
|
||||
row = ua.Rows.Find(Util.ToRawUuidString(user.ID));
|
||||
@@ -480,7 +480,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
/// Appearance
|
||||
/// TODO: stubs for now to get us to a compiling state gently
|
||||
// override public AvatarAppearance GetUserAppearance(LLUUID user)
|
||||
// override public AvatarAppearance GetUserAppearance(LLUUID user)
|
||||
// {
|
||||
// return new AvatarAppearance();
|
||||
// }
|
||||
@@ -494,17 +494,17 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
override public void RemoveAttachment(LLUUID user, LLUUID item)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
override public List<LLUUID> GetAttachments(LLUUID user)
|
||||
{
|
||||
return new List<LLUUID>();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of the storage provider
|
||||
/// </summary>
|
||||
@@ -525,13 +525,13 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* DataTable creation
|
||||
* DataTable creation
|
||||
*
|
||||
**********************************************************************/
|
||||
/***********************************************************************
|
||||
*
|
||||
* Database Definition Functions
|
||||
*
|
||||
*
|
||||
* This should be db agnostic as we define them in ADO.NET terms
|
||||
*
|
||||
**********************************************************************/
|
||||
@@ -610,7 +610,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
*
|
||||
* Convert between ADO.NET <=> OpenSim Objects
|
||||
*
|
||||
* These should be database independant
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenSim.Data.SQLite
|
||||
/***********************************************************************
|
||||
*
|
||||
* Database Definition Helper Functions
|
||||
*
|
||||
*
|
||||
* This should be db agnostic as we define them in ADO.NET terms
|
||||
*
|
||||
**********************************************************************/
|
||||
@@ -161,7 +161,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// This is a convenience function that collapses 5 repetitive
|
||||
/// lines for defining SqliteParameters to 2 parameters:
|
||||
/// column name and database type.
|
||||
///
|
||||
///
|
||||
/// It assumes certain conventions like :param as the param
|
||||
/// name to replace in parametrized queries, and that source
|
||||
/// version is always current version, both of which are fine
|
||||
|
||||
Reference in New Issue
Block a user