aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
authorDiva Canto2010-05-09 13:39:56 -0700
committerDiva Canto2010-05-09 13:39:56 -0700
commitb233a4b2cab3a39f9edc17130cd7c2f2f807d6bb (patch)
tree0f895f8334a1f98f3ed9f273906f989314400ce5 /OpenSim/Data/SQLite
parentAdd Delete handler to SQLite (NG) (diff)
downloadopensim-SC_OLD-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.zip
opensim-SC_OLD-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.tar.gz
opensim-SC_OLD-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.tar.bz2
opensim-SC_OLD-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/SQLite')
-rw-r--r--OpenSim/Data/SQLite/Resources/005_AssetStore.sql5
-rw-r--r--OpenSim/Data/SQLite/Resources/019_RegionStore.sql5
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs10
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs3
4 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Data/SQLite/Resources/005_AssetStore.sql b/OpenSim/Data/SQLite/Resources/005_AssetStore.sql
new file mode 100644
index 0000000..f06121a
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/005_AssetStore.sql
@@ -0,0 +1,5 @@
1BEGIN;
2
3ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0;
4
5COMMIT;
diff --git a/OpenSim/Data/SQLite/Resources/019_RegionStore.sql b/OpenSim/Data/SQLite/Resources/019_RegionStore.sql
new file mode 100644
index 0000000..d62f848
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/019_RegionStore.sql
@@ -0,0 +1,5 @@
1BEGIN;
2
3ALTER TABLE regionsettings ADD COLUMN map_tile_ID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
4
5COMMIT; \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 2783ba1..7d6df8d 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -46,8 +46,8 @@ namespace OpenSim.Data.SQLite
46 private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; 46 private const string SelectAssetSQL = "select * from assets where UUID=:UUID";
47 private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, UUID from assets limit :start, :count"; 47 private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, UUID from assets limit :start, :count";
48 private const string DeleteAssetSQL = "delete from assets where UUID=:UUID"; 48 private const string DeleteAssetSQL = "delete from assets where UUID=:UUID";
49 private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, Local, Temporary, Data) values(:UUID, :Name, :Description, :Type, :Local, :Temporary, :Data)"; 49 private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, Local, Temporary, asset_flags, Data) values(:UUID, :Name, :Description, :Type, :Local, :Temporary, :Flags, :Data)";
50 private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID"; 50 private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, Local=:Local, Temporary=:Temporary, asset_flags=:Flags, Data=:Data where UUID=:UUID";
51 private const string assetSelect = "select * from assets"; 51 private const string assetSelect = "select * from assets";
52 52
53 private SqliteConnection m_conn; 53 private SqliteConnection m_conn;
@@ -136,6 +136,7 @@ namespace OpenSim.Data.SQLite
136 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); 136 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type));
137 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); 137 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
138 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); 138 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
139 cmd.Parameters.Add(new SqliteParameter(":Flags", asset.Flags));
139 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); 140 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
140 141
141 cmd.ExecuteNonQuery(); 142 cmd.ExecuteNonQuery();
@@ -154,6 +155,7 @@ namespace OpenSim.Data.SQLite
154 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); 155 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type));
155 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); 156 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
156 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); 157 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
158 cmd.Parameters.Add(new SqliteParameter(":Flags", asset.Flags));
157 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); 159 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
158 160
159 cmd.ExecuteNonQuery(); 161 cmd.ExecuteNonQuery();
@@ -227,7 +229,8 @@ namespace OpenSim.Data.SQLite
227 asset.Description = (String) row["Description"]; 229 asset.Description = (String) row["Description"];
228 asset.Local = Convert.ToBoolean(row["Local"]); 230 asset.Local = Convert.ToBoolean(row["Local"]);
229 asset.Temporary = Convert.ToBoolean(row["Temporary"]); 231 asset.Temporary = Convert.ToBoolean(row["Temporary"]);
230 asset.Data = (byte[]) row["Data"]; 232 asset.Flags = (AssetFlags)Convert.ToInt32(row["asset_flags"]);
233 asset.Data = (byte[])row["Data"];
231 return asset; 234 return asset;
232 } 235 }
233 236
@@ -240,6 +243,7 @@ namespace OpenSim.Data.SQLite
240 metadata.Description = (string) row["Description"]; 243 metadata.Description = (string) row["Description"];
241 metadata.Type = Convert.ToSByte(row["Type"]); 244 metadata.Type = Convert.ToSByte(row["Type"]);
242 metadata.Temporary = Convert.ToBoolean(row["Temporary"]); // Not sure if this is correct. 245 metadata.Temporary = Convert.ToBoolean(row["Temporary"]); // Not sure if this is correct.
246 metadata.Flags = (AssetFlags)Convert.ToInt32(row["asset_flags"]);
243 247
244 // Current SHA1s are not stored/computed. 248 // Current SHA1s are not stored/computed.
245 metadata.SHA1 = new byte[] {}; 249 metadata.SHA1 = new byte[] {};
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 997664a..85703dc 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -1156,6 +1156,7 @@ namespace OpenSim.Data.SQLite
1156 createCol(regionsettings, "fixed_sun", typeof (Int32)); 1156 createCol(regionsettings, "fixed_sun", typeof (Int32));
1157 createCol(regionsettings, "sun_position", typeof (Double)); 1157 createCol(regionsettings, "sun_position", typeof (Double));
1158 createCol(regionsettings, "covenant", typeof(String)); 1158 createCol(regionsettings, "covenant", typeof(String));
1159 createCol(regionsettings, "map_tile_ID", typeof(String));
1159 regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] }; 1160 regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] };
1160 return regionsettings; 1161 return regionsettings;
1161 } 1162 }
@@ -1474,6 +1475,7 @@ namespace OpenSim.Data.SQLite
1474 newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); 1475 newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
1475 newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); 1476 newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
1476 newSettings.Covenant = new UUID((String) row["covenant"]); 1477 newSettings.Covenant = new UUID((String) row["covenant"]);
1478 newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
1477 1479
1478 return newSettings; 1480 return newSettings;
1479 } 1481 }
@@ -1792,6 +1794,7 @@ namespace OpenSim.Data.SQLite
1792 row["fixed_sun"] = settings.FixedSun; 1794 row["fixed_sun"] = settings.FixedSun;
1793 row["sun_position"] = settings.SunPosition; 1795 row["sun_position"] = settings.SunPosition;
1794 row["covenant"] = settings.Covenant.ToString(); 1796 row["covenant"] = settings.Covenant.ToString();
1797 row["map_tile_ID"] = settings.TerrainImageID.ToString();
1795 } 1798 }
1796 1799
1797 /// <summary> 1800 /// <summary>