From 9f5c2acd128828d220bf7e47bd4fe13d7a2a910b Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 23 Nov 2009 11:26:06 +0900 Subject: Formatting cleanup. --- OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index 4e27e26..2f5937d 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs @@ -135,7 +135,7 @@ namespace OpenSim.Data.MySQL List result = new List(); - while(reader.Read()) + while (reader.Read()) { T row = new T(); @@ -146,7 +146,7 @@ namespace OpenSim.Data.MySQL int v = Convert.ToInt32(reader[name]); m_Fields[name].SetValue(row, v != 0 ? true : false); } - else if(m_Fields[name].GetValue(row) is UUID) + else if (m_Fields[name].GetValue(row) is UUID) { UUID uuid = UUID.Zero; -- cgit v1.1 From 4973c057eb4566b97fcf1d56c3b8814516275d38 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 23 Nov 2009 16:08:06 +1100 Subject: * Adds a modicum of additional checking to the Inventory Service (MySQL only) * Enable "opengridmode=true" in your Inventory Connector (where the mysql connection strings are) to enable if you are running a 'wide-open-grid'. * More comprehensive rollback support being implemented, should be available later today. --- OpenSim/Data/MySQL/MySQLInventoryData.cs | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 0eecf06..063dd91 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -48,6 +48,10 @@ namespace OpenSim.Data.MySQL /// private MySQLManager database; + private bool rollbackStore = false; + private bool opengridmode = false; + private string rollbackDir = ""; + public void Initialise() { m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); @@ -82,6 +86,10 @@ namespace OpenSim.Data.MySQL string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); + rollbackDir = GridDataMySqlFile.ParseFileReadValue("rollbackdir"); + rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true"; + opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true"; + database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); @@ -851,16 +859,25 @@ namespace OpenSim.Data.MySQL { List subFolders = getFolderHierarchy(folderID); - //Delete all sub-folders - foreach (InventoryFolderBase f in subFolders) + // Dont delete in OGM - makes for easier restores if someone sends a malcious command. (just restore the folder entry) + if (opengridmode == false) { - deleteOneFolder(f.ID); - deleteItemsInFolder(f.ID); + //Delete all sub-folders + foreach (InventoryFolderBase f in subFolders) + { + deleteOneFolder(f.ID); + deleteItemsInFolder(f.ID); + } } //Delete the actual row deleteOneFolder(folderID); - deleteItemsInFolder(folderID); + + // Just delete the folder context in OGM + if (opengridmode == false) + { + deleteItemsInFolder(folderID); + } } public List fetchActiveGestures(UUID avatarID) -- cgit v1.1