From 6ef9d4da901a346c232458317cca6268da888e2e Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 18 Aug 2008 00:39:10 +0000 Subject: Formatting cleanup. --- OpenSim/Data/SQLite/SQLiteAssetData.cs | 18 +++++----- OpenSim/Data/SQLite/SQLiteEstateData.cs | 22 ++++++------ OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 52 ++++++++++++++--------------- OpenSim/Data/SQLite/SQLiteRegionData.cs | 50 +++++++++++++-------------- OpenSim/Data/SQLite/SQLiteUserData.cs | 28 ++++++++-------- 5 files changed, 85 insertions(+), 85 deletions(-) (limited to 'OpenSim/Data/SQLite') diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 99de5cd..9b274f4 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -141,7 +141,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(); } } @@ -155,7 +155,7 @@ namespace OpenSim.Data.SQLite override public void UpdateAsset(AssetBase asset) { LogAssetLoad(asset); - + lock (this) { using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) @@ -167,7 +167,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(); } } @@ -269,7 +269,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -301,7 +301,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// // private static void InitDB(SqliteConnection conn) @@ -312,7 +312,7 @@ namespace OpenSim.Data.SQLite // } /// - /// + /// /// /// /// @@ -331,10 +331,10 @@ namespace OpenSim.Data.SQLite m_log.Info("[ASSET DB]: SQLite Database doesn't exist... creating"); return false; } - + // if the tables are here, and we don't have a migration, // set it to 1, as we're migrating off of legacy bits - if (m.Version == 0) + if (m.Version == 0) m.Version = 1; return true; @@ -343,7 +343,7 @@ namespace OpenSim.Data.SQLite #region IPlugin interface /// - /// + /// /// override public string Version { diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index dc5ba5e..ffe7644 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs @@ -55,12 +55,12 @@ namespace OpenSim.Data.SQLite public void Initialise(string connectionString) { m_connectionString = connectionString; - + m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString); m_connection = new SqliteConnection(m_connectionString); m_connection.Open(); - + Assembly assem = GetType().Assembly; Migration m = new Migration(m_connection, assem, "EstateStore"); m.Update(); @@ -77,7 +77,7 @@ namespace OpenSim.Data.SQLite if (f.Name.Substring(0, 2) == "m_") m_FieldMap[f.Name.Substring(2)] = f; } - + private string[] FieldList { get { return new List(m_FieldMap.Keys).ToArray(); } @@ -134,7 +134,7 @@ namespace OpenSim.Data.SQLite names.Remove("EstateID"); sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; - + cmd.CommandText = sql; cmd.Parameters.Clear(); @@ -272,16 +272,16 @@ namespace OpenSim.Data.SQLite private void SaveBanList(EstateSettings es) { SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); - + cmd.CommandText = "delete from estateban where EstateID = :EstateID"; cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); cmd.ExecuteNonQuery(); - + cmd.Parameters.Clear(); cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; - + foreach (EstateBan b in es.EstateBans) { cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); @@ -295,16 +295,16 @@ namespace OpenSim.Data.SQLite void SaveUUIDList(uint EstateID, string table, LLUUID[] data) { SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); - + cmd.CommandText = "delete from "+table+" where EstateID = :EstateID"; cmd.Parameters.Add(":EstateID", EstateID.ToString()); cmd.ExecuteNonQuery(); - + cmd.Parameters.Clear(); cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; - + foreach (LLUUID uuid in data) { cmd.Parameters.Add(":EstateID", EstateID.ToString()); @@ -336,7 +336,7 @@ namespace OpenSim.Data.SQLite uuids.Add(uuid); } r.Close(); - + return uuids.ToArray(); } } diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index e29b99c..125b6e7 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs @@ -50,8 +50,8 @@ namespace OpenSim.Data.SQLite private SqliteDataAdapter invItemsDa; private SqliteDataAdapter invFoldersDa; - public void Initialise() - { + public void Initialise() + { m_log.Info("[SQLiteInventoryData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -105,7 +105,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -150,7 +150,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -302,7 +302,7 @@ namespace OpenSim.Data.SQLite /// A string containing the DB provider version public string Version { - get + get { Module module = GetType().Module; // string dllName = module.Assembly.ManifestModule.Name; @@ -419,10 +419,10 @@ namespace OpenSim.Data.SQLite * - We will only need to hit the database twice instead of n times. * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned * by the same person, each user only has 1 inventory heirarchy - * - The returned list is not ordered, instead of breadth-first ordered + * - The returned list is not ordered, instead of breadth-first ordered There are basically 2 usage cases for getFolderHeirarchy: 1) Getting the user's entire inventory heirarchy when they log in - 2) Finding a subfolder heirarchy to delete when emptying the trash. + 2) Finding a subfolder heirarchy to delete when emptying the trash. This implementation will pull all inventory folders from the database, and then prune away any folder that is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the database than to make n requests. This pays off only if requested heirarchy is large. @@ -449,17 +449,17 @@ namespace OpenSim.Data.SQLite folderRows = inventoryFolderTable.Select(selectExp); } - if ( folderRows!=null && folderRows.GetLength(0)>=1 ) // No result means parent folder does not exist + if (folderRows != null && folderRows.GetLength(0) >= 1) // No result means parent folder does not exist { // or has no children /* if we're querying the root folder, just return an unordered list of all folders in the user's * inventory */ if (parentFolder.ParentID == LLUUID.Zero) - { + { foreach (DataRow row in folderRows) { InventoryFolderBase curFolder = buildFolder(row); - if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy + if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy folders.Add(buildFolder(row)); } } // If requesting root folder @@ -481,16 +481,16 @@ namespace OpenSim.Data.SQLite InventoryFolderBase curFolder = buildFolder(row); if (curFolder.ParentID != LLUUID.Zero) // Discard root of tree - not needed { - if ( hashtable.ContainsKey(curFolder.ParentID ) ) + if (hashtable.ContainsKey(curFolder.ParentID)) { // Current folder already has a sibling - append to sibling list - hashtable[curFolder.ParentID].Add( curFolder ); + hashtable[curFolder.ParentID].Add(curFolder); } else { List siblingList = new List(); - siblingList.Add( curFolder ); + siblingList.Add(curFolder); // Current folder has no known (yet) siblings - hashtable.Add( curFolder.ParentID, siblingList ); + hashtable.Add(curFolder.ParentID, siblingList); } } } // For all inventory folders @@ -498,12 +498,12 @@ namespace OpenSim.Data.SQLite // Note: Could release the ds lock here - we don't access folderRows or the database anymore. // This is somewhat of a moot point as the callers of this function usually lock db anyways. - if ( hashtable.ContainsKey( parentID ) ) // if requested folder does have children - folders.AddRange( hashtable[parentID] ); + if (hashtable.ContainsKey(parentID)) // if requested folder does have children + folders.AddRange(hashtable[parentID]); // BreadthFirstSearch build inventory tree **Note: folders.Count is *not* static - for ( int i = 0; i < folders.Count; i++ ) - if (hashtable.ContainsKey(folders[i].ID)) + for (int i = 0; i < folders.Count; i++) + if (hashtable.ContainsKey(folders[i].ID)) folders.AddRange(hashtable[folders[i].ID]); } // if requesting a subfolder heirarchy @@ -601,7 +601,7 @@ namespace OpenSim.Data.SQLite /// Delete all items in the specified folder /// /// id of the folder, whose item content should be deleted - /// this is horribly inefficient, but I don't want to ruin the overall structure of this implementation + /// this is horribly inefficient, but I don't want to ruin the overall structure of this implementation private void deleteItemsInFolder(LLUUID folderId) { List items = getInventoryInFolder(Util.ToRawUuidString(folderId)); @@ -743,7 +743,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -765,7 +765,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -787,7 +787,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -804,7 +804,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -819,7 +819,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -836,7 +836,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// // private static void InitDB(SqliteConnection conn) @@ -852,7 +852,7 @@ namespace OpenSim.Data.SQLite // } /// - /// + /// /// /// /// diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index b937272..a44b892 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -501,7 +501,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// public void RemoveLandObject(LLUUID globalID) @@ -523,7 +523,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// public void StoreLandObject(ILandObject parcel) @@ -564,7 +564,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -594,7 +594,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// public void Commit() { @@ -629,7 +629,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -877,7 +877,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -1071,7 +1071,7 @@ namespace OpenSim.Data.SQLite newData.UserLookAt = new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), Convert.ToSingle(row["UserLookAtZ"])); - + } catch (InvalidCastException) { @@ -1132,7 +1132,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1166,7 +1166,7 @@ namespace OpenSim.Data.SQLite // } /// - /// + /// /// /// /// @@ -1233,7 +1233,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1263,7 +1263,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1308,7 +1308,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1321,7 +1321,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1376,7 +1376,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1418,7 +1418,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1574,7 +1574,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// Data Table /// @@ -1631,7 +1631,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1650,7 +1650,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1669,7 +1669,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1680,7 +1680,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1694,7 +1694,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1705,7 +1705,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1799,7 +1799,7 @@ namespace OpenSim.Data.SQLite // } /// - /// + /// /// /// /// @@ -1845,8 +1845,8 @@ namespace OpenSim.Data.SQLite // if we've gotten this far, and our version is still 0, // it's because the migration was never done, so // initialize to 1 just to sync up to where we should be. - - if (m.Version == 0) + + if (m.Version == 0) m.Version = 1; // pDa.Fill(tmpDS, "prims"); diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 910d313..08a97f09 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -65,8 +65,8 @@ namespace OpenSim.Data.SQLite private SqliteDataAdapter daf; SqliteConnection g_conn; - public override void Initialise() - { + public override void Initialise() + { m_log.Info("[SQLiteUserData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -93,7 +93,7 @@ namespace OpenSim.Data.SQLite Assembly assem = GetType().Assembly; Migration m = new Migration(g_conn, assem, "UserStore"); - + // TODO: remove this after rev 6000 TestTables(conn, m); @@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite return; } - public override void Dispose () {} + public override void Dispose () {} /// /// see IUserDataPlugin, @@ -308,7 +308,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -570,7 +570,7 @@ namespace OpenSim.Data.SQLite } return aa; } - + /// /// Update a user appearence /// @@ -802,7 +802,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -853,7 +853,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -881,7 +881,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -914,7 +914,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -933,7 +933,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -954,7 +954,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// private static void InitDB(SqliteConnection conn) @@ -990,7 +990,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1016,7 +1016,7 @@ namespace OpenSim.Data.SQLite return false; } - if (m.Version == 0) + if (m.Version == 0) m.Version = 1; return true; -- cgit v1.1