From 748f72326d9a295958bc9ba63bbb1a5d39030ef7 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 27 Jun 2008 23:03:39 +0000 Subject: last round of warning squashing. calling it a day now. --- OpenSim/Data/MSSQL/MSSQLDataStore.cs | 4 +- OpenSim/Data/MSSQL/MSSQLGridData.cs | 8 +- OpenSim/Data/MSSQL/MSSQLManager.cs | 2 +- OpenSim/Data/MySQL/MySQLAssetData.cs | 20 +- OpenSim/Data/MySQL/MySQLDataStore.cs | 304 ++++++++++----------- OpenSim/Data/MySQL/MySQLGridData.cs | 8 +- OpenSim/Data/MySQL/MySQLManager.cs | 26 +- OpenSim/Data/NHibernate/NHibernateAssetData.cs | 24 +- OpenSim/Data/NHibernate/NHibernateInventoryData.cs | 2 +- OpenSim/Data/NHibernate/NHibernateManager.cs | 8 +- OpenSim/Data/NHibernate/NHibernateUserData.cs | 12 +- OpenSim/Data/SQLite/SQLiteAssetData.cs | 46 ++-- OpenSim/Data/SQLite/SQLiteGridData.cs | 8 +- OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 20 +- OpenSim/Data/SQLite/SQLiteRegionData.cs | 96 +++---- OpenSim/Data/SQLite/SQLiteUserData.cs | 6 +- 16 files changed, 303 insertions(+), 291 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLDataStore.cs b/OpenSim/Data/MSSQL/MSSQLDataStore.cs index 42eab8e..17a52a8 100644 --- a/OpenSim/Data/MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Data/MSSQL/MSSQLDataStore.cs @@ -370,7 +370,7 @@ namespace OpenSim.Data.MSSQL int revision = Util.UnixTimeSinceEpoch(); m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString()); - DataTable terrain = m_dataSet.Tables["terrain"]; + // DataTable terrain = m_dataSet.Tables["terrain"]; lock (m_dataSet) { SqlCommand cmd = new SqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" + @@ -400,7 +400,7 @@ namespace OpenSim.Data.MSSQL where RegionUUID=@RegionUUID order by Revision desc" , m_connection); - SqlParameter param = new SqlParameter(); + // SqlParameter param = new SqlParameter(); cmd.Parameters.Add(new SqlParameter("@RegionUUID", regionID.UUID)); if (m_connection.State != ConnectionState.Open) diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index d67e463..e2b0dd6 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs @@ -434,11 +434,11 @@ namespace OpenSim.Data.MSSQL /// public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) { - SHA512Managed HashProvider = new SHA512Managed(); - Encoding TextProvider = new UTF8Encoding(); + // SHA512Managed HashProvider = new SHA512Managed(); + // Encoding TextProvider = new UTF8Encoding(); - byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); - byte[] hash = HashProvider.ComputeHash(stream); + // byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); + // byte[] hash = HashProvider.ComputeHash(stream); return false; } diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index a170a87..bea02fe 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs @@ -544,7 +544,7 @@ namespace OpenSim.Data.MSSQL public string getVersion() { Module module = GetType().Module; - string dllName = module.Assembly.ManifestModule.Name; + // string dllName = module.Assembly.ManifestModule.Name; Version dllVersion = module.Assembly.GetName().Version; diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index ac7fa1d..fc331cd 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -120,16 +120,16 @@ namespace OpenSim.Data.MySQL /// /// /// - private void UpgradeAssetsTable(string oldVersion) - { - // null as the version, indicates that the table didn't exist - if (oldVersion == null) - { - m_log.Info("[ASSETS DB]: Creating new database tables"); - _dbConnection.ExecuteResourceSql("CreateAssetsTable.sql"); - return; - } - } + // private void UpgradeAssetsTable(string oldVersion) + // { + // // null as the version, indicates that the table didn't exist + // if (oldVersion == null) + // { + // m_log.Info("[ASSETS DB]: Creating new database tables"); + // _dbConnection.ExecuteResourceSql("CreateAssetsTable.sql"); + // return; + // } + // } /// /// Ensure that the assets related tables exists and are at the latest version diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index aa4c111..87bce10 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs @@ -272,19 +272,19 @@ namespace OpenSim.Data.MySQL /// /// /// The database connection handler - private void UpgradeLandTable(string oldVersion, MySqlConnection dbconn) - { - // null as the version, indicates that the table didn't exist - if (oldVersion == null) - { - ExecuteResourceSql("CreateLandTable.sql",dbconn); - oldVersion = "Rev. 2; InnoDB free: 0 kB"; - } - if (!oldVersion.Contains("Rev.")) - { - ExecuteResourceSql("UpgradeLandTableToVersion2.sql", dbconn); - } - } + // private void UpgradeLandTable(string oldVersion, MySqlConnection dbconn) + // { + // // null as the version, indicates that the table didn't exist + // if (oldVersion == null) + // { + // ExecuteResourceSql("CreateLandTable.sql",dbconn); + // oldVersion = "Rev. 2; InnoDB free: 0 kB"; + // } + // if (!oldVersion.Contains("Rev.")) + // { + // ExecuteResourceSql("UpgradeLandTableToVersion2.sql", dbconn); + // } + // } /// /// Adds an object into region storage @@ -534,7 +534,7 @@ namespace OpenSim.Data.MySQL where RegionUUID=?RegionUUID order by Revision desc limit 1" , m_connection); - MySqlParameter param = new MySqlParameter(); + // MySqlParameter param = new MySqlParameter(); cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); if (m_connection.State != ConnectionState.Open) @@ -1768,30 +1768,30 @@ namespace OpenSim.Data.MySQL /// /// /// - private static string defineTable(DataTable dt) - { - string sql = "create table " + dt.TableName + "("; - string subsql = String.Empty; - foreach (DataColumn col in dt.Columns) - { - if (subsql.Length > 0) - { - // a map function would rock so much here - subsql += ",\n"; - } - subsql += col.ColumnName + " " + MySqlType(col.DataType); - if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0]) - { - subsql += " primary key"; - } - } - sql += subsql; - sql += ")"; - - //m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql); - - return sql; - } + // private static string defineTable(DataTable dt) + // { + // string sql = "create table " + dt.TableName + "("; + // string subsql = String.Empty; + // foreach (DataColumn col in dt.Columns) + // { + // if (subsql.Length > 0) + // { + // // a map function would rock so much here + // subsql += ",\n"; + // } + // subsql += col.ColumnName + " " + MySqlType(col.DataType); + // if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0]) + // { + // subsql += " primary key"; + // } + // } + // sql += subsql; + // sql += ")"; + + // //m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql); + + // return sql; + // } /*********************************************************************** * @@ -1944,93 +1944,93 @@ namespace OpenSim.Data.MySQL /// /// /// MySQL connection handler - private static void InitDB(MySqlConnection conn) - { - string createPrims = defineTable(createPrimTable()); - string createShapes = defineTable(createShapeTable()); - string createItems = defineTable(createItemsTable()); - string createTerrain = defineTable(createTerrainTable()); - - // Land table is created from the Versionable Test Table routine now. - //string createLand = defineTable(createLandTable()); - string createLandAccessList = defineTable(createLandAccessListTable()); - - MySqlCommand pcmd = new MySqlCommand(createPrims, conn); - MySqlCommand scmd = new MySqlCommand(createShapes, conn); - MySqlCommand icmd = new MySqlCommand(createItems, conn); - MySqlCommand tcmd = new MySqlCommand(createTerrain, conn); - //MySqlCommand lcmd = new MySqlCommand(createLand, conn); - MySqlCommand lalcmd = new MySqlCommand(createLandAccessList, conn); - - if (conn.State != ConnectionState.Open) - { - try - { - conn.Open(); - } - catch (Exception ex) - { - m_log.Error("[REGION DB]: Error connecting to MySQL server: " + ex.Message); - m_log.Error("[REGION DB]: Application is terminating!"); - Thread.CurrentThread.Abort(); - } - } - - try - { - pcmd.ExecuteNonQuery(); - } - catch (MySqlException e) - { - m_log.WarnFormat("[REGION DB]: Primitives Table Already Exists: {0}", e); - } - - try - { - scmd.ExecuteNonQuery(); - } - catch (MySqlException e) - { - m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e); - } - - try - { - icmd.ExecuteNonQuery(); - } - catch (MySqlException e) - { - m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e); - } - - try - { - tcmd.ExecuteNonQuery(); - } - catch (MySqlException e) - { - m_log.WarnFormat("[REGION DB]: Terrain Table Already Exists: {0}", e); - } - - //try - //{ - //lcmd.ExecuteNonQuery(); - //} - //catch (MySqlException e) - //{ - //m_log.WarnFormat("[MySql]: Land Table Already Exists: {0}", e); - //} - - try - { - lalcmd.ExecuteNonQuery(); - } - catch (MySqlException e) - { - m_log.WarnFormat("[REGION DB]: LandAccessList Table Already Exists: {0}", e); - } - conn.Close(); - } + // private static void InitDB(MySqlConnection conn) + // { + // string createPrims = defineTable(createPrimTable()); + // string createShapes = defineTable(createShapeTable()); + // string createItems = defineTable(createItemsTable()); + // string createTerrain = defineTable(createTerrainTable()); + + // // Land table is created from the Versionable Test Table routine now. + // //string createLand = defineTable(createLandTable()); + // string createLandAccessList = defineTable(createLandAccessListTable()); + + // MySqlCommand pcmd = new MySqlCommand(createPrims, conn); + // MySqlCommand scmd = new MySqlCommand(createShapes, conn); + // MySqlCommand icmd = new MySqlCommand(createItems, conn); + // MySqlCommand tcmd = new MySqlCommand(createTerrain, conn); + // //MySqlCommand lcmd = new MySqlCommand(createLand, conn); + // MySqlCommand lalcmd = new MySqlCommand(createLandAccessList, conn); + + // if (conn.State != ConnectionState.Open) + // { + // try + // { + // conn.Open(); + // } + // catch (Exception ex) + // { + // m_log.Error("[REGION DB]: Error connecting to MySQL server: " + ex.Message); + // m_log.Error("[REGION DB]: Application is terminating!"); + // Thread.CurrentThread.Abort(); + // } + // } + + // try + // { + // pcmd.ExecuteNonQuery(); + // } + // catch (MySqlException e) + // { + // m_log.WarnFormat("[REGION DB]: Primitives Table Already Exists: {0}", e); + // } + + // try + // { + // scmd.ExecuteNonQuery(); + // } + // catch (MySqlException e) + // { + // m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e); + // } + + // try + // { + // icmd.ExecuteNonQuery(); + // } + // catch (MySqlException e) + // { + // m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e); + // } + + // try + // { + // tcmd.ExecuteNonQuery(); + // } + // catch (MySqlException e) + // { + // m_log.WarnFormat("[REGION DB]: Terrain Table Already Exists: {0}", e); + // } + + // //try + // //{ + // //lcmd.ExecuteNonQuery(); + // //} + // //catch (MySqlException e) + // //{ + // //m_log.WarnFormat("[MySql]: Land Table Already Exists: {0}", e); + // //} + + // try + // { + // lalcmd.ExecuteNonQuery(); + // } + // catch (MySqlException e) + // { + // m_log.WarnFormat("[REGION DB]: LandAccessList Table Already Exists: {0}", e); + // } + // conn.Close(); + // } /// /// @@ -2189,32 +2189,32 @@ namespace OpenSim.Data.MySQL /// /// /// this is something we'll need to implement for each db slightly differently. - private static string MySqlType(Type type) - { - if (type == typeof (String)) - { - return "varchar(255)"; - } - else if (type == typeof (Int32)) - { - return "integer"; - } - else if (type == typeof (Int64)) - { - return "bigint"; - } - else if (type == typeof (Double)) - { - return "float"; - } - else if (type == typeof (Byte[])) - { - return "longblob"; - } - else - { - return "string"; - } - } + // private static string MySqlType(Type type) + // { + // if (type == typeof (String)) + // { + // return "varchar(255)"; + // } + // else if (type == typeof (Int32)) + // { + // return "integer"; + // } + // else if (type == typeof (Int64)) + // { + // return "bigint"; + // } + // else if (type == typeof (Double)) + // { + // return "float"; + // } + // else if (type == typeof (Byte[])) + // { + // return "longblob"; + // } + // else + // { + // return "string"; + // } + // } } } diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index 7abc85a..bb71c99 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs @@ -402,11 +402,11 @@ namespace OpenSim.Data.MySQL /// public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) { - SHA512Managed HashProvider = new SHA512Managed(); - Encoding TextProvider = new UTF8Encoding(); + // SHA512Managed HashProvider = new SHA512Managed(); + // Encoding TextProvider = new UTF8Encoding(); - byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); - byte[] hash = HashProvider.ComputeHash(stream); + // byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); + // byte[] hash = HashProvider.ComputeHash(stream); return false; } diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 7c3ed28..61fd039 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -156,7 +156,7 @@ namespace OpenSim.Data.MySQL public string getVersion() { Module module = GetType().Module; - string dllName = module.Assembly.ManifestModule.Name; + // string dllName = module.Assembly.ManifestModule.Name; Version dllVersion = module.Assembly.GetName().Version; return @@ -916,8 +916,12 @@ namespace OpenSim.Data.MySQL IDbCommand result = Query(sql, parameters); //Console.WriteLine(result.CommandText); - int x; - if ((x = result.ExecuteNonQuery()) > 0) + // int x; + // if ((x = result.ExecuteNonQuery()) > 0) + // { + // returnval = true; + // } + if (result.ExecuteNonQuery() > 0) { returnval = true; } @@ -952,8 +956,12 @@ namespace OpenSim.Data.MySQL IDbCommand result = Query(sql, parameters); - int x; - if ((x = result.ExecuteNonQuery()) > 0) + // int x; + // if ((x = result.ExecuteNonQuery()) > 0) + // { + // returnval = true; + // } + if (result.ExecuteNonQuery() > 0) { returnval = true; } @@ -1000,8 +1008,12 @@ namespace OpenSim.Data.MySQL IDbCommand result = Query(sql, parameters); //Console.WriteLine(result.CommandText); - int x; - if ((x = result.ExecuteNonQuery()) > 0) + // int x; + // if ((x = result.ExecuteNonQuery()) > 0) + // { + // returnval = true; + // } + if (result.ExecuteNonQuery() > 0) { returnval = true; } diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index a339ee3..174667e 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs @@ -137,18 +137,18 @@ namespace OpenSim.Data.NHibernate } } - private void LogAssetLoad(AssetBase asset) - { - string temporary = asset.Temporary ? "Temporary" : "Stored"; - string local = asset.Local ? "Local" : "Remote"; - - int assetLength = (asset.Data != null) ? asset.Data.Length : 0; - - m_log.Info("[SQLITE]: " + - string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)", - asset.FullID, asset.Name, asset.Description, asset.Type, - asset.InvType, temporary, local, assetLength)); - } + // private void LogAssetLoad(AssetBase asset) + // { + // string temporary = asset.Temporary ? "Temporary" : "Stored"; + // string local = asset.Local ? "Local" : "Remote"; + + // int assetLength = (asset.Data != null) ? asset.Data.Length : 0; + + // m_log.Info("[SQLITE]: " + + // string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)", + // asset.FullID, asset.Name, asset.Description, asset.Type, + // asset.InvType, temporary, local, assetLength)); + // } override public bool ExistsAsset(LLUUID uuid) { diff --git a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs index 46dcbad..153d2d5 100644 --- a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs +++ b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs @@ -277,7 +277,7 @@ namespace OpenSim.Data.NHibernate public string getVersion() { Module module = GetType().Module; - string dllName = module.Assembly.ManifestModule.Name; + // string dllName = module.Assembly.ManifestModule.Name; Version dllVersion = module.Assembly.GetName().Version; diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs index 6f13294..4c5ec01 100644 --- a/OpenSim/Data/NHibernate/NHibernateManager.cs +++ b/OpenSim/Data/NHibernate/NHibernateManager.cs @@ -33,11 +33,11 @@ namespace OpenSim.Data.NHibernate { internal class NHibernateManager { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private ISessionFactory factory; - private ISession session; - private ITransaction transaction; + // private ISessionFactory factory; + // private ISession session; + // private ITransaction transaction; public NHibernateManager() { diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index 9cb576d..9d9aec9 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs @@ -91,7 +91,7 @@ namespace OpenSim.Data.NHibernate { user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; } - catch (ObjectNotFoundException e) + catch (ObjectNotFoundException) { user = null; } @@ -108,7 +108,7 @@ namespace OpenSim.Data.NHibernate user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; user.CurrentAgent = GetAgentByUUID(uuid); } - catch (ObjectNotFoundException e) + catch (ObjectNotFoundException) { user = null; } @@ -143,7 +143,7 @@ namespace OpenSim.Data.NHibernate UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData; session.Delete(old); } - catch (ObjectNotFoundException e) + catch (ObjectNotFoundException) { } session.Save(agent); @@ -173,7 +173,7 @@ namespace OpenSim.Data.NHibernate UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData; session.Delete(old); } - catch (ObjectNotFoundException e) + catch (ObjectNotFoundException) { } session.Save(agent); @@ -260,7 +260,7 @@ namespace OpenSim.Data.NHibernate // TODO: I'm sure I'll have to do something silly here try { appearance = session.Load(typeof(AvatarAppearance), user) as AvatarAppearance; - } catch (ObjectNotFoundException e) { + } catch (ObjectNotFoundException) { appearance = null; } return appearance; @@ -271,7 +271,7 @@ namespace OpenSim.Data.NHibernate AvatarAppearance appearance; try { appearance = session.Load(typeof(AvatarAppearance), uuid) as AvatarAppearance; - } catch (ObjectNotFoundException e) { + } catch (ObjectNotFoundException) { appearance = null; } diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 018501f..24c75e3 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -250,22 +250,22 @@ namespace OpenSim.Data.SQLite /// Create the "assets" table /// /// - private static DataTable createAssetsTable() - { - DataTable assets = new DataTable("assets"); - - SQLiteUtil.createCol(assets, "UUID", typeof (String)); - SQLiteUtil.createCol(assets, "Name", typeof (String)); - SQLiteUtil.createCol(assets, "Description", typeof (String)); - SQLiteUtil.createCol(assets, "Type", typeof (Int32)); - SQLiteUtil.createCol(assets, "InvType", typeof (Int32)); - SQLiteUtil.createCol(assets, "Local", typeof (Boolean)); - SQLiteUtil.createCol(assets, "Temporary", typeof (Boolean)); - SQLiteUtil.createCol(assets, "Data", typeof (Byte[])); - // Add in contraints - assets.PrimaryKey = new DataColumn[] {assets.Columns["UUID"]}; - return assets; - } + // private static DataTable createAssetsTable() + // { + // DataTable assets = new DataTable("assets"); + + // SQLiteUtil.createCol(assets, "UUID", typeof (String)); + // SQLiteUtil.createCol(assets, "Name", typeof (String)); + // SQLiteUtil.createCol(assets, "Description", typeof (String)); + // SQLiteUtil.createCol(assets, "Type", typeof (Int32)); + // SQLiteUtil.createCol(assets, "InvType", typeof (Int32)); + // SQLiteUtil.createCol(assets, "Local", typeof (Boolean)); + // SQLiteUtil.createCol(assets, "Temporary", typeof (Boolean)); + // SQLiteUtil.createCol(assets, "Data", typeof (Byte[])); + // // Add in contraints + // assets.PrimaryKey = new DataColumn[] {assets.Columns["UUID"]}; + // return assets; + // } /*********************************************************************** * @@ -312,12 +312,12 @@ namespace OpenSim.Data.SQLite /// /// /// - private static void InitDB(SqliteConnection conn) - { - string createAssets = SQLiteUtil.defineTable(createAssetsTable()); - SqliteCommand pcmd = new SqliteCommand(createAssets, conn); - pcmd.ExecuteNonQuery(); - } + // private static void InitDB(SqliteConnection conn) + // { + // string createAssets = SQLiteUtil.defineTable(createAssetsTable()); + // SqliteCommand pcmd = new SqliteCommand(createAssets, conn); + // pcmd.ExecuteNonQuery(); + // } /// /// @@ -358,7 +358,7 @@ namespace OpenSim.Data.SQLite get { Module module = GetType().Module; - string dllName = module.Assembly.ManifestModule.Name; + // string dllName = module.Assembly.ManifestModule.Name; Version dllVersion = module.Assembly.GetName().Version; return diff --git a/OpenSim/Data/SQLite/SQLiteGridData.cs b/OpenSim/Data/SQLite/SQLiteGridData.cs index 0d24a40..6fd7235 100644 --- a/OpenSim/Data/SQLite/SQLiteGridData.cs +++ b/OpenSim/Data/SQLite/SQLiteGridData.cs @@ -230,11 +230,11 @@ namespace OpenSim.Data.SQLite /// public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) { - SHA512Managed HashProvider = new SHA512Managed(); - Encoding TextProvider = new UTF8Encoding(); + // SHA512Managed HashProvider = new SHA512Managed(); + // Encoding TextProvider = new UTF8Encoding(); - byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); - byte[] hash = HashProvider.ComputeHash(stream); + // byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); + // byte[] hash = HashProvider.ComputeHash(stream); return false; } diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index f7a1fdc..99560a0 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs @@ -297,7 +297,7 @@ namespace OpenSim.Data.SQLite public string getVersion() { Module module = GetType().Module; - string dllName = module.Assembly.ManifestModule.Name; + // string dllName = module.Assembly.ManifestModule.Name; Version dllVersion = module.Assembly.GetName().Version; @@ -741,17 +741,17 @@ namespace OpenSim.Data.SQLite /// /// /// - private static void InitDB(SqliteConnection conn) - { - string createInventoryItems = defineTable(createInventoryItemsTable()); - string createInventoryFolders = defineTable(createInventoryFoldersTable()); + // private static void InitDB(SqliteConnection conn) + // { + // string createInventoryItems = defineTable(createInventoryItemsTable()); + // string createInventoryFolders = defineTable(createInventoryFoldersTable()); - SqliteCommand pcmd = new SqliteCommand(createInventoryItems, conn); - SqliteCommand scmd = new SqliteCommand(createInventoryFolders, conn); + // SqliteCommand pcmd = new SqliteCommand(createInventoryItems, conn); + // SqliteCommand scmd = new SqliteCommand(createInventoryFolders, conn); - pcmd.ExecuteNonQuery(); - scmd.ExecuteNonQuery(); - } + // pcmd.ExecuteNonQuery(); + // scmd.ExecuteNonQuery(); + // } /// /// diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 86f4370..13d444e 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -1686,27 +1686,27 @@ namespace OpenSim.Data.SQLite /// /// Data Table /// - private static string defineTable(DataTable dt) - { - string sql = "create table " + dt.TableName + "("; - string subsql = String.Empty; - foreach (DataColumn col in dt.Columns) - { - if (subsql.Length > 0) - { - // a map function would rock so much here - subsql += ",\n"; - } - subsql += col.ColumnName + " " + sqliteType(col.DataType); - if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0]) - { - subsql += " primary key"; - } - } - sql += subsql; - sql += ")"; - return sql; - } + // private static string defineTable(DataTable dt) + // { + // string sql = "create table " + dt.TableName + "("; + // string subsql = String.Empty; + // foreach (DataColumn col in dt.Columns) + // { + // if (subsql.Length > 0) + // { + // // a map function would rock so much here + // subsql += ",\n"; + // } + // subsql += col.ColumnName + " " + sqliteType(col.DataType); + // if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0]) + // { + // subsql += " primary key"; + // } + // } + // sql += subsql; + // sql += ")"; + // return sql; + // } /*********************************************************************** * @@ -2083,32 +2083,32 @@ namespace OpenSim.Data.SQLite /// a Type /// an sqliteType /// this is something we'll need to implement for each db slightly differently. - private static string sqliteType(Type type) - { - if (type == typeof (String)) - { - return "varchar(255)"; - } - else if (type == typeof (Int32)) - { - return "integer"; - } - else if (type == typeof (Int64)) - { - return "integer"; - } - else if (type == typeof (Double)) - { - return "float"; - } - else if (type == typeof (Byte[])) - { - return "blob"; - } - else - { - return "string"; - } - } + // private static string sqliteType(Type type) + // { + // if (type == typeof (String)) + // { + // return "varchar(255)"; + // } + // else if (type == typeof (Int32)) + // { + // return "integer"; + // } + // else if (type == typeof (Int64)) + // { + // return "integer"; + // } + // else if (type == typeof (Double)) + // { + // return "float"; + // } + // else if (type == typeof (Byte[])) + // { + // return "blob"; + // } + // else + // { + // return "string"; + // } + // } } } diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 24c7944..c7673bd 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -557,8 +557,8 @@ namespace OpenSim.Data.SQLite try { aa = aplist[user]; m_log.Info("[APPEARANCE] Found appearance for " + user.ToString() + aa.ToString()); - } catch (System.Collections.Generic.KeyNotFoundException e) { - m_log.Info("[APPEARANCE] No appearance found for " + user.ToString()); + } catch (System.Collections.Generic.KeyNotFoundException) { + m_log.InfoFormat("[APPEARANCE] No appearance found for {0}", user.ToString()); } return aa; } @@ -971,7 +971,7 @@ namespace OpenSim.Data.SQLite private static bool TestTables(SqliteConnection conn, Migration m) { SqliteCommand cmd = new SqliteCommand(userSelect, conn); - SqliteCommand fcmd = new SqliteCommand(userFriendsSelect, conn); + // SqliteCommand fcmd = new SqliteCommand(userFriendsSelect, conn); SqliteDataAdapter pDa = new SqliteDataAdapter(cmd); SqliteDataAdapter fDa = new SqliteDataAdapter(cmd); -- cgit v1.1