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/Region/Environment/Modules/Agent/AssetTransaction | |
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 'OpenSim/Region/Environment/Modules/Agent/AssetTransaction')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs | 36 |
2 files changed, 31 insertions, 31 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 689b4d5..7f4bb0b 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
72 | } | 72 | } |
73 | 73 | ||
74 | public void HandleXfer(ulong xferID, uint packetID, byte[] data) | 74 | public void HandleXfer(ulong xferID, uint packetID, byte[] data) |
75 | { | 75 | { |
76 | lock (XferUploaders) | 76 | lock (XferUploaders) |
77 | { | 77 | { |
78 | foreach (AssetXferUploader uploader in XferUploaders.Values) | 78 | foreach (AssetXferUploader uploader in XferUploaders.Values) |
@@ -97,8 +97,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
97 | wearableType, nextOwnerMask); | 97 | wearableType, nextOwnerMask); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | 102 | ||
103 | /// <summary> | 103 | /// <summary> |
104 | /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed. | 104 | /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed. |
@@ -171,10 +171,10 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
171 | "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", | 171 | "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", |
172 | item.Name, part.Name, transactionID); | 172 | item.Name, part.Name, transactionID); |
173 | 173 | ||
174 | asset.Name = item.Name; | 174 | asset.Metadata.Name = item.Name; |
175 | asset.Description = item.Description; | 175 | asset.Metadata.Description = item.Description; |
176 | asset.Type = (sbyte)item.Type; | 176 | asset.Metadata.Type = (sbyte)item.Type; |
177 | item.AssetID = asset.FullID; | 177 | item.AssetID = asset.Metadata.FullID; |
178 | 178 | ||
179 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); | 179 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); |
180 | 180 | ||
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
206 | asset = GetTransactionAsset(transactionID); | 206 | asset = GetTransactionAsset(transactionID); |
207 | } | 207 | } |
208 | 208 | ||
209 | if (asset != null && asset.FullID == assetID) | 209 | if (asset != null && asset.Metadata.FullID == assetID) |
210 | { | 210 | { |
211 | // Assets never get updated, new ones get created | 211 | // Assets never get updated, new ones get created |
212 | asset.FullID = UUID.Random(); | 212 | asset.Metadata.FullID = UUID.Random(); |
213 | asset.Name = item.Name; | 213 | asset.Metadata.Name = item.Name; |
214 | asset.Description = item.Description; | 214 | asset.Metadata.Description = item.Description; |
215 | asset.Type = (sbyte)item.AssetType; | 215 | asset.Metadata.Type = (sbyte)item.AssetType; |
216 | item.AssetID = asset.FullID; | 216 | item.AssetID = asset.Metadata.FullID; |
217 | 217 | ||
218 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); | 218 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); |
219 | } | 219 | } |
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs index 6dcbe83..5387165 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -113,17 +113,17 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
113 | { | 113 | { |
114 | ourClient = remoteClient; | 114 | ourClient = remoteClient; |
115 | m_asset = new AssetBase(); | 115 | m_asset = new AssetBase(); |
116 | m_asset.FullID = assetID; | 116 | m_asset.Metadata.FullID = assetID; |
117 | m_asset.Type = type; | 117 | m_asset.Metadata.Type = type; |
118 | m_asset.Data = data; | 118 | m_asset.Data = data; |
119 | m_asset.Name = "blank"; | 119 | m_asset.Metadata.Name = "blank"; |
120 | m_asset.Description = "empty"; | 120 | m_asset.Metadata.Description = "empty"; |
121 | m_asset.Local = storeLocal; | 121 | m_asset.Metadata.Local = storeLocal; |
122 | m_asset.Temporary = tempFile; | 122 | m_asset.Metadata.Temporary = tempFile; |
123 | 123 | ||
124 | TransactionID = transaction; | 124 | TransactionID = transaction; |
125 | m_storeLocal = storeLocal; | 125 | m_storeLocal = storeLocal; |
126 | 126 | ||
127 | if (m_asset.Data.Length > 2) | 127 | if (m_asset.Data.Length > 2) |
128 | { | 128 | { |
129 | SendCompleteMessage(); | 129 | SendCompleteMessage(); |
@@ -140,12 +140,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
140 | protected void RequestStartXfer() | 140 | protected void RequestStartXfer() |
141 | { | 141 | { |
142 | XferID = Util.GetNextXferID(); | 142 | XferID = Util.GetNextXferID(); |
143 | ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); | 143 | ourClient.SendXferRequest(XferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]); |
144 | } | 144 | } |
145 | 145 | ||
146 | protected void SendCompleteMessage() | 146 | protected void SendCompleteMessage() |
147 | { | 147 | { |
148 | ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID); | 148 | ourClient.SendAssetUploadCompleteMessage(m_asset.Metadata.Type, true, m_asset.Metadata.FullID); |
149 | 149 | ||
150 | m_finished = true; | 150 | m_finished = true; |
151 | if (m_createItem) | 151 | if (m_createItem) |
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
164 | DateTime now = DateTime.Now; | 164 | DateTime now = DateTime.Now; |
165 | string filename = | 165 | string filename = |
166 | String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, | 166 | String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, |
167 | now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type); | 167 | now.Hour, now.Minute, now.Second, m_asset.Metadata.Name, m_asset.Metadata.Type); |
168 | SaveAssetToFile(filename, m_asset.Data); | 168 | SaveAssetToFile(filename, m_asset.Data); |
169 | } | 169 | } |
170 | } | 170 | } |
@@ -196,9 +196,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
196 | this.invType = invType; | 196 | this.invType = invType; |
197 | this.wearableType = wearableType; | 197 | this.wearableType = wearableType; |
198 | nextPerm = nextOwnerMask; | 198 | nextPerm = nextOwnerMask; |
199 | m_asset.Name = name; | 199 | m_asset.Metadata.Name = name; |
200 | m_asset.Description = description; | 200 | m_asset.Metadata.Description = description; |
201 | m_asset.Type = type; | 201 | m_asset.Metadata.Type = type; |
202 | 202 | ||
203 | if (m_finished) | 203 | if (m_finished) |
204 | { | 204 | { |
@@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
211 | } | 211 | } |
212 | } | 212 | } |
213 | 213 | ||
214 | 214 | ||
215 | private void DoCreateItem() | 215 | private void DoCreateItem() |
216 | { | 216 | { |
217 | m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); | 217 | m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); |
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
225 | item.Owner = ourClient.AgentId; | 225 | item.Owner = ourClient.AgentId; |
226 | item.Creator = ourClient.AgentId; | 226 | item.Creator = ourClient.AgentId; |
227 | item.ID = UUID.Random(); | 227 | item.ID = UUID.Random(); |
228 | item.AssetID = m_asset.FullID; | 228 | item.AssetID = m_asset.Metadata.FullID; |
229 | item.Description = m_description; | 229 | item.Description = m_description; |
230 | item.Name = m_name; | 230 | item.Name = m_name; |
231 | item.AssetType = type; | 231 | item.AssetType = type; |
@@ -245,9 +245,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
245 | else | 245 | else |
246 | { | 246 | { |
247 | m_log.ErrorFormat( | 247 | m_log.ErrorFormat( |
248 | "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation", | 248 | "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation", |
249 | ourClient.AgentId); | 249 | ourClient.AgentId); |
250 | } | 250 | } |
251 | } | 251 | } |
252 | 252 | ||
253 | /// <summary> | 253 | /// <summary> |
@@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
260 | { | 260 | { |
261 | return m_asset; | 261 | return m_asset; |
262 | } | 262 | } |
263 | 263 | ||
264 | return null; | 264 | return null; |
265 | } | 265 | } |
266 | } | 266 | } |