aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs47
-rw-r--r--OpenSim/Data/SQLite/SQLiteGridData.cs10
-rw-r--r--OpenSim/Data/SQLite/SQLiteInventoryStore.cs4
3 files changed, 23 insertions, 38 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>();
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
index e5f7a50..64591fd 100644
--- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
@@ -628,12 +628,12 @@ namespace OpenSim.Data.SQLite
628 628
629 public InventoryItemBase queryInventoryItem(UUID itemID) 629 public InventoryItemBase queryInventoryItem(UUID itemID)
630 { 630 {
631 return null; 631 return getInventoryItem(itemID);
632 } 632 }
633 633
634 public InventoryFolderBase queryInventoryFolder(UUID folderID) 634 public InventoryFolderBase queryInventoryFolder(UUID folderID)
635 { 635 {
636 return null; 636 return getInventoryFolder(folderID);
637 } 637 }
638 638
639 /// <summary> 639 /// <summary>