aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
authorUbitUmarov2016-09-17 16:42:40 +0100
committerUbitUmarov2016-09-17 16:42:40 +0100
commit71bd3ce49f1159251ec4339d098d93c2119729f0 (patch)
treeb9d73349600abc18b63ee5201fc60b8a1d810334 /OpenSim/Data/SQLite
parent add to databases a table to store baked terrain. (diff)
downloadopensim-SC_OLD-71bd3ce49f1159251ec4339d098d93c2119729f0.zip
opensim-SC_OLD-71bd3ce49f1159251ec4339d098d93c2119729f0.tar.gz
opensim-SC_OLD-71bd3ce49f1159251ec4339d098d93c2119729f0.tar.bz2
opensim-SC_OLD-71bd3ce49f1159251ec4339d098d93c2119729f0.tar.xz
add load baked terrain methods
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 76b367a..0d565f7 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -950,6 +950,34 @@ namespace OpenSim.Data.SQLite
950 return terrData; 950 return terrData;
951 } 951 }
952 952
953 public TerrainData LoadBakedTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
954 {
955 TerrainData terrData = null;
956
957 lock (ds)
958 {
959 String sql = "select RegionUUID, Revision, Heightfield from backedterrain" +
960 " where RegionUUID=:RegionUUID";
961
962 using (SqliteCommand cmd = new SqliteCommand(sql, m_conn))
963 {
964 cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
965
966 using (IDataReader row = cmd.ExecuteReader())
967 {
968 int rev = 0;
969 if (row.Read())
970 {
971 rev = Convert.ToInt32(row["Revision"]);
972 byte[] blob = (byte[])row["Heightfield"];
973 terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
974 }
975 }
976 }
977 }
978 return terrData;
979 }
980
953 public void RemoveLandObject(UUID globalID) 981 public void RemoveLandObject(UUID globalID)
954 { 982 {
955 lock (ds) 983 lock (ds)