* 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.
0.6.8-post-fixes
Adam Frisby 2009-11-23 16:08:06 +11:00
parent 7ecd43864f
commit 4973c057eb
1 changed files with 22 additions and 5 deletions

View File

@ -48,6 +48,10 @@ namespace OpenSim.Data.MySQL
/// </summary> /// </summary>
private MySQLManager database; private MySQLManager database;
private bool rollbackStore = false;
private bool opengridmode = false;
private string rollbackDir = "";
public void Initialise() public void Initialise()
{ {
m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!");
@ -82,6 +86,10 @@ namespace OpenSim.Data.MySQL
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
rollbackDir = GridDataMySqlFile.ParseFileReadValue("rollbackdir");
rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true";
opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true";
database = database =
new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
settingPort); settingPort);
@ -851,17 +859,26 @@ namespace OpenSim.Data.MySQL
{ {
List<InventoryFolderBase> subFolders = getFolderHierarchy(folderID); List<InventoryFolderBase> subFolders = getFolderHierarchy(folderID);
// Dont delete in OGM - makes for easier restores if someone sends a malcious command. (just restore the folder entry)
if (opengridmode == false)
{
//Delete all sub-folders //Delete all sub-folders
foreach (InventoryFolderBase f in subFolders) foreach (InventoryFolderBase f in subFolders)
{ {
deleteOneFolder(f.ID); deleteOneFolder(f.ID);
deleteItemsInFolder(f.ID); deleteItemsInFolder(f.ID);
} }
}
//Delete the actual row //Delete the actual row
deleteOneFolder(folderID); deleteOneFolder(folderID);
// Just delete the folder context in OGM
if (opengridmode == false)
{
deleteItemsInFolder(folderID); deleteItemsInFolder(folderID);
} }
}
public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
{ {