diff options
author | Diva Canto | 2010-05-09 13:39:56 -0700 |
---|---|---|
committer | Diva Canto | 2010-05-09 13:39:56 -0700 |
commit | b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb (patch) | |
tree | 0f895f8334a1f98f3ed9f273906f989314400ce5 /OpenSim/Data/MySQL | |
parent | Add Delete handler to SQLite (NG) (diff) | |
download | opensim-SC-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.zip opensim-SC-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.tar.gz opensim-SC-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.tar.bz2 opensim-SC-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.tar.xz |
* Fixed spamming the assets table with map tiles. The tile image ID is now stored in regionsettings. Upon generation of a new tile image, the old one is deleted. Tested for SQLite and MySql standalone.
* Fixed small bug with map search where the local sim regions weren't found.
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 5 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/033_RegionStore.sql | 3 |
3 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 35eed56..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 | } |
@@ -345,7 +346,7 @@ namespace OpenSim.Data.MySQL | |||
345 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 346 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
346 | { | 347 | { |
347 | dbcon.Open(); | 348 | dbcon.Open(); |
348 | MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id"); | 349 | MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id", dbcon); |
349 | cmd.Parameters.AddWithValue("?id", id); | 350 | cmd.Parameters.AddWithValue("?id", id); |
350 | cmd.ExecuteNonQuery(); | 351 | cmd.ExecuteNonQuery(); |
351 | 352 | ||
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index a395ddc..8c83ef1 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | |||
@@ -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 | "?map_tile_ID, ?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/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; | ||