diff options
author | Mike Mazur | 2009-02-04 00:01:36 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-04 00:01:36 +0000 |
commit | 0c03a48fb2060eda4d288e2d2ca4e650ce000b4b (patch) | |
tree | a90465075960c92367b0a5e62db3121e4e3a139d /OpenSim/Data/MySQL | |
parent | * Add another object to the existing save oar test (diff) | |
download | opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2 opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz |
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 3ff2a1a..823fa78 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -139,18 +139,18 @@ namespace OpenSim.Data.MySQL | |||
139 | { | 139 | { |
140 | asset = new AssetBase(); | 140 | asset = new AssetBase(); |
141 | asset.Data = (byte[]) dbReader["data"]; | 141 | asset.Data = (byte[]) dbReader["data"]; |
142 | asset.Description = (string) dbReader["description"]; | 142 | asset.Metadata.Description = (string) dbReader["description"]; |
143 | asset.FullID = assetID; | 143 | asset.Metadata.FullID = assetID; |
144 | try | 144 | try |
145 | { | 145 | { |
146 | asset.Local = (bool)dbReader["local"]; | 146 | asset.Metadata.Local = (bool)dbReader["local"]; |
147 | } | 147 | } |
148 | catch (System.InvalidCastException) | 148 | catch (System.InvalidCastException) |
149 | { | 149 | { |
150 | asset.Local = false; | 150 | asset.Metadata.Local = false; |
151 | } | 151 | } |
152 | asset.Name = (string) dbReader["name"]; | 152 | asset.Metadata.Name = (string) dbReader["name"]; |
153 | asset.Type = (sbyte) dbReader["assetType"]; | 153 | asset.Metadata.Type = (sbyte) dbReader["assetType"]; |
154 | } | 154 | } |
155 | dbReader.Close(); | 155 | dbReader.Close(); |
156 | cmd.Dispose(); | 156 | cmd.Dispose(); |
@@ -178,8 +178,8 @@ namespace OpenSim.Data.MySQL | |||
178 | { | 178 | { |
179 | lock (_dbConnection) | 179 | lock (_dbConnection) |
180 | { | 180 | { |
181 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); | 181 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.Metadata.FullID)); |
182 | if (ExistsAsset(asset.FullID)) | 182 | if (ExistsAsset(asset.Metadata.FullID)) |
183 | { | 183 | { |
184 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); | 184 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); |
185 | return; | 185 | return; |
@@ -200,12 +200,12 @@ namespace OpenSim.Data.MySQL | |||
200 | { | 200 | { |
201 | // create unix epoch time | 201 | // create unix epoch time |
202 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 202 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
203 | cmd.Parameters.AddWithValue("?id", asset.FullID.ToString()); | 203 | cmd.Parameters.AddWithValue("?id", asset.Metadata.ID); |
204 | cmd.Parameters.AddWithValue("?name", asset.Name); | 204 | cmd.Parameters.AddWithValue("?name", asset.Metadata.Name); |
205 | cmd.Parameters.AddWithValue("?description", asset.Description); | 205 | cmd.Parameters.AddWithValue("?description", asset.Metadata.Description); |
206 | cmd.Parameters.AddWithValue("?assetType", asset.Type); | 206 | cmd.Parameters.AddWithValue("?assetType", asset.Metadata.Type); |
207 | cmd.Parameters.AddWithValue("?local", asset.Local); | 207 | cmd.Parameters.AddWithValue("?local", asset.Metadata.Local); |
208 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); | 208 | cmd.Parameters.AddWithValue("?temporary", asset.Metadata.Temporary); |
209 | cmd.Parameters.AddWithValue("?create_time", now); | 209 | cmd.Parameters.AddWithValue("?create_time", now); |
210 | cmd.Parameters.AddWithValue("?access_time", now); | 210 | cmd.Parameters.AddWithValue("?access_time", now); |
211 | cmd.Parameters.AddWithValue("?data", asset.Data); | 211 | cmd.Parameters.AddWithValue("?data", asset.Data); |
@@ -218,7 +218,7 @@ namespace OpenSim.Data.MySQL | |||
218 | m_log.ErrorFormat( | 218 | m_log.ErrorFormat( |
219 | "[ASSETS DB]: " + | 219 | "[ASSETS DB]: " + |
220 | "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() | 220 | "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() |
221 | + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); | 221 | + Environment.NewLine + "Attempting reconnection", asset.Metadata.FullID, asset.Metadata.Name); |
222 | _dbConnection.Reconnect(); | 222 | _dbConnection.Reconnect(); |
223 | } | 223 | } |
224 | } | 224 | } |
@@ -241,7 +241,7 @@ namespace OpenSim.Data.MySQL | |||
241 | { | 241 | { |
242 | // create unix epoch time | 242 | // create unix epoch time |
243 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 243 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
244 | cmd.Parameters.AddWithValue("?id", asset.FullID.ToString()); | 244 | cmd.Parameters.AddWithValue("?id", asset.Metadata.ID); |
245 | cmd.Parameters.AddWithValue("?access_time", now); | 245 | cmd.Parameters.AddWithValue("?access_time", now); |
246 | cmd.ExecuteNonQuery(); | 246 | cmd.ExecuteNonQuery(); |
247 | cmd.Dispose(); | 247 | cmd.Dispose(); |
@@ -252,7 +252,7 @@ namespace OpenSim.Data.MySQL | |||
252 | m_log.ErrorFormat( | 252 | m_log.ErrorFormat( |
253 | "[ASSETS DB]: " + | 253 | "[ASSETS DB]: " + |
254 | "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString() | 254 | "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString() |
255 | + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); | 255 | + Environment.NewLine + "Attempting reconnection", asset.Metadata.FullID, asset.Metadata.Name); |
256 | _dbConnection.Reconnect(); | 256 | _dbConnection.Reconnect(); |
257 | } | 257 | } |
258 | } | 258 | } |