diff options
author | Melanie | 2009-11-23 04:24:58 +0000 |
---|---|---|
committer | Melanie | 2009-11-23 04:24:58 +0000 |
commit | df121a7cd065cc067818f6a39a44ddaaab647fec (patch) | |
tree | 5cc0e157ff3aefad066c07a1ebea2ae4b1ebdbe4 /OpenSim/Data | |
parent | Merge branch 'master' into careminster (diff) | |
parent | * Adds a modicum of additional checking to the Inventory Service (MySQL only) (diff) | |
download | opensim-SC-df121a7cd065cc067818f6a39a44ddaaab647fec.zip opensim-SC-df121a7cd065cc067818f6a39a44ddaaab647fec.tar.gz opensim-SC-df121a7cd065cc067818f6a39a44ddaaab647fec.tar.bz2 opensim-SC-df121a7cd065cc067818f6a39a44ddaaab647fec.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 27 |
2 files changed, 24 insertions, 7 deletions
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 | |||
135 | 135 | ||
136 | List<T> result = new List<T>(); | 136 | List<T> result = new List<T>(); |
137 | 137 | ||
138 | while(reader.Read()) | 138 | while (reader.Read()) |
139 | { | 139 | { |
140 | T row = new T(); | 140 | T row = new T(); |
141 | 141 | ||
@@ -146,7 +146,7 @@ namespace OpenSim.Data.MySQL | |||
146 | int v = Convert.ToInt32(reader[name]); | 146 | int v = Convert.ToInt32(reader[name]); |
147 | m_Fields[name].SetValue(row, v != 0 ? true : false); | 147 | m_Fields[name].SetValue(row, v != 0 ? true : false); |
148 | } | 148 | } |
149 | else if(m_Fields[name].GetValue(row) is UUID) | 149 | else if (m_Fields[name].GetValue(row) is UUID) |
150 | { | 150 | { |
151 | UUID uuid = UUID.Zero; | 151 | UUID uuid = UUID.Zero; |
152 | 152 | ||
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 | |||
48 | /// </summary> | 48 | /// </summary> |
49 | private MySQLManager database; | 49 | private MySQLManager database; |
50 | 50 | ||
51 | private bool rollbackStore = false; | ||
52 | private bool opengridmode = false; | ||
53 | private string rollbackDir = ""; | ||
54 | |||
51 | public void Initialise() | 55 | public void Initialise() |
52 | { | 56 | { |
53 | m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); | 57 | m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); |
@@ -82,6 +86,10 @@ namespace OpenSim.Data.MySQL | |||
82 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | 86 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); |
83 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | 87 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); |
84 | 88 | ||
89 | rollbackDir = GridDataMySqlFile.ParseFileReadValue("rollbackdir"); | ||
90 | rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true"; | ||
91 | opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true"; | ||
92 | |||
85 | database = | 93 | database = |
86 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, | 94 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, |
87 | settingPort); | 95 | settingPort); |
@@ -851,16 +859,25 @@ namespace OpenSim.Data.MySQL | |||
851 | { | 859 | { |
852 | List<InventoryFolderBase> subFolders = getFolderHierarchy(folderID); | 860 | List<InventoryFolderBase> subFolders = getFolderHierarchy(folderID); |
853 | 861 | ||
854 | //Delete all sub-folders | 862 | // Dont delete in OGM - makes for easier restores if someone sends a malcious command. (just restore the folder entry) |
855 | foreach (InventoryFolderBase f in subFolders) | 863 | if (opengridmode == false) |
856 | { | 864 | { |
857 | deleteOneFolder(f.ID); | 865 | //Delete all sub-folders |
858 | deleteItemsInFolder(f.ID); | 866 | foreach (InventoryFolderBase f in subFolders) |
867 | { | ||
868 | deleteOneFolder(f.ID); | ||
869 | deleteItemsInFolder(f.ID); | ||
870 | } | ||
859 | } | 871 | } |
860 | 872 | ||
861 | //Delete the actual row | 873 | //Delete the actual row |
862 | deleteOneFolder(folderID); | 874 | deleteOneFolder(folderID); |
863 | deleteItemsInFolder(folderID); | 875 | |
876 | // Just delete the folder context in OGM | ||
877 | if (opengridmode == false) | ||
878 | { | ||
879 | deleteItemsInFolder(folderID); | ||
880 | } | ||
864 | } | 881 | } |
865 | 882 | ||
866 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) | 883 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) |