mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
last round of warning squashing. calling it a day now.
This commit is contained in:
@@ -250,22 +250,22 @@ namespace OpenSim.Data.SQLite
|
||||
/// Create the "assets" table
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static DataTable createAssetsTable()
|
||||
{
|
||||
DataTable assets = new DataTable("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;
|
||||
}
|
||||
// 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
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="conn"></param>
|
||||
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();
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -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
|
||||
|
||||
@@ -230,11 +230,11 @@ namespace OpenSim.Data.SQLite
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="conn"></param>
|
||||
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();
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -1686,27 +1686,27 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="dt">Data Table</param>
|
||||
/// <returns></returns>
|
||||
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
|
||||
/// <param name="type">a Type</param>
|
||||
/// <returns>an sqliteType</returns>
|
||||
/// <remarks>this is something we'll need to implement for each db slightly differently.</remarks>
|
||||
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";
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user