diff options
author | Tom Grimshaw | 2010-05-10 05:44:24 -0700 |
---|---|---|
committer | Tom Grimshaw | 2010-05-10 05:44:24 -0700 |
commit | 2e94c757296973e07529ad6ae927d9d9251627b6 (patch) | |
tree | 5fb348ddf750087898a6fcdfe0a492c305b35d3b /OpenSim/Data/MySQL | |
parent | Greatly improve login time for users with large friends lists by requesting a... (diff) | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC-2e94c757296973e07529ad6ae927d9d9251627b6.zip opensim-SC-2e94c757296973e07529ad6ae927d9d9251627b6.tar.gz opensim-SC-2e94c757296973e07529ad6ae927d9d9251627b6.tar.bz2 opensim-SC-2e94c757296973e07529ad6ae927d9d9251627b6.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 29 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/007_AssetStore.sql | 5 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/033_RegionStore.sql | 3 |
4 files changed, 39 insertions, 6 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index d55369a..13f5fa2 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -111,7 +111,7 @@ namespace OpenSim.Data.MySQL | |||
111 | dbcon.Open(); | 111 | dbcon.Open(); |
112 | 112 | ||
113 | using (MySqlCommand cmd = new MySqlCommand( | 113 | using (MySqlCommand cmd = new MySqlCommand( |
114 | "SELECT name, description, assetType, local, temporary, data FROM assets WHERE id=?id", | 114 | "SELECT name, description, assetType, local, temporary, asset_flags, data FROM assets WHERE id=?id", |
115 | dbcon)) | 115 | dbcon)) |
116 | { | 116 | { |
117 | cmd.Parameters.AddWithValue("?id", assetID.ToString()); | 117 | cmd.Parameters.AddWithValue("?id", assetID.ToString()); |
@@ -133,6 +133,7 @@ namespace OpenSim.Data.MySQL | |||
133 | asset.Local = false; | 133 | asset.Local = false; |
134 | 134 | ||
135 | asset.Temporary = Convert.ToBoolean(dbReader["temporary"]); | 135 | asset.Temporary = Convert.ToBoolean(dbReader["temporary"]); |
136 | asset.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]); | ||
136 | } | 137 | } |
137 | } | 138 | } |
138 | } | 139 | } |
@@ -161,8 +162,8 @@ namespace OpenSim.Data.MySQL | |||
161 | 162 | ||
162 | MySqlCommand cmd = | 163 | MySqlCommand cmd = |
163 | new MySqlCommand( | 164 | new MySqlCommand( |
164 | "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, data)" + | 165 | "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, data)" + |
165 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", | 166 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?data)", |
166 | dbcon); | 167 | dbcon); |
167 | 168 | ||
168 | string assetName = asset.Name; | 169 | string assetName = asset.Name; |
@@ -194,6 +195,7 @@ namespace OpenSim.Data.MySQL | |||
194 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); | 195 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); |
195 | cmd.Parameters.AddWithValue("?create_time", now); | 196 | cmd.Parameters.AddWithValue("?create_time", now); |
196 | cmd.Parameters.AddWithValue("?access_time", now); | 197 | cmd.Parameters.AddWithValue("?access_time", now); |
198 | cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags); | ||
197 | cmd.Parameters.AddWithValue("?data", asset.Data); | 199 | cmd.Parameters.AddWithValue("?data", asset.Data); |
198 | cmd.ExecuteNonQuery(); | 200 | cmd.ExecuteNonQuery(); |
199 | cmd.Dispose(); | 201 | cmd.Dispose(); |
@@ -302,7 +304,7 @@ namespace OpenSim.Data.MySQL | |||
302 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 304 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
303 | { | 305 | { |
304 | dbcon.Open(); | 306 | dbcon.Open(); |
305 | MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id FROM assets LIMIT ?start, ?count", dbcon); | 307 | MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags FROM assets LIMIT ?start, ?count", dbcon); |
306 | cmd.Parameters.AddWithValue("?start", start); | 308 | cmd.Parameters.AddWithValue("?start", start); |
307 | cmd.Parameters.AddWithValue("?count", count); | 309 | cmd.Parameters.AddWithValue("?count", count); |
308 | 310 | ||
@@ -317,6 +319,7 @@ namespace OpenSim.Data.MySQL | |||
317 | metadata.Description = (string)dbReader["description"]; | 319 | metadata.Description = (string)dbReader["description"]; |
318 | metadata.Type = (sbyte)dbReader["assetType"]; | 320 | metadata.Type = (sbyte)dbReader["assetType"]; |
319 | metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. | 321 | metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. |
322 | metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]); | ||
320 | metadata.FullID = new UUID((string)dbReader["id"]); | 323 | metadata.FullID = new UUID((string)dbReader["id"]); |
321 | 324 | ||
322 | // Current SHA1s are not stored/computed. | 325 | // Current SHA1s are not stored/computed. |
@@ -336,6 +339,24 @@ namespace OpenSim.Data.MySQL | |||
336 | return retList; | 339 | return retList; |
337 | } | 340 | } |
338 | 341 | ||
342 | public override bool Delete(string id) | ||
343 | { | ||
344 | lock (m_dbLock) | ||
345 | { | ||
346 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
347 | { | ||
348 | dbcon.Open(); | ||
349 | MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id", dbcon); | ||
350 | cmd.Parameters.AddWithValue("?id", id); | ||
351 | cmd.ExecuteNonQuery(); | ||
352 | |||
353 | cmd.Dispose(); | ||
354 | } | ||
355 | } | ||
356 | |||
357 | return true; | ||
358 | } | ||
359 | |||
339 | #endregion | 360 | #endregion |
340 | } | 361 | } |
341 | } | 362 | } |
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index a395ddc..07371e7 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | |||
@@ -975,7 +975,7 @@ namespace OpenSim.Data.MySQL | |||
975 | "use_estate_sun, fixed_sun, sun_position, " + | 975 | "use_estate_sun, fixed_sun, sun_position, " + |
976 | "covenant, Sandbox, sunvectorx, sunvectory, " + | 976 | "covenant, Sandbox, sunvectorx, sunvectory, " + |
977 | "sunvectorz, loaded_creation_datetime, " + | 977 | "sunvectorz, loaded_creation_datetime, " + |
978 | "loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " + | 978 | "loaded_creation_id, map_tile_ID) values (?RegionUUID, ?BlockTerraform, " + |
979 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + | 979 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + |
980 | "?AllowLandResell, ?AllowLandJoinDivide, " + | 980 | "?AllowLandResell, ?AllowLandJoinDivide, " + |
981 | "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + | 981 | "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + |
@@ -989,7 +989,8 @@ namespace OpenSim.Data.MySQL | |||
989 | "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + | 989 | "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + |
990 | "?SunPosition, ?Covenant, ?Sandbox, " + | 990 | "?SunPosition, ?Covenant, ?Sandbox, " + |
991 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 991 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
992 | "?LoadedCreationDateTime, ?LoadedCreationID)"; | 992 | "?LoadedCreationDateTime, ?LoadedCreationID, " + |
993 | "?TerrainImageID)"; | ||
993 | 994 | ||
994 | FillRegionSettingsCommand(cmd, rs); | 995 | FillRegionSettingsCommand(cmd, rs); |
995 | 996 | ||
@@ -1276,6 +1277,8 @@ namespace OpenSim.Data.MySQL | |||
1276 | else | 1277 | else |
1277 | newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; | 1278 | newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; |
1278 | 1279 | ||
1280 | newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]); | ||
1281 | |||
1279 | return newSettings; | 1282 | return newSettings; |
1280 | } | 1283 | } |
1281 | 1284 | ||
@@ -1596,6 +1599,7 @@ namespace OpenSim.Data.MySQL | |||
1596 | cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); | 1599 | cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); |
1597 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); | 1600 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); |
1598 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); | 1601 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); |
1602 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); | ||
1599 | 1603 | ||
1600 | } | 1604 | } |
1601 | 1605 | ||
diff --git a/OpenSim/Data/MySQL/Resources/007_AssetStore.sql b/OpenSim/Data/MySQL/Resources/007_AssetStore.sql new file mode 100644 index 0000000..f06121a --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/007_AssetStore.sql | |||
@@ -0,0 +1,5 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0; | ||
4 | |||
5 | COMMIT; | ||
diff --git a/OpenSim/Data/MySQL/Resources/033_RegionStore.sql b/OpenSim/Data/MySQL/Resources/033_RegionStore.sql new file mode 100644 index 0000000..2832b41 --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/033_RegionStore.sql | |||
@@ -0,0 +1,3 @@ | |||
1 | BEGIN; | ||
2 | ALTER TABLE regionsettings ADD map_tile_ID CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
3 | COMMIT; | ||