aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
authorDiva Canto2009-08-19 17:36:34 -0700
committerDiva Canto2009-08-19 17:36:34 -0700
commita3db2936f7b9297815244d39cdb33c26d17c70e2 (patch)
tree6f5c6626f94f878a020412f348dcbc51aadd2312 /OpenSim/Data/SQLite
parentFixes GetItem and GetFolder for SQLite. Turns out some methods were no-op in ... (diff)
parentFixing a spot I missed in assets. Switching Grid to the new naming schema wit... (diff)
downloadopensim-SC-a3db2936f7b9297815244d39cdb33c26d17c70e2.zip
opensim-SC-a3db2936f7b9297815244d39cdb33c26d17c70e2.tar.gz
opensim-SC-a3db2936f7b9297815244d39cdb33c26d17c70e2.tar.bz2
opensim-SC-a3db2936f7b9297815244d39cdb33c26d17c70e2.tar.xz
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs47
-rw-r--r--OpenSim/Data/SQLite/SQLiteGridData.cs10
2 files changed, 21 insertions, 36 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 72af7a0..3831467 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Data.SQLite
90 /// </summary> 90 /// </summary>
91 /// <param name="uuid">UUID of ... ?</param> 91 /// <param name="uuid">UUID of ... ?</param>
92 /// <returns>Asset base</returns> 92 /// <returns>Asset base</returns>
93 override protected AssetBase FetchStoredAsset(UUID uuid) 93 override public AssetBase GetAsset(UUID uuid)
94 { 94 {
95 lock (this) 95 lock (this)
96 { 96 {
@@ -119,18 +119,16 @@ namespace OpenSim.Data.SQLite
119 /// Create an asset 119 /// Create an asset
120 /// </summary> 120 /// </summary>
121 /// <param name="asset">Asset Base</param> 121 /// <param name="asset">Asset Base</param>
122 override public void CreateAsset(AssetBase asset) 122 override public void StoreAsset(AssetBase asset)
123 { 123 {
124 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); 124 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
125 if (ExistsAsset(asset.FullID)) 125 if (ExistsAsset(asset.FullID))
126 { 126 {
127 //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); 127 LogAssetLoad(asset);
128 } 128
129 else
130 {
131 lock (this) 129 lock (this)
132 { 130 {
133 using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) 131 using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn))
134 { 132 {
135 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); 133 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString()));
136 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); 134 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name));
@@ -144,29 +142,22 @@ namespace OpenSim.Data.SQLite
144 } 142 }
145 } 143 }
146 } 144 }
147 } 145 else
148
149 /// <summary>
150 /// Update an asset
151 /// </summary>
152 /// <param name="asset"></param>
153 override public void UpdateAsset(AssetBase asset)
154 {
155 LogAssetLoad(asset);
156
157 lock (this)
158 { 146 {
159 using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) 147 lock (this)
160 { 148 {
161 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); 149 using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn))
162 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); 150 {
163 cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); 151 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString()));
164 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); 152 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name));
165 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); 153 cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description));
166 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); 154 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type));
167 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); 155 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
168 156 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
169 cmd.ExecuteNonQuery(); 157 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
158
159 cmd.ExecuteNonQuery();
160 }
170 } 161 }
171 } 162 }
172 } 163 }
diff --git a/OpenSim/Data/SQLite/SQLiteGridData.cs b/OpenSim/Data/SQLite/SQLiteGridData.cs
index 4107594..18abb88 100644
--- a/OpenSim/Data/SQLite/SQLiteGridData.cs
+++ b/OpenSim/Data/SQLite/SQLiteGridData.cs
@@ -203,7 +203,7 @@ namespace OpenSim.Data.SQLite
203 /// </summary> 203 /// </summary>
204 /// <param name="profile">The profile to add</param> 204 /// <param name="profile">The profile to add</param>
205 /// <returns>A dataresponse enum indicating success</returns> 205 /// <returns>A dataresponse enum indicating success</returns>
206 override public DataResponse AddProfile(RegionProfileData profile) 206 override public DataResponse StoreProfile(RegionProfileData profile)
207 { 207 {
208 if (database.insertRow(profile)) 208 if (database.insertRow(profile))
209 { 209 {
@@ -215,17 +215,11 @@ namespace OpenSim.Data.SQLite
215 } 215 }
216 } 216 }
217 217
218 override public DataResponse UpdateProfile(RegionProfileData profile) 218 /// <summary>
219 {
220 return AddProfile(profile);
221 }
222
223 /// <summary>
224 /// Deletes a sim profile from the database 219 /// Deletes a sim profile from the database
225 /// </summary> 220 /// </summary>
226 /// <param name="uuid">the sim UUID</param> 221 /// <param name="uuid">the sim UUID</param>
227 /// <returns>Successful?</returns> 222 /// <returns>Successful?</returns>
228 //public DataResponse DeleteProfile(RegionProfileData profile)
229 override public DataResponse DeleteProfile(string uuid) 223 override public DataResponse DeleteProfile(string uuid)
230 { 224 {
231 Dictionary<string, string> param = new Dictionary<string, string>(); 225 Dictionary<string, string> param = new Dictionary<string, string>();