diff options
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r-- | OpenSim/Data/SQLite/Properties/AssemblyInfo.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/Resources/RegionStore.migrations | 17 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 28 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 37 |
4 files changed, 78 insertions, 8 deletions
diff --git a/OpenSim/Data/SQLite/Properties/AssemblyInfo.cs b/OpenSim/Data/SQLite/Properties/AssemblyInfo.cs index c9a8553..992982c 100644 --- a/OpenSim/Data/SQLite/Properties/AssemblyInfo.cs +++ b/OpenSim/Data/SQLite/Properties/AssemblyInfo.cs | |||
@@ -61,5 +61,5 @@ using System.Runtime.InteropServices; | |||
61 | // You can specify all the values or you can default the Revision and Build Numbers | 61 | // You can specify all the values or you can default the Revision and Build Numbers |
62 | // by using the '*' as shown below: | 62 | // by using the '*' as shown below: |
63 | 63 | ||
64 | [assembly : AssemblyVersion("0.7.5.*")] | 64 | [assembly : AssemblyVersion("0.7.6.*")] |
65 | [assembly : AssemblyFileVersion("0.6.5.0")] | 65 | |
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index e872977..c6f4b48 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations | |||
@@ -575,3 +575,20 @@ CREATE TABLE `regionenvironment` ( | |||
575 | ); | 575 | ); |
576 | 576 | ||
577 | COMMIT; | 577 | COMMIT; |
578 | |||
579 | :VERSION 27 | ||
580 | BEGIN; | ||
581 | ALTER TABLE prims ADD COLUMN DynAttrs TEXT; | ||
582 | COMMIT; | ||
583 | |||
584 | :VERSION 28 | ||
585 | |||
586 | BEGIN; | ||
587 | |||
588 | ALTER TABLE prims ADD COLUMN `PhysicsShapeType` tinyint(4) NOT NULL default '0'; | ||
589 | ALTER TABLE prims ADD COLUMN `Density` double NOT NULL default '1000'; | ||
590 | ALTER TABLE prims ADD COLUMN `GravityModifier` double NOT NULL default '1'; | ||
591 | ALTER TABLE prims ADD COLUMN `Friction` double NOT NULL default '0.6'; | ||
592 | ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5'; | ||
593 | |||
594 | COMMIT; | ||
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index b94a58c..82320ca 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Data.SQLite | |||
46 | /// </summary> | 46 | /// </summary> |
47 | public class SQLiteAssetData : AssetDataBase | 47 | public class SQLiteAssetData : AssetDataBase |
48 | { | 48 | { |
49 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; | 51 | private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; |
52 | private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, asset_flags, UUID, CreatorID from assets limit :start, :count"; | 52 | private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, asset_flags, UUID, CreatorID from assets limit :start, :count"; |
@@ -133,6 +133,24 @@ namespace OpenSim.Data.SQLite | |||
133 | /// <param name="asset">Asset Base</param> | 133 | /// <param name="asset">Asset Base</param> |
134 | override public bool StoreAsset(AssetBase asset) | 134 | override public bool StoreAsset(AssetBase asset) |
135 | { | 135 | { |
136 | string assetName = asset.Name; | ||
137 | if (asset.Name.Length > 64) | ||
138 | { | ||
139 | assetName = asset.Name.Substring(0, 64); | ||
140 | m_log.WarnFormat( | ||
141 | "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", | ||
142 | asset.Name, asset.ID, asset.Name.Length, assetName.Length); | ||
143 | } | ||
144 | |||
145 | string assetDescription = asset.Description; | ||
146 | if (asset.Description.Length > 64) | ||
147 | { | ||
148 | assetDescription = asset.Description.Substring(0, 64); | ||
149 | m_log.WarnFormat( | ||
150 | "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", | ||
151 | asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); | ||
152 | } | ||
153 | |||
136 | //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); | 154 | //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); |
137 | if (ExistsAsset(asset.FullID)) | 155 | if (ExistsAsset(asset.FullID)) |
138 | { | 156 | { |
@@ -143,8 +161,8 @@ namespace OpenSim.Data.SQLite | |||
143 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) | 161 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) |
144 | { | 162 | { |
145 | cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); | 163 | cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); |
146 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); | 164 | cmd.Parameters.Add(new SqliteParameter(":Name", assetName)); |
147 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); | 165 | cmd.Parameters.Add(new SqliteParameter(":Description", assetDescription)); |
148 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 166 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
149 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 167 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
150 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 168 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
@@ -164,8 +182,8 @@ namespace OpenSim.Data.SQLite | |||
164 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) | 182 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) |
165 | { | 183 | { |
166 | cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); | 184 | cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); |
167 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); | 185 | cmd.Parameters.Add(new SqliteParameter(":Name", assetName)); |
168 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); | 186 | cmd.Parameters.Add(new SqliteParameter(":Description", assetDescription)); |
169 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 187 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
170 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 188 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
171 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 189 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 42cd59d..99a6598 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -1232,6 +1232,14 @@ namespace OpenSim.Data.SQLite | |||
1232 | createCol(prims, "VolumeDetect", typeof(Int16)); | 1232 | createCol(prims, "VolumeDetect", typeof(Int16)); |
1233 | 1233 | ||
1234 | createCol(prims, "MediaURL", typeof(String)); | 1234 | createCol(prims, "MediaURL", typeof(String)); |
1235 | |||
1236 | createCol(prims, "DynAttrs", typeof(String)); | ||
1237 | |||
1238 | createCol(prims, "PhysicsShapeType", typeof(Byte)); | ||
1239 | createCol(prims, "Density", typeof(Double)); | ||
1240 | createCol(prims, "GravityModifier", typeof(Double)); | ||
1241 | createCol(prims, "Friction", typeof(Double)); | ||
1242 | createCol(prims, "Restitution", typeof(Double)); | ||
1235 | 1243 | ||
1236 | // Add in contraints | 1244 | // Add in contraints |
1237 | prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; | 1245 | prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; |
@@ -1711,6 +1719,22 @@ namespace OpenSim.Data.SQLite | |||
1711 | // m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); | 1719 | // m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); |
1712 | prim.MediaUrl = (string)row["MediaURL"]; | 1720 | prim.MediaUrl = (string)row["MediaURL"]; |
1713 | } | 1721 | } |
1722 | |||
1723 | if (!(row["DynAttrs"] is System.DBNull)) | ||
1724 | { | ||
1725 | //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); | ||
1726 | prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); | ||
1727 | } | ||
1728 | else | ||
1729 | { | ||
1730 | prim.DynAttrs = new DAMap(); | ||
1731 | } | ||
1732 | |||
1733 | prim.PhysicsShapeType = Convert.ToByte(row["PhysicsShapeType"]); | ||
1734 | prim.Density = Convert.ToSingle(row["Density"]); | ||
1735 | prim.GravityModifier = Convert.ToSingle(row["GravityModifier"]); | ||
1736 | prim.Friction = Convert.ToSingle(row["Friction"]); | ||
1737 | prim.Restitution = Convert.ToSingle(row["Restitution"]); | ||
1714 | 1738 | ||
1715 | return prim; | 1739 | return prim; |
1716 | } | 1740 | } |
@@ -2133,6 +2157,17 @@ namespace OpenSim.Data.SQLite | |||
2133 | row["VolumeDetect"] = 0; | 2157 | row["VolumeDetect"] = 0; |
2134 | 2158 | ||
2135 | row["MediaURL"] = prim.MediaUrl; | 2159 | row["MediaURL"] = prim.MediaUrl; |
2160 | |||
2161 | if (prim.DynAttrs.Count > 0) | ||
2162 | row["DynAttrs"] = prim.DynAttrs.ToXml(); | ||
2163 | else | ||
2164 | row["DynAttrs"] = null; | ||
2165 | |||
2166 | row["PhysicsShapeType"] = prim.PhysicsShapeType; | ||
2167 | row["Density"] = (double)prim.Density; | ||
2168 | row["GravityModifier"] = (double)prim.GravityModifier; | ||
2169 | row["Friction"] = (double)prim.Friction; | ||
2170 | row["Restitution"] = (double)prim.Restitution; | ||
2136 | } | 2171 | } |
2137 | 2172 | ||
2138 | /// <summary> | 2173 | /// <summary> |
@@ -2392,7 +2427,7 @@ namespace OpenSim.Data.SQLite | |||
2392 | 2427 | ||
2393 | if (!(row["Media"] is System.DBNull)) | 2428 | if (!(row["Media"] is System.DBNull)) |
2394 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); | 2429 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); |
2395 | 2430 | ||
2396 | return s; | 2431 | return s; |
2397 | } | 2432 | } |
2398 | 2433 | ||