From 65c5efe43b68700bad94076d4cd421160203c5de Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 16 May 2008 01:22:11 +0000 Subject: Formatting cleanup. --- OpenSim/Data/Base/BaseDataReader.cs | 2 +- OpenSim/Data/Base/BaseFieldMapper.cs | 2 +- OpenSim/Data/Base/Properties/AssemblyInfo.cs | 10 +- OpenSim/Data/IGridData.cs | 4 +- OpenSim/Data/IniConfig.cs | 2 +- OpenSim/Data/MSSQL/MSSQLAssetData.cs | 2 +- OpenSim/Data/MSSQL/MSSQLDataStore.cs | 26 +-- OpenSim/Data/MSSQL/MSSQLGridData.cs | 18 +- OpenSim/Data/MSSQL/MSSQLInventoryData.cs | 16 +- OpenSim/Data/MSSQL/MSSQLManager.cs | 4 +- OpenSim/Data/MSSQL/MSSQLUserData.cs | 8 +- OpenSim/Data/MSSQL/Properties/AssemblyInfo.cs | 10 +- OpenSim/Data/MapperFactory/DataMapperFactory.cs | 2 +- OpenSim/Data/MySQL/MySQLAssetData.cs | 10 +- OpenSim/Data/MySQL/MySQLDataStore.cs | 184 ++++++++++----------- OpenSim/Data/MySQL/MySQLInventoryData.cs | 24 +-- OpenSim/Data/MySQL/MySQLManager.cs | 16 +- OpenSim/Data/MySQL/MySQLUserData.cs | 20 +-- OpenSim/Data/MySQL/Properties/AssemblyInfo.cs | 10 +- OpenSim/Data/NHibernate/LLUUIDUserType.cs | 4 +- OpenSim/Data/NHibernate/NHibernateAssetData.cs | 10 +- OpenSim/Data/NHibernate/NHibernateInventoryData.cs | 30 ++-- OpenSim/Data/NHibernate/NHibernateUserData.cs | 42 ++--- OpenSim/Data/Null/NullDataStore.cs | 4 +- OpenSim/Data/Null/Properties/AssemblyInfo.cs | 10 +- OpenSim/Data/OpenSimObjectFieldMapper.cs | 2 +- OpenSim/Data/PrimitiveBaseShapeTableMapper.cs | 2 +- OpenSim/Data/Properties/AssemblyInfo.cs | 10 +- OpenSim/Data/RegionProfileData.cs | 8 +- OpenSim/Data/SQLite/Properties/AssemblyInfo.cs | 10 +- OpenSim/Data/SQLite/SQLiteAssetData.cs | 24 +-- OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 34 ++-- OpenSim/Data/SQLite/SQLiteRegionData.cs | 116 ++++++------- OpenSim/Data/SQLite/SQLiteUserData.cs | 36 ++-- OpenSim/Data/SQLite/SQLiteUtils.cs | 4 +- OpenSim/Data/UserDataBase.cs | 4 +- 36 files changed, 360 insertions(+), 360 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/Base/BaseDataReader.cs b/OpenSim/Data/Base/BaseDataReader.cs index b71a966..517f672 100644 --- a/OpenSim/Data/Base/BaseDataReader.cs +++ b/OpenSim/Data/Base/BaseDataReader.cs @@ -126,7 +126,7 @@ namespace OpenSim.Data.Base { int ordinal = m_source.GetOrdinal(name); int int32 = m_source.GetInt32(ordinal); - return int32; + return int32; } public Int64 GetInt64(string name) diff --git a/OpenSim/Data/Base/BaseFieldMapper.cs b/OpenSim/Data/Base/BaseFieldMapper.cs index 64adb32..4fdc7b9 100644 --- a/OpenSim/Data/Base/BaseFieldMapper.cs +++ b/OpenSim/Data/Base/BaseFieldMapper.cs @@ -30,7 +30,7 @@ using System.Collections.Generic; using System.Data.Common; namespace OpenSim.Data.Base -{ +{ public delegate TField ObjectGetAccessor(TObj obj); public delegate void ObjectSetAccessor(TObj obj, TField value); diff --git a/OpenSim/Data/Base/Properties/AssemblyInfo.cs b/OpenSim/Data/Base/Properties/AssemblyInfo.cs index f851df0..f165434 100644 --- a/OpenSim/Data/Base/Properties/AssemblyInfo.cs +++ b/OpenSim/Data/Base/Properties/AssemblyInfo.cs @@ -29,7 +29,7 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Security; -// 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. @@ -42,8 +42,8 @@ using System.Security; [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)] @@ -55,11 +55,11 @@ using System.Security; // 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")] diff --git a/OpenSim/Data/IGridData.cs b/OpenSim/Data/IGridData.cs index 7681516..b2a8d26 100644 --- a/OpenSim/Data/IGridData.cs +++ b/OpenSim/Data/IGridData.cs @@ -28,7 +28,7 @@ using libsecondlife; namespace OpenSim.Data -{ +{ public enum DataResponse { RESPONSE_OK, @@ -74,7 +74,7 @@ namespace OpenSim.Data RegionProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax); /// - /// Authenticates a sim by use of its recv key. + /// Authenticates a sim by use of its recv key. /// WARNING: Insecure /// /// The UUID sent by the sim diff --git a/OpenSim/Data/IniConfig.cs b/OpenSim/Data/IniConfig.cs index 700a681..d8a435d 100644 --- a/OpenSim/Data/IniConfig.cs +++ b/OpenSim/Data/IniConfig.cs @@ -28,7 +28,7 @@ using System.IO; using System.Text.RegularExpressions; -/* +/* Taken from public code listing at by Alex Pinsker http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html */ diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 5ae60a1..12a03eb 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs @@ -216,7 +216,7 @@ namespace OpenSim.Data.MSSQL override public string Version { -// get { return database.getVersion(); } +// get { return database.getVersion(); } get { return database.getVersion(); } } diff --git a/OpenSim/Data/MSSQL/MSSQLDataStore.cs b/OpenSim/Data/MSSQL/MSSQLDataStore.cs index 08217dc..8bb15c8 100644 --- a/OpenSim/Data/MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Data/MSSQL/MSSQLDataStore.cs @@ -140,7 +140,7 @@ namespace OpenSim.Data.MSSQL m_landAccessListTable = createLandAccessListTable(); m_dataSet.Tables.Add(m_landAccessListTable); setupLandAccessCommands(m_landAccessListDataAdapter, m_connection); - m_landAccessListDataAdapter.Fill(m_landAccessListTable); + m_landAccessListDataAdapter.Fill(m_landAccessListTable); } } @@ -172,7 +172,7 @@ namespace OpenSim.Data.MSSQL public void RemoveObject(LLUUID obj, LLUUID regionUUID) { // Instance.RemoveObject(obj, regionUUID); - + m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID); DataTable prims = m_primTable; @@ -222,7 +222,7 @@ namespace OpenSim.Data.MSSQL /// /// Load persisted objects from region storage. - /// + /// public List LoadObjects(LLUUID regionUUID) { // return Instance.LoadObjects(regionUUID); @@ -328,12 +328,12 @@ namespace OpenSim.Data.MSSQL 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) { @@ -527,7 +527,7 @@ namespace OpenSim.Data.MSSQL /*********************************************************************** * * Database Definition Functions - * + * * This should be db agnostic as we define them in ADO.NET terms * **********************************************************************/ @@ -742,7 +742,7 @@ namespace OpenSim.Data.MSSQL } /*********************************************************************** - * + * * Convert between ADO.NET <=> OpenSim Objects * * These should be database independant @@ -1198,7 +1198,7 @@ namespace OpenSim.Data.MSSQL 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 + // 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 (m_dataSet) { @@ -1209,7 +1209,7 @@ namespace OpenSim.Data.MSSQL { // m_log.InfoFormat( // "[REGION DB]: " + - // "Adding item {0}, {1} to prim ID {2}", + // "Adding item {0}, {1} to prim ID {2}", // newItem.Name, newItem.ItemID, newItem.ParentPartID); DataRow newItemRow = m_itemsTable.NewRow(); @@ -1282,7 +1282,7 @@ namespace OpenSim.Data.MSSQL sql += subsql; sql += " where " + pk; SqlCommand cmd = new SqlCommand(sql); - + // this provides the binding for all our parameters, so // much less code than it used to be @@ -1329,7 +1329,7 @@ namespace OpenSim.Data.MSSQL /// This is a convenience function that collapses 5 repetitive /// lines for defining SqlParameters 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 @@ -1424,7 +1424,7 @@ namespace OpenSim.Data.MSSQL SqlCommand tcmd = new SqlCommand(createTerrain, conn); SqlCommand lcmd = new SqlCommand(createLand, conn); SqlCommand lalcmd = new SqlCommand(createLandAccessList, conn); - + conn.Open(); try { @@ -1604,6 +1604,6 @@ namespace OpenSim.Data.MSSQL { return DbType.String; } - } + } } } diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index cf81bee..0bdd460 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs @@ -79,7 +79,7 @@ namespace OpenSim.Data.MSSQL private void TestTables() { IDbCommand cmd = database.Query("SELECT TOP 1 * FROM "+m_regionsTableName, new Dictionary()); - + try { cmd.ExecuteNonQuery(); @@ -88,7 +88,7 @@ namespace OpenSim.Data.MSSQL catch (Exception) { m_log.Info("[GRID DB]: MSSQL Database doesn't exist... creating"); - database.ExecuteResourceSql("Mssql-regions.sql"); + database.ExecuteResourceSql("Mssql-regions.sql"); } } @@ -161,7 +161,7 @@ namespace OpenSim.Data.MSSQL } return null; } - + /// /// Returns a sim profile from its UUID /// @@ -255,17 +255,17 @@ namespace OpenSim.Data.MSSQL { //Insert new region string sql = - "UPDATE " + m_regionsTableName + @" SET - [regionHandle]=@regionHandle, [regionName]=@regionName, + "UPDATE " + m_regionsTableName + @" SET + [regionHandle]=@regionHandle, [regionName]=@regionName, [regionRecvKey]=@regionRecvKey, [regionSecret]=@regionSecret, [regionSendKey]=@regionSendKey, [regionDataURI]=@regionDataURI, [serverIP]=@serverIP, [serverPort]=@serverPort, [serverURI]=@serverURI, - [locX]=@locX, [locY]=@locY, [locZ]=@locZ, [eastOverrideHandle]=@eastOverrideHandle, - [westOverrideHandle]=@westOverrideHandle, [southOverrideHandle]=@southOverrideHandle, - [northOverrideHandle]=@northOverrideHandle, [regionAssetURI]=@regionAssetURI, + [locX]=@locX, [locY]=@locY, [locZ]=@locZ, [eastOverrideHandle]=@eastOverrideHandle, + [westOverrideHandle]=@westOverrideHandle, [southOverrideHandle]=@southOverrideHandle, + [northOverrideHandle]=@northOverrideHandle, [regionAssetURI]=@regionAssetURI, [regionAssetRecvKey]=@regionAssetRecvKey, [regionAssetSendKey]=@regionAssetSendKey, [regionUserURI]=@regionUserURI, [regionUserRecvKey]=@regionUserRecvKey, [regionUserSendKey]=@regionUserSendKey, [regionMapTexture]=@regionMapTexture, [serverHttpPort]=@serverHttpPort, - [serverRemotingPort]=@serverRemotingPort, [owner_uuid]=@owner_uuid + [serverRemotingPort]=@serverRemotingPort, [owner_uuid]=@owner_uuid where [uuid]=@uuid"; Dictionary parameters = new Dictionary(); diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs index 611a559..69d45f7 100644 --- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs @@ -80,7 +80,7 @@ namespace OpenSim.Data.MSSQL if (tableName == null) { database.ExecuteResourceSql("CreateFoldersTable.sql"); - //database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql"); + //database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql"); return; } } @@ -236,9 +236,9 @@ namespace OpenSim.Data.MSSQL // 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 (items.Count > 0) { rootFolder = items[0]; @@ -326,7 +326,7 @@ namespace OpenSim.Data.MSSQL item.GroupID = new LLUUID(reader["groupID"].ToString()); item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); item.Flags = (uint) reader["flags"]; - + return item; } catch (SqlException e) @@ -455,7 +455,7 @@ namespace OpenSim.Data.MSSQL + ", @inventoryNextPermissions, @inventoryCurrentPermissions, @invType, @creatorID" + ", @inventoryBasePermissions, @inventoryEveryOnePermissions, @salePrice, @saleType" + ", @creationDate, @groupID, @groupOwned, @flags);"; - + try { Dictionary param = new Dictionary(); @@ -472,7 +472,7 @@ namespace OpenSim.Data.MSSQL param["creatorID"] = item.Creator.ToString(); param["inventoryBasePermissions"] = Convert.ToString(item.BasePermissions); param["inventoryEveryOnePermissions"] = Convert.ToString(item.EveryOnePermissions); - + param["salePrice"] = Convert.ToString(item.SalePrice); param["saleType"] = Convert.ToString(item.SaleType); param["creationDate"] = Convert.ToString(item.CreationDate); @@ -550,7 +550,7 @@ namespace OpenSim.Data.MSSQL } /// - /// + /// /// /// public void deleteInventoryItem(LLUUID itemID) @@ -667,7 +667,7 @@ namespace OpenSim.Data.MSSQL } /// - /// Append a list of all the child folders of a parent folder + /// Append a list of all the child folders of a parent folder /// /// list where folders will be appended /// ID of parent diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index 2aea641..3221b3a 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs @@ -442,7 +442,7 @@ namespace OpenSim.Data.MSSQL return returnval; } - + /// /// Execute a SQL statement stored in a resource, as a string /// @@ -509,7 +509,7 @@ namespace OpenSim.Data.MSSQL throw new Exception(string.Format("Resource '{0}' was not found", name)); } - /// + /// /// Returns the version of this DB provider /// /// A string containing the DB provider diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index 844b7fa..9dc6812 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs @@ -105,7 +105,7 @@ namespace OpenSim.Data.MSSQL { database.ExecuteResourceSql("Mssql-users.sql"); } - + cmd = database.Query("select top 1 * from " + m_agentsTableName, new Dictionary()); try { @@ -747,7 +747,7 @@ namespace OpenSim.Data.MSSQL /// 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(); // } @@ -761,12 +761,12 @@ namespace OpenSim.Data.MSSQL { return; } - + override public void RemoveAttachment(LLUUID user, LLUUID item) { return; } - + override public List GetAttachments(LLUUID user) { return new List(); diff --git a/OpenSim/Data/MSSQL/Properties/AssemblyInfo.cs b/OpenSim/Data/MSSQL/Properties/AssemblyInfo.cs index 6b2c214..279e1a9 100644 --- a/OpenSim/Data/MSSQL/Properties/AssemblyInfo.cs +++ b/OpenSim/Data/MSSQL/Properties/AssemblyInfo.cs @@ -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")] diff --git a/OpenSim/Data/MapperFactory/DataMapperFactory.cs b/OpenSim/Data/MapperFactory/DataMapperFactory.cs index 1d981f8..0b1fadd 100644 --- a/OpenSim/Data/MapperFactory/DataMapperFactory.cs +++ b/OpenSim/Data/MapperFactory/DataMapperFactory.cs @@ -49,7 +49,7 @@ namespace OpenSim.Data.MapperFactory return new MSSQLDatabaseMapper(connectionString); default: throw new ArgumentException("Unknown Database Mapper type [" + type + "]."); - } + } } } } diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 7e6289b..e556352 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -79,7 +79,7 @@ namespace OpenSim.Data.MySQL _dbConnection.Connection); MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); p.Value = assetID.GetBytes(); - + try { using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) @@ -111,7 +111,7 @@ namespace OpenSim.Data.MySQL } override public void CreateAsset(AssetBase asset) - { + { lock (_dbConnection) { MySqlCommand cmd = @@ -119,10 +119,10 @@ namespace OpenSim.Data.MySQL "REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" + "VALUES(?id, ?name, ?description, ?assetType, ?invType, ?local, ?temporary, ?data)", _dbConnection.Connection); - + // need to ensure we dispose try - { + { using (cmd) { MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); @@ -145,7 +145,7 @@ namespace OpenSim.Data.MySQL "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); _dbConnection.Reconnect(); - } + } } } diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index ac0d382..3c39a5e 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs @@ -50,12 +50,12 @@ namespace OpenSim.Data.MySQL private const string m_terrainSelect = "select * from terrain limit 1"; private const string m_landSelect = "select * from land"; private const string m_landAccessListSelect = "select * from landaccesslist"; - - + + /// /// We're only using this to version the table! /// - + private DataSet m_dataSet; private MySqlDataAdapter m_primDataAdapter; @@ -65,16 +65,16 @@ namespace OpenSim.Data.MySQL private MySqlDataAdapter m_terrainDataAdapter; private MySqlDataAdapter m_landDataAdapter; private MySqlDataAdapter m_landAccessListDataAdapter; - + private DataTable m_primTable; private DataTable m_shapeTable; private DataTable m_itemsTable; private DataTable m_terrainTable; private DataTable m_landTable; private DataTable m_landAccessListTable; - + // Temporary attribute while this is experimental - private bool persistPrimInventories; + private bool persistPrimInventories; /*********************************************************************** * @@ -98,9 +98,9 @@ namespace OpenSim.Data.MySQL MySqlCommand shapeSelectCmd = new MySqlCommand(m_shapeSelect, m_connection); m_shapeDataAdapter = new MySqlDataAdapter(shapeSelectCmd); - + MySqlCommand itemsSelectCmd = new MySqlCommand(m_itemsSelect, m_connection); - m_itemsDataAdapter = new MySqlDataAdapter(itemsSelectCmd); + m_itemsDataAdapter = new MySqlDataAdapter(itemsSelectCmd); MySqlCommand terrainSelectCmd = new MySqlCommand(m_terrainSelect, m_connection); m_terrainDataAdapter = new MySqlDataAdapter(terrainSelectCmd); @@ -111,7 +111,7 @@ namespace OpenSim.Data.MySQL MySqlCommand landAccessListSelectCmd = new MySqlCommand(m_landAccessListSelect, m_connection); m_landAccessListDataAdapter = new MySqlDataAdapter(landAccessListSelectCmd); - + TestTables(m_connection); lock (m_dataSet) @@ -125,13 +125,13 @@ namespace OpenSim.Data.MySQL m_dataSet.Tables.Add(m_shapeTable); 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_itemsDataAdapter.Fill(m_itemsTable); } m_terrainTable = createTerrainTable(); @@ -195,7 +195,7 @@ namespace OpenSim.Data.MySQL UpgradeLandTable(tableList["land"], dbconn); //database.Close(); - + } /// @@ -290,12 +290,12 @@ namespace OpenSim.Data.MySQL { shapeRow.Delete(); } - + if (persistPrimInventories) - { + { RemoveItems(uuid); } - + // Remove prim row row.Delete(); } @@ -309,18 +309,18 @@ namespace OpenSim.Data.MySQL /// private void RemoveItems(LLUUID uuid) { - String sql = String.Format("primID = '{0}'", uuid); + String sql = String.Format("primID = '{0}'", uuid); DataRow[] itemRows = m_itemsTable.Select(sql); - + foreach (DataRow itemRow in itemRows) { itemRow.Delete(); } } - + /// /// Load persisted objects from region storage. - /// + /// public List LoadObjects(LLUUID regionUUID) { Dictionary createdObjects = new Dictionary(); @@ -341,17 +341,17 @@ namespace OpenSim.Data.MySQL foreach (DataRow primRow in primsForRegion) { - try + try { string uuid = (string) primRow["UUID"]; string objID = (string) primRow["SceneGroupID"]; - + SceneObjectPart prim = buildPrim(primRow); - + if (uuid == objID) //is new SceneObjectGroup ? { SceneObjectGroup group = new SceneObjectGroup(); - + DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID)); if (shapeRow != null) { @@ -384,11 +384,11 @@ namespace OpenSim.Data.MySQL } createdObjects[new LLUUID(objID)].AddPart(prim); } - + if (persistPrimInventories) { LoadItems(prim); - } + } } catch (Exception e) { @@ -403,7 +403,7 @@ namespace OpenSim.Data.MySQL } return retvals; } - + /// /// Load in a prim's persisted inventory. /// @@ -411,31 +411,31 @@ namespace OpenSim.Data.MySQL private void LoadItems(SceneObjectPart prim) { //m_log.InfoFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID); - + DataTable dbItems = m_itemsTable; - - String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); + + String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); DataRow[] dbItemRows = dbItems.Select(sql); - + IList inventory = new List(); - + 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) { prim.FolderID = inventory[0].ParentID; } - } + } public void StoreTerrain(double[,] ter, LLUUID regionID) { @@ -474,8 +474,8 @@ namespace OpenSim.Data.MySQL { m_connection.Open(); } - - lock (m_dataSet) + + lock (m_dataSet) { using (MySqlDataReader row = cmd.ExecuteReader()) { @@ -498,7 +498,7 @@ namespace OpenSim.Data.MySQL m_log.Info("[REGION DB]: No terrain found for region"); return null; } - + m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString()); } } @@ -558,7 +558,7 @@ namespace OpenSim.Data.MySQL fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); landaccesslist.Rows.Add(newAccessRow); } - + Commit(); } } @@ -624,7 +624,7 @@ namespace OpenSim.Data.MySQL /*********************************************************************** * * Database Definition Functions - * + * * This should be db agnostic as we define them in ADO.NET terms * **********************************************************************/ @@ -803,7 +803,7 @@ namespace OpenSim.Data.MySQL return shapes; } - + private static DataTable createItemsTable() { DataTable items = new DataTable("primitems"); @@ -812,8 +812,8 @@ namespace OpenSim.Data.MySQL 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)); @@ -834,10 +834,10 @@ namespace OpenSim.Data.MySQL items.PrimaryKey = new DataColumn[] {items.Columns["itemID"]}; return items; - } + } /*********************************************************************** - * + * * Convert between ADO.NET <=> OpenSim Objects * * These should be database independant @@ -932,8 +932,8 @@ namespace OpenSim.Data.MySQL } return prim; } - - + + /// /// Build a prim inventory item from the persisted data. /// @@ -942,15 +942,15 @@ namespace OpenSim.Data.MySQL 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"]); @@ -958,15 +958,15 @@ namespace OpenSim.Data.MySQL 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; - } + } private static LandData buildLandData(DataRow row) { @@ -1117,17 +1117,17 @@ namespace OpenSim.Data.MySQL } } } - + 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; @@ -1140,7 +1140,7 @@ namespace OpenSim.Data.MySQL row["basePermissions"] = taskItem.BaseMask; row["everyonePermissions"] = taskItem.EveryoneMask; row["groupPermissions"] = taskItem.GroupMask; - } + } private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) { @@ -1322,39 +1322,39 @@ namespace OpenSim.Data.MySQL else { fillShapeRow(shapeRow, prim); - } + } } - + // see IRegionDatastore public void StorePrimInventory(LLUUID primID, ICollection 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 + + // 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 (m_dataSet) - { - RemoveItems(primID); - + { + RemoveItems(primID); + // repalce with current inventory details foreach (TaskInventoryItem newItem in items) { // m_log.InfoFormat( // "[REGION DB]: " + -// "Adding item {0}, {1} to prim ID {2}", +// "Adding item {0}, {1} to prim ID {2}", // newItem.Name, newItem.ItemID, newItem.ParentPartID); - + DataRow newItemRow = m_itemsTable.NewRow(); fillItemRow(newItemRow, newItem); - m_itemsTable.Rows.Add(newItemRow); + m_itemsTable.Rows.Add(newItemRow); } } - + Commit(); - } + } /*********************************************************************** * @@ -1447,9 +1447,9 @@ namespace OpenSim.Data.MySQL } sql += subsql; sql += ")"; - + //m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql); - + return sql; } @@ -1466,7 +1466,7 @@ namespace OpenSim.Data.MySQL /// This is a convenience function that collapses 5 repetitive /// lines for defining MySqlParameters 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 @@ -1498,7 +1498,7 @@ namespace OpenSim.Data.MySQL delete.Connection = conn; da.DeleteCommand = delete; } - + private void SetupItemsCommands(MySqlDataAdapter da, MySqlConnection conn) { da.InsertCommand = createInsertCommand("primitems", m_itemsTable); @@ -1511,7 +1511,7 @@ namespace OpenSim.Data.MySQL delete.Parameters.Add(createMySqlParameter("itemID", typeof (String))); delete.Connection = conn; da.DeleteCommand = delete; - } + } private void SetupTerrainCommands(MySqlDataAdapter da, MySqlConnection conn) { @@ -1597,7 +1597,7 @@ namespace OpenSim.Data.MySQL { m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e); } - + try { icmd.ExecuteNonQuery(); @@ -1605,7 +1605,7 @@ namespace OpenSim.Data.MySQL catch (MySqlException e) { m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e); - } + } try { @@ -1643,7 +1643,7 @@ namespace OpenSim.Data.MySQL MySqlCommand shapeSelectCmd = new MySqlCommand(m_shapeSelect, conn); MySqlDataAdapter sDa = new MySqlDataAdapter(shapeSelectCmd); MySqlCommand itemsSelectCmd = new MySqlCommand(m_itemsSelect, conn); - MySqlDataAdapter iDa = new MySqlDataAdapter(itemsSelectCmd); + MySqlDataAdapter iDa = new MySqlDataAdapter(itemsSelectCmd); MySqlCommand terrainSelectCmd = new MySqlCommand(m_terrainSelect, conn); MySqlDataAdapter tDa = new MySqlDataAdapter(terrainSelectCmd); MySqlCommand landSelectCmd = new MySqlCommand(m_landSelect, conn); @@ -1656,10 +1656,10 @@ namespace OpenSim.Data.MySQL { pDa.Fill(tmpDS, "prims"); sDa.Fill(tmpDS, "primshapes"); - + if (persistPrimInventories) iDa.Fill(tmpDS, "primitems"); - + tDa.Fill(tmpDS, "terrain"); lDa.Fill(tmpDS, "land"); lalDa.Fill(tmpDS, "landaccesslist"); @@ -1672,10 +1672,10 @@ namespace OpenSim.Data.MySQL pDa.Fill(tmpDS, "prims"); sDa.Fill(tmpDS, "primshapes"); - + if (persistPrimInventories) iDa.Fill(tmpDS, "primitems"); - + tDa.Fill(tmpDS, "terrain"); lDa.Fill(tmpDS, "land"); lalDa.Fill(tmpDS, "landaccesslist"); @@ -1688,7 +1688,7 @@ namespace OpenSim.Data.MySQL return false; } } - + foreach (DataColumn col in createShapeTable().Columns) { if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName)) @@ -1697,9 +1697,9 @@ namespace OpenSim.Data.MySQL return false; } } - + // XXX primitems should probably go here eventually - + foreach (DataColumn col in createTerrainTable().Columns) { if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName)) @@ -1708,7 +1708,7 @@ namespace OpenSim.Data.MySQL return false; } } - + foreach (DataColumn col in createLandTable().Columns) { if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName)) @@ -1717,7 +1717,7 @@ namespace OpenSim.Data.MySQL return false; } } - + foreach (DataColumn col in createLandAccessListTable().Columns) { if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName)) @@ -1726,7 +1726,7 @@ namespace OpenSim.Data.MySQL return false; } } - + return true; } @@ -1783,7 +1783,7 @@ namespace OpenSim.Data.MySQL else if (type == typeof (Int64)) { return "bigint"; - } + } else if (type == typeof (Double)) { return "float"; diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 90664ff..92b005d 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -40,7 +40,7 @@ namespace OpenSim.Data.MySQL /// public class MySQLInventoryData : IInventoryData { - private static readonly ILog m_log + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// @@ -249,7 +249,7 @@ namespace OpenSim.Data.MySQL // 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. if (items.Count > 0) @@ -332,13 +332,13 @@ namespace OpenSim.Data.MySQL item.InvType = (int) reader["invType"]; item.Creator = new LLUUID((string) reader["creatorID"]); item.BasePermissions = (uint) reader["inventoryBasePermissions"]; - item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; + item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; item.SalePrice = (int) reader["salePrice"]; item.SaleType = Convert.ToByte(reader["saleType"]); item.CreationDate = (int) reader["creationDate"]; item.GroupID = new LLUUID(reader["groupID"].ToString()); item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); - item.Flags = (uint) reader["flags"]; + item.Flags = (uint) reader["flags"]; return item; } @@ -483,12 +483,12 @@ namespace OpenSim.Data.MySQL result.Parameters.AddWithValue("?groupID", item.GroupID); result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); result.Parameters.AddWithValue("?flags", item.Flags); - + lock (database) { result.ExecuteNonQuery(); } - + result.Dispose(); } catch (MySqlException e) @@ -507,7 +507,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// public void deleteInventoryItem(LLUUID itemID) @@ -517,7 +517,7 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection); cmd.Parameters.AddWithValue("?uuid", itemID.ToString()); - + lock (database) { cmd.ExecuteNonQuery(); @@ -596,7 +596,7 @@ namespace OpenSim.Data.MySQL } /// - /// Append a list of all the child folders of a parent folder + /// Append a list of all the child folders of a parent folder /// /// list where folders will be appended /// ID of parent @@ -623,11 +623,11 @@ namespace OpenSim.Data.MySQL protected void deleteOneFolder(LLUUID folderID) { try - { + { MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryfolders WHERE folderID=?uuid", database.Connection); cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); - + lock (database) { cmd.ExecuteNonQuery(); @@ -647,7 +647,7 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE parentFolderID=?uuid", database.Connection); cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); - + lock (database) { cmd.ExecuteNonQuery(); diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 4455c3b..f7baadc 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -302,7 +302,7 @@ namespace OpenSim.Data.MySQL // Region Main gotta-have-or-we-return-null parts UInt64 tmp64; if (!UInt64.TryParse(reader["regionHandle"].ToString(), out tmp64)) - { + { return null; } else @@ -310,7 +310,7 @@ namespace OpenSim.Data.MySQL retval.regionHandle = tmp64; } LLUUID tmp_uuid; - if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid)) + if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid)) { return null; } @@ -321,7 +321,7 @@ namespace OpenSim.Data.MySQL // non-critical parts retval.regionName = (string)reader["regionName"]; - retval.originUUID = new LLUUID((string) reader["originUUID"]); + retval.originUUID = new LLUUID((string) reader["originUUID"]); // Secrets retval.regionRecvKey = (string) reader["regionRecvKey"]; @@ -360,8 +360,8 @@ namespace OpenSim.Data.MySQL // World Map Addition LLUUID.TryParse((string)reader["regionMapTexture"], out retval.regionMapTextureID); - LLUUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid); - } + LLUUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid); + } else { return null; @@ -418,7 +418,7 @@ namespace OpenSim.Data.MySQL LLUUID.TryParse((string) reader["sessionID"], out tmp); retval.SessionID = tmp; - + LLUUID.TryParse((string)reader["secureSessionID"], out tmp); retval.SecureSessionID = tmp; @@ -488,7 +488,7 @@ namespace OpenSim.Data.MySQL if (reader.IsDBNull(reader.GetOrdinal("profileAboutText"))) retval.AboutText = ""; - else + else retval.AboutText = (string) reader["profileAboutText"]; if (reader.IsDBNull(reader.GetOrdinal("profileFirstText"))) @@ -511,7 +511,7 @@ namespace OpenSim.Data.MySQL LLUUID.TryParse((string)reader["profileFirstImage"], out tmp); retval.FirstLifeImage = tmp; } - + if (reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) { retval.WebLoginKey = LLUUID.Zero; diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index a1e1094..0acf47b 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs @@ -59,7 +59,7 @@ namespace OpenSim.Data.MySQL { // TODO: actually do something with our connect string // instead of loading the second config - + IniFile iniFile = new IniFile("mysql_connection.ini"); string settingHostname = iniFile.ParseFileReadValue("hostname"); string settingDatabase = iniFile.ParseFileReadValue("database"); @@ -67,7 +67,7 @@ namespace OpenSim.Data.MySQL string settingPassword = iniFile.ParseFileReadValue("password"); string settingPooling = iniFile.ParseFileReadValue("pooling"); string settingPort = iniFile.ParseFileReadValue("port"); - + m_usersTableName = iniFile.ParseFileReadValue("userstablename"); if (m_usersTableName == null) { @@ -206,15 +206,15 @@ namespace OpenSim.Data.MySQL param["?friendID"] = friend.UUID.ToString(); param["?friendPerms"] = perms.ToString(); param["?datetimestamp"] = dtvalue.ToString(); - - try + + try { lock (database) { IDbCommand adder = database.Query( "INSERT INTO `" + m_userFriendsTableName + "` " + - "(`ownerID`,`friendID`,`friendPerms`,`datetimestamp`) " + + "(`ownerID`,`friendID`,`friendPerms`,`datetimestamp`) " + "VALUES " + "(?ownerID,?friendID,?friendPerms,?datetimestamp)", param); @@ -325,7 +325,7 @@ namespace OpenSim.Data.MySQL // This is not a real column in the database table, it's a joined column from the opposite record fli.FriendListOwnerPerms = (uint)Convert.ToInt32(reader["ownerperms"]); - + Lfli.Add(fli); } reader.Close(); @@ -599,7 +599,7 @@ namespace OpenSim.Data.MySQL user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); } - + return true; } @@ -630,7 +630,7 @@ namespace OpenSim.Data.MySQL /// 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(); // } @@ -644,12 +644,12 @@ namespace OpenSim.Data.MySQL { return; } - + override public void RemoveAttachment(LLUUID user, LLUUID item) { return; } - + override public List GetAttachments(LLUUID user) { return new List(); diff --git a/OpenSim/Data/MySQL/Properties/AssemblyInfo.cs b/OpenSim/Data/MySQL/Properties/AssemblyInfo.cs index 16b2a4f..b3e08a3 100644 --- a/OpenSim/Data/MySQL/Properties/AssemblyInfo.cs +++ b/OpenSim/Data/MySQL/Properties/AssemblyInfo.cs @@ -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")] diff --git a/OpenSim/Data/NHibernate/LLUUIDUserType.cs b/OpenSim/Data/NHibernate/LLUUIDUserType.cs index e4f1dc2..0f10344 100644 --- a/OpenSim/Data/NHibernate/LLUUIDUserType.cs +++ b/OpenSim/Data/NHibernate/LLUUIDUserType.cs @@ -35,7 +35,7 @@ using NHibernate.UserTypes; namespace OpenSim.Data.NHibernate { [Serializable] - public class LLUUIDUserType: IUserType + public class LLUUIDUserType: IUserType { public object Assemble(object cached, object owner) { @@ -69,7 +69,7 @@ namespace OpenSim.Data.NHibernate public object NullSafeGet(IDataReader rs, string[] names, object owner) { - object uuid = null; + object uuid = null; int ord = rs.GetOrdinal(names[0]); if (!rs.IsDBNull(ord)) diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index 4eb9eef..075f2e9 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs @@ -65,20 +65,20 @@ namespace OpenSim.Data.NHibernate // TODO: make this a real exception type throw new Exception("Malformed Inventory connection string '" + connect + "'"); } - + // NHibernate setup cfg = new Configuration(); - cfg.SetProperty(Environment.ConnectionProvider, + cfg.SetProperty(Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider"); - cfg.SetProperty(Environment.Dialect, + cfg.SetProperty(Environment.Dialect, "NHibernate.Dialect." + parts[0]); - cfg.SetProperty(Environment.ConnectionDriver, + cfg.SetProperty(Environment.ConnectionDriver, "NHibernate.Driver." + parts[1]); cfg.SetProperty(Environment.ConnectionString, parts[2]); cfg.AddAssembly("OpenSim.Data.NHibernate"); HbmSerializer.Default.Validate = true; - using ( MemoryStream stream = + using ( MemoryStream stream = HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) cfg.AddInputStream(stream); diff --git a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs index fa75588..228e0b6 100644 --- a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs +++ b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs @@ -62,23 +62,23 @@ namespace OpenSim.Data.NHibernate // TODO: make this a real exception type throw new Exception("Malformed Inventory connection string '" + connect + "'"); } - + // Establish NHibernate Connection cfg = new Configuration(); - cfg.SetProperty(Environment.ConnectionProvider, + cfg.SetProperty(Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider"); - cfg.SetProperty(Environment.Dialect, + cfg.SetProperty(Environment.Dialect, "NHibernate.Dialect." + parts[0]); - cfg.SetProperty(Environment.ConnectionDriver, + cfg.SetProperty(Environment.ConnectionDriver, "NHibernate.Driver." + parts[1]); cfg.SetProperty(Environment.ConnectionString, parts[2]); cfg.AddAssembly("OpenSim.Data.NHibernate"); HbmSerializer.Default.Validate = true; - using ( MemoryStream stream = + using ( MemoryStream stream = HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) cfg.AddInputStream(stream); - + // If uncommented this will auto create tables, but it // does drops of the old tables, so we need a smarter way // to acturally manage this. @@ -120,8 +120,8 @@ namespace OpenSim.Data.NHibernate /***************************************************************** * - * Basic CRUD operations on Data - * + * Basic CRUD operations on Data + * ****************************************************************/ // READ @@ -195,7 +195,7 @@ namespace OpenSim.Data.NHibernate } /// - /// + /// /// /// public void deleteInventoryItem(LLUUID itemID) @@ -279,7 +279,7 @@ namespace OpenSim.Data.NHibernate } /// - /// + /// /// /// public void deleteInventoryFolder(LLUUID folderID) @@ -353,7 +353,7 @@ namespace OpenSim.Data.NHibernate { updateInventoryItem(item); } - + /// @@ -403,9 +403,9 @@ namespace OpenSim.Data.NHibernate return null; } } - + /// - /// Append a list of all the child folders of a parent folder + /// Append a list of all the child folders of a parent folder /// /// list where folders will be appended /// ID of parent @@ -413,7 +413,7 @@ namespace OpenSim.Data.NHibernate { using (ISession session = factory.OpenSession()) { - + ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); criteria.Add(Expression.Eq("ParentID", parentID)); foreach (InventoryFolderBase item in criteria.List()) @@ -443,7 +443,7 @@ namespace OpenSim.Data.NHibernate for (int i = 0; i < folders.Count; i++) getInventoryFolders(ref folders, folders[i].ID); - + return folders; } } diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index 6ba2783..4de0291 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs @@ -64,20 +64,20 @@ namespace OpenSim.Data.NHibernate // This is stubbing for now, it will become dynamic later and support different db backends cfg = new Configuration(); - cfg.SetProperty(Environment.ConnectionProvider, + cfg.SetProperty(Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider"); - cfg.SetProperty(Environment.Dialect, + cfg.SetProperty(Environment.Dialect, "NHibernate.Dialect." + parts[0]); - cfg.SetProperty(Environment.ConnectionDriver, + cfg.SetProperty(Environment.ConnectionDriver, "NHibernate.Driver." + parts[1]); cfg.SetProperty(Environment.ConnectionString, parts[2]); cfg.AddAssembly("OpenSim.Data.NHibernate"); HbmSerializer.Default.Validate = true; - using ( MemoryStream stream = + using ( MemoryStream stream = HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) cfg.AddInputStream(stream); - + // new SchemaExport(cfg).Create(true, true); factory = cfg.BuildSessionFactory(); @@ -122,7 +122,7 @@ namespace OpenSim.Data.NHibernate // BUG: CATCHALL IS BAD. } catch (Exception) {} - + return (user != null); } @@ -151,7 +151,7 @@ namespace OpenSim.Data.NHibernate // TODO: save agent transaction.Commit(); } - } + } } else { @@ -162,7 +162,7 @@ namespace OpenSim.Data.NHibernate private static void SetAgentData(LLUUID uuid, UserAgentData agent, ISession session) { - if (agent == null) + if (agent == null) { // TODO: got to figure out how to do a delete right } @@ -178,7 +178,7 @@ namespace OpenSim.Data.NHibernate session.Update(agent); } } - + } override public bool UpdateUserProfile(UserProfileData profile) { @@ -193,7 +193,7 @@ namespace OpenSim.Data.NHibernate transaction.Commit(); return true; } - } + } } else { @@ -202,7 +202,7 @@ namespace OpenSim.Data.NHibernate return true; } } - + override public void AddNewUserAgent(UserAgentData agent) { using (ISession session = factory.OpenSession()) @@ -212,9 +212,9 @@ namespace OpenSim.Data.NHibernate session.Save(agent); transaction.Commit(); } - } + } } - + public void UpdateUserAgent(UserAgentData agent) { using (ISession session = factory.OpenSession()) @@ -224,7 +224,7 @@ namespace OpenSim.Data.NHibernate session.Update(agent); transaction.Commit(); } - } + } } override public UserAgentData GetAgentByUUID(LLUUID uuid) @@ -262,7 +262,7 @@ namespace OpenSim.Data.NHibernate { return GetUserByName(fname, lname).CurrentAgent; } - + override public UserAgentData GetAgentByName(string name) { return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]); @@ -273,7 +273,7 @@ namespace OpenSim.Data.NHibernate List results = new List(); string[] querysplit; querysplit = query.Split(' '); - + if (querysplit.Length == 2) { using (ISession session = factory.OpenSession()) @@ -293,7 +293,7 @@ namespace OpenSim.Data.NHibernate } return results; } - + // TODO: actually implement these public override void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) {return;} public override void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) {return;} @@ -306,7 +306,7 @@ namespace OpenSim.Data.NHibernate /// Appearance /// TODO: stubs for now to get us to a compiling state gently - public AvatarAppearance GetUserAppearance(LLUUID user) + public AvatarAppearance GetUserAppearance(LLUUID user) { AvatarAppearance appearance; // TODO: I'm sure I'll have to do something silly here @@ -345,19 +345,19 @@ namespace OpenSim.Data.NHibernate } transaction.Commit(); } - } + } } override public void AddAttachment(LLUUID user, LLUUID item) { return; } - + override public void RemoveAttachment(LLUUID user, LLUUID item) { return; } - + override public List GetAttachments(LLUUID user) { return new List(); diff --git a/OpenSim/Data/Null/NullDataStore.cs b/OpenSim/Data/Null/NullDataStore.cs index 096171c..487f72e 100644 --- a/OpenSim/Data/Null/NullDataStore.cs +++ b/OpenSim/Data/Null/NullDataStore.cs @@ -47,11 +47,11 @@ namespace OpenSim.Data.Null public void RemoveObject(LLUUID obj, LLUUID regionUUID) { } - + // see IRegionDatastore public void StorePrimInventory(LLUUID primID, ICollection items) { - } + } public List LoadObjects(LLUUID regionUUID) { diff --git a/OpenSim/Data/Null/Properties/AssemblyInfo.cs b/OpenSim/Data/Null/Properties/AssemblyInfo.cs index 5db915c..135a64d 100644 --- a/OpenSim/Data/Null/Properties/AssemblyInfo.cs +++ b/OpenSim/Data/Null/Properties/AssemblyInfo.cs @@ -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")] diff --git a/OpenSim/Data/OpenSimObjectFieldMapper.cs b/OpenSim/Data/OpenSimObjectFieldMapper.cs index d67881b..ff375fb 100644 --- a/OpenSim/Data/OpenSimObjectFieldMapper.cs +++ b/OpenSim/Data/OpenSimObjectFieldMapper.cs @@ -95,6 +95,6 @@ namespace OpenSim.Data } return value; - } + } } } diff --git a/OpenSim/Data/PrimitiveBaseShapeTableMapper.cs b/OpenSim/Data/PrimitiveBaseShapeTableMapper.cs index cb3d33d..a4e39a1 100644 --- a/OpenSim/Data/PrimitiveBaseShapeTableMapper.cs +++ b/OpenSim/Data/PrimitiveBaseShapeTableMapper.cs @@ -135,7 +135,7 @@ namespace OpenSim.Data rowMapperSchema.AddMapping("ExtraParams", delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ExtraParams; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.ExtraParams = value; }); + delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.ExtraParams = value; }); } public override PrimitiveBaseShapeRowMapper FromReader(BaseDataReader reader) diff --git a/OpenSim/Data/Properties/AssemblyInfo.cs b/OpenSim/Data/Properties/AssemblyInfo.cs index 357aaa0..03985c3 100644 --- a/OpenSim/Data/Properties/AssemblyInfo.cs +++ b/OpenSim/Data/Properties/AssemblyInfo.cs @@ -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")] diff --git a/OpenSim/Data/RegionProfileData.cs b/OpenSim/Data/RegionProfileData.cs index 000a500..897dcbf 100644 --- a/OpenSim/Data/RegionProfileData.cs +++ b/OpenSim/Data/RegionProfileData.cs @@ -120,7 +120,7 @@ namespace OpenSim.Data public LLUUID regionMapTextureID = new LLUUID("00000000-0000-1111-9999-000000000006"); /// - /// this particular mod to the file provides support within the spec for RegionProfileData for the + /// this particular mod to the file provides support within the spec for RegionProfileData for the /// owner_uuid for the region /// public LLUUID owner_uuid = LLUUID.Zero; @@ -128,7 +128,7 @@ namespace OpenSim.Data /// /// OGS/OpenSim Specific original ID for a region after move/split /// - public LLUUID originUUID; + public LLUUID originUUID; /// /// Get Sim profile data from grid server when in grid mode @@ -163,7 +163,7 @@ namespace OpenSim.Data simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]); simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); - simData.serverURI = (string)responseData["server_uri"]; + simData.serverURI = (string)responseData["server_uri"]; simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; simData.UUID = new LLUUID((string) responseData["region_UUID"]); simData.regionName = (string) responseData["region_name"]; @@ -206,7 +206,7 @@ namespace OpenSim.Data simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; - simData.serverURI = (string)responseData["server_uri"]; + simData.serverURI = (string)responseData["server_uri"]; simData.UUID = new LLUUID((string) responseData["region_UUID"]); simData.regionName = (string) responseData["region_name"]; diff --git a/OpenSim/Data/SQLite/Properties/AssemblyInfo.cs b/OpenSim/Data/SQLite/Properties/AssemblyInfo.cs index 4616cbc..221495e 100644 --- a/OpenSim/Data/SQLite/Properties/AssemblyInfo.cs +++ b/OpenSim/Data/SQLite/Properties/AssemblyInfo.cs @@ -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")] diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 34329bb..8d4fb99 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -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 diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index 1ab971c..5acc5f2 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs @@ -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 } /// - /// Append a list of all the child folders of a parent folder + /// Append a list of all the child folders of a parent folder /// /// list where folders will be appended /// ID of parent @@ -435,7 +435,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// 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)) diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 1b577db..6a16a88 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -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 /// 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 inventory = new List(); - + 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; } - + /// /// Build a prim inventory item from the persisted data. /// @@ -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 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) diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 8f78e0b..d8b140c 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -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 GetAttachments(LLUUID user) { return new List(); } - + /// /// Returns the name of the storage provider /// @@ -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 diff --git a/OpenSim/Data/SQLite/SQLiteUtils.cs b/OpenSim/Data/SQLite/SQLiteUtils.cs index 5bb22f7..0862de0 100644 --- a/OpenSim/Data/SQLite/SQLiteUtils.cs +++ b/OpenSim/Data/SQLite/SQLiteUtils.cs @@ -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 diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs index 817ac3e..82cbda4 100644 --- a/OpenSim/Data/UserDataBase.cs +++ b/OpenSim/Data/UserDataBase.cs @@ -36,11 +36,11 @@ namespace OpenSim.Data public abstract class UserDataBase : IUserData { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private Dictionary aplist = new Dictionary(); public abstract UserProfileData GetUserByUUID(LLUUID user); - public abstract UserProfileData GetUserByName(string fname, string lname); + public abstract UserProfileData GetUserByName(string fname, string lname); public abstract UserAgentData GetAgentByUUID(LLUUID user); public abstract UserAgentData GetAgentByName(string name); public abstract UserAgentData GetAgentByName(string fname, string lname); -- cgit v1.1